Chinaunix首页 | 论坛 | 博客
  • 博客访问: 356307
  • 博文数量: 34
  • 博客积分: 2236
  • 博客等级: 大尉
  • 技术积分: 476
  • 用 户 组: 普通用户
  • 注册时间: 2006-02-25 14:36
文章分类

全部博文(34)

文章存档

2016年(2)

2014年(1)

2012年(2)

2011年(3)

2010年(3)

2009年(5)

2008年(9)

2007年(3)

2006年(6)

分类: 系统运维

2009-06-10 10:28:04

CISCO交换机上配置初步(含com telnet SSH2)
1 资源:硬件设备:cisco 29xx cisco35xx
        软件ios:  c2950-i6k2l2q4-mz.121-22.EA11.bin
  现在支持SSH2的IOS版本要求是k9版本
a 初步配置:
conf t
hostname 2s12l2950hzj1
ip domain-name 2s12l2950hzj1.domain
no ip domain-lookup                       ;关闭主机名查找 
int vlan 1
ip address 192.168.1.102 255.255.255.192  ;设置管理ip:vlan1的ip
no shutdown
exit
ip default-gateway 192.168.1.65
no ip http server             ;取消http和https
no ip http secure-server
line console 0
logging synchronous                       ;日志同步,作用:不打断当前命令行
password helpyingline                     ;串口登录密码
login 
exit
enable secret helpyingen                  ;en密码
测试串口登录和en密码
b 配置登录用户名和密码(ssh,本地和telnet认证):
line vty 0 4
password 0 helpyingtel
transport input all
login local                              
;这里的设置决定了telnet和ssh的登录,login则telnet登录密码是helpyingtel
;login local则ssh和他telnet的登录用户名和密码有以下决定(username admin secret 0 helpyingssh)
exit                  
测试telnet登录
c 配置ssh参数
crypto key generate rsa
  输入 1024
ip ssh authentication-retries 5           ;ssh登录次数限制
ip ssh version 2
ip ssh time-out 120
username admin secret 0 helpyingssh
wr
测试ssh登录
2s12l2950hzj1#dir
Directory of flash:/
    2  -rwx         149  Jan 01 1970 00:00:55 +00:00  env_vars
    3  -rwx     3721216  Jan 01 1970 01:08:02 +00:00  c2950-i6k2l2q4-mz.121-22.EA11.bin
    4  -rwx         736  Mar 01 1993 00:00:26 +00:00  vlan.dat
    6  -rwx        1458  Mar 01 1993 01:18:05 +00:00  config.text
    7  -rwx        1941  Mar 01 1993 01:18:05 +00:00  private-config.text
完整的配置如下:
2s12l2950hzj1#sh run
Building configuration...
Current configuration : 1458 bytes
!
version 12.1
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname 2s12l2950hzj1
!
enable secret 5 $1$oldg$TBQofrg8woCeXp7vsL8aM1
!
username admin password 0 helpyingssh
ip subnet-zero
!
no ip domain-lookup
ip domain-name 2s12l2950hzj1.domain
ip ssh time-out 120
ip ssh authentication-retries 5
ip ssh version 2
!
spanning-tree mode pvst
no spanning-tree optimize bpdu transmission
spanning-tree extend system-id
!
interface FastEthernet0/1
!
interface FastEthernet0/24
!
interface Vlan1
 ip address 192.168.1.102 255.255.255.192
 no ip route-cache
!
ip default-gateway 192.168.1.65
no ip http server
!
line con 0
 password helpyingline
 logging synchronous
 login
 stopbits 1
line vty 0 4
 password helpyingtel
 login local
line vty 5 15
 login
!
!
end
阅读(8213) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~