1、神州数码交换机配置命令Telnet 远程 Shell 管理 设置交换机 IP 地址 Switch(config)#interface vlan 1 Switch(config-If-Vlan1)#ip address 10.1.1.1 255.255.255.0 Switch(config-If-Vlan1)#no shutdown 交换机设置 Telnet 授权用户和口令;若交换机没有设置授权 Telnet 用户,则任何用户都无法进入交换机的 CLI 配置界面。 Switch(config)#telnet-user test password 0 testHTTP 远程图形管理 设置交换机
2、IP 地址 Switch(config)#interface vlan 1 Switch(config-If-Vlan1)#ip address 10.1.1.1 255.255.255.0 Switch(config-If-Vlan1)#no shutdown 交换机启动 HTTP Server 功能 Switch(config)#ip http server 交换机设置 Web 授权用户和口令;若交换机没有设置授权 Web 用户,则任何用户都无法进入交换机的 Web 配置界面。 Switch(config)#web-user test password 0 testSSH 配置 Switc
3、h(Config)#ssh-user test password 0 test Switch(Config)#ssh-server enable VLAN 的基本配置 划分 VLAN 100 和 VLAN 200,并加入端口; Switch(Config)#vlan 100 Switch(Config-Vlan100)#switchport interface e0/0/1-5 Switch(Config)#vlan 200 Switch(Config-Vlan200)#switchport interface e0/0/6-10 配置 0/0/24 端口为级联端口 Switch(Config
4、)#interface ethernet 0/0/24 Switch(Config-ethernet0/0/24)#switchport mode trunk switchport trunk allowed vlan 100;200 /#Trunk 端口缺省允许通过所有 VLAN;用户可以通过上述命令设置哪些VLAN 的流量可以通过 Trunk 口,没有包含的 VLAN 流量则被禁止。 察看配置:show vlan利用三层交换机实现 VLAN 间路由 为 VLAN 接口设置 IP 地址; Switch(Config)#interface vlan 100 Switch(Config-If-V
5、lan100)#ip address 192.168.1.1 255.255.255.0 Switch(Config)#interface vlan 200 Switch(Config-If-Vlan200)#ip address 192.168.2.1 255.255.255.0Switch-1 的配置 hostname Switch-1 interface ethernet 0/0/1-2 port-group 1 mode on vlan 100 switchport interface ethernet 0/0/16-20 vlan 200 switchport interface e
6、thernet 0/0/6-10 vlan 300 switchport interface ethernet 0/0/11-15 interface port-channel 1 switchport mode trunk switchport trunk allowed vlan 100;200;300Switch-2 的配置 hostname Switch-2 interface ethernet 0/0/1-2 port-group 2 mode on vlan 100 switchport interface ethernet 0/0/16-20 vlan 200 switchpor
7、t interface ethernet 0/0/6-10 vlan 400 switchport interface ethernet 0/0/11-15 interface port-channel 2 switchport mode trunk switchport trunk allowed vlan 100;200;400Switch 的二层配置 interface ethernet 0/0/1-2 port-group 1 mode on interface ethernet 0/0/3-4 port-group 2 mode on vlan 100 vlan 200 vlan 3
8、00 vlan 400 vlan 500 switchport interface ethernet 0/0/11-15 interface port-channel 1 switchport mode trunk switchport trunk allowed vlan 100;200;300 interface port-channel 2 switchport mode trunk switchport trunk allowed vlan 100;200;400Switch 三层配置 interface vlan 100 ip address 192.168.10.1 255.255
9、.255.0 interface vlan 200 ip address 192.168.20.1 255.255.255.0 interface vlan 300 ip address 192.168.30.1 255.255.255.0 interface vlan 400 ip address 192.168.40.1 255.255.255.0 interface vlan 500 ip address 192.168.50.1 255.255.255.0三层交换机中三层接口的创建要将某一个端口设定为三层端口,需要将它加入到某一个 VLAN 中,然后为该 VLAN 设置 IP地址Vla
10、n 100Int f0/4Switchport access vlan 100Int vlan 100Ip address 11.1.1.1 255.255.255.0No shutdownDHCP 的配置Switch(Config)#Service dhcp 启动/关闭 DHCP 服务Switch(Config)#ip dhcp pool ASwitch(dhcp-A-config)#network 10.16.1.0 24Switch(dhcp-A-config)#lease 3 10 32Switch(dhcp-A-config)#default-route 10.16.1.200 10
11、.16.1.201 Switch(dhcp-A-config)#dns-server 10.16.1.202Switch(dhcp-A-config)#exit Switch(Config)#ip dhcp excluded-address 10.16.1.200 10.16.1.201二层交换机端口安全配置设置静态一一映射:Mac-adderess-table static address 22-22-22-22-22-22-22 vlan 10 int f0/3设置安全端口地址:Int f0/3Switchport port-securitySwitchport port-security
12、 mac-address 22-22-22-22-22-22神州数码路由器配置命令端口基本配置 interface serial 1/0 encapsulation hdlc ip address 192.168.10.1 255.255.255.252 physical-layer speed 2048000 !PAP 认证配置(双向认证) DCR-1 配置: interface s0/1 encapsulate ppp ip add 192.168.10.1 255.255.0.0 ppp authentication pap ppp pap user routerA aaa physic
13、al-layer speed 2048000 username routerB password bbb DCR-2 配置: username routerA password aaa interface s0/1 encapsulate ppp ip add 192.168.10.2 255.255.0.0 ppp authentication pap ppp pap user routerB bbb CHAP 协议配置 DCR-1 配置: username digitalchina2 password legend interface Serial1/0 encapsulation ppp
14、 ppp authentication chap ppp chap hostname digitalchina1 PPP chap password legend ip address 192.168.10.1 255.255.255.252 physical-layer speed 2048000 DCR-2 配置: username digitalchina1 password legend interface Serial1/0 encapsulation ppp ppp authentication chap ppp chap hostname digitalchina2 PPP ch
15、ap password legend ip address 192.168.10.2 255.255.255.252RIP 协议配置 DCR-1(config)#router rip DCR-1(router-rip)#network 192.200.10.4 255.255.255.252 DCR-1(router-rip)#version 2 DCR-1(router-rip)#redistribute connectOSPF 协议配置 router ospf 1 network 192.200.10.4 255.255.255.252 area 0 redistribute connec
16、tNAT 配置如上图所示,公司申请了一个合法的 IP 地址,公司局域网用户使用一个 IP 地址连接入internet interface fastethernet 0/0 ip address 192.168.1.1 255.255.255.0 ip nat inside interface serial 1/0 encapsulation ppp ip address 61.1.1.1 255.255.255.252 ppp pap sent-username 169 169 ip nat outside ip access-list standard test1 permit any ip
17、 nat inside source list test1 interface serial 1/0 ip route default serial 1/0IPSEC 的配置crypto ipsec transform-set test1 -设置变换集合transform-type ah-md5-hmac esp-desip access-list extended ipsec -设置要保护的数据permit ip 3.3.3.0 255.255.255.0 2.2.2.0 255.255.255.0set transform-set test1 - - - -运用变换集合 test1matc
18、h address ipsec -指定所要保护的 IP 数据 配置 SSH Server,允许可以通过 SSH 远程管理设备,并使用 AAA 本地验证。SSH 配置 Router (Config)#ssh-user test password 0 test Router (Config)#ssh-server enable 使用 AAA 配置本地登录验证Router (Config)#aaa authentication login default localRouter (Config)#line vty 0 4Router (Config-line)#login auth defaultR
19、outer (Config)#username test pass test 设置本地验证的用户名和密码 访问控制功能的设置Router (Config)#Time-range aaaRouter (Config)#Periodic weekdays 9 to 18Access-list 100 permit tcp 192.168.11.0 0.0.0.255 any time-range aaaAccess-list 100 permit tcp 192.168.12.0 0.0.0.255 any time-range aaaAccess-list 100 permit tcp 192.168.13.0 0.0.0.255 any time-range aaaAccess-list 100 permit tcp 192.168.14.0 0.0.0.255 any Int f0/0Ip access-group 100 in