
神州数码配置命令总结 (已更新).doc
16页 第一部分 交换机配置一、基础配置1、模式进入Switch> Switch>en Switch#configSwitch(Config)#interface ethernet 0/22、配置交换机主机名 命令:hostname <主机名>3、配置交换机IP地址Switch(Config)#interface vlan 1 Switch(Config-If-Vlan1)#ip address 10.1.128.251 255.255.255.0 Switch(Config-If-Vlan1)#no shut4、为交换机设置Telnet授权用户和口令:登录到Telnet的配置界面,需要输入正确的用户名和口令,否则交换机将拒绝该Telnet用户的访问该项措施是为了保护交换机免受非授权用户的非法操作若交换机没有设置授权Telnet用户,则任何用户都无法进入交换机的Telnet配置界面因此在允许Telnet方式配置管理交换机时,必须在Console的全局配置模式下使用命令username
例:Switch>enableSwitch#configSwitch(config)#username test privilege 15 password 0 testSwitch(config)#authentication line vty login localSwitch(Config)#telnet-user test password 0 testSwitch (Config)#telnet-server enable://启动远程服务功能 5、配置允许Telnet管理交换机的地址限制(单独IP或IP地址段)(1)限制单个IP允许Telnet登录交换机switch(config)#authentication security ip 192.168.1.2(2)限制允许IP地址段Telnet登录交换机switch(config)#access-list 1 permit 192.168.1.0 0.0.0.255 switch(config)#authentication ip access-class 1 in5、为交换机设置Web授权用户和口令:web-user <用户名>password {0|7} <密码> 例:Switch(Config)#web-user admin password 0 digital 6、设置系统日期和时钟:clock set
(2)192.168.0.1/24中的“24”表示子网掩码为3个255 (3)主机所在的VLAN的子接口地址就是主机的网关五、端口安全配置1、启用和禁用端口安全功能: 启用:Switch(config-if)# switchport port-security 禁用:Switch(config-if)# no switchport port-security2、设置接口上安全地址的最大个数(1~128) Switch(config-if)#switchport port-security maximum 13、设置处理违例的方式Switch(config-if)#switchport port-security violation shutdown4、手工配置接口上的安全地址 Switch(config-if)#switchport port-security mac-address 00d0.d373.B0605、查看安全配置: Switch#show port-security六、设置广播风暴抑制功能Switch(Config)#broadcast-suppression
七、端口聚合 1、创建port group:Switch(Config)#port-group 1 //数字范围1-16 2、把物理端口加入组:Switch(Config-Ethernet0/0/1)#port-group 1 mode on3、进入port-channel 配置模式:Switch(Config)#interface port-channel 1 4、修改链路模式:switchport mode trunk第二部分 路由器配置一、路由器基本配置1、进入特权模式:Router>en2、进入全局配置模式:Router#config 3、定义路由器的名字为DCR :Router(Config)#hostname DCR 4、特权用户的口令:DCR (Config)#enable password 1234565、启动远程服务功能:DCR (Config)#telnet-server enable6、配置远程用户的口令:DCR (Config)#telnet admin password 7 admin7、配置时钟频率:Router(Config-Serial2/0)#physical-layer speed 640008、配置用户登录路由器时认证:aaa authentication login default local line enable9、配置进入特权模式时认证:aaa authentication enable default enable10、配置路由器的用户名密码:username admin password 0 admin00011、配置进入特权模式密码:enable password 0 admin000 level 15二、静态路由配置1、命令:ip route <目的IP> <子网掩码> {<接口名称>|<下一跳IP地址>} [<路由优先级>]
Router(config)#ip route 1.1.1.0 255.255.255.0 2.1.1.1 2、默认路由 ip route 0.0.0.0 0.0.0.0{<接口名称>|<下一跳IP地址>} [<路由优先级>]三、单臂路由1、打开端口:2、进入子接口配置IP地址,并封装dot1q协议到对应的VLANRouter_config#interface f0/0.1Router(config_f0/0.1)#ip address 192.168.100.1 255.255.255.0Router(config_f0/0.1)#encapsulation dot1Q 100 //封装dot1Q到VLAN 100Route(config_f0/0.1)#exitRouter_config#interface f0/0.2Router(config_f0/0.2)#ip address 192.168.200.1 255.255.255.0Router(config_f0/0.2)#encapsulation dot1Q 200 //封装dot1Q到VLAN 200Rout。












