本文共 2355 字,大约阅读时间需要 7 分钟。
实验条件如图:
2.给switch0配置管理IP为10.0.0.2,配置远程密码为“haha”,配置特权模式下的密码为“hehe”如下:
Switch>enSwitch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface vlan 1Switch(config-if)#ip address 10.0.0.2 255.0.0.0Switch(config-if)#no shutdownSwitch#conf t
Switch(config)#line vty 0 4Switch(config-line)#password hahaSwitch#conf t
Switch(config)#enable password heheSwitch(config)#endSwitch#w3.给路由器配置IP下:
Continue with configuration dialog? [yes/no]: noRouter>enRouter#conf tRouter(config)#interface f0/0Router(config-if)#ip address 10.0.0.254 255.0.0.0Router(config-if)#no shutdownRouter(config-if)#interface f0/1Router(config-if)#ip address 20.0.0.254 255.0.0.0Router(config-if)#no shutdown4.给switch1配置管理IP为“20.0.0.1”配置网关为“20.0.0.254”配置远程密码为:456.配置特权模式下的密码为:123如下
Switch>enSwitch#conf tSwitch(config)#interface vlan 1Switch(config-if)#ip address 20.0.0.1 255.0.0.0Switch(config-if)#no shutdownSwitch(config)#ip default-gateway 20.0.0.254
Switch(config)#endSwitch#conf t
Switch(config)#line vty 0 4Switch(config-line)#password 456Switch(config-line)#endSwitch#conf t
Switch(config)#enable password 123Switch(config)#endSwitch#w打开PC机先ping通switch1和switch0如下:
PC>ping 10.0.0.2Pinging 10.0.0.2 with 32 bytes of data:Reply from 10.0.0.2: bytes=32 time=1ms TTL=255Reply from 10.0.0.2: bytes=32 time=0ms TTL=255Reply from 10.0.0.2: bytes=32 time=0ms TTL=255Reply from 10.0.0.2: bytes=32 time=0ms TTL=255Ping statistics for 10.0.0.2:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 1ms, Average = 0msPC>ping 20.0.0.1
Pinging 20.0.0.1 with 32 bytes of data:Request timed out.Request timed out.Reply from 20.0.0.1: bytes=32 time=0ms TTL=254Reply from 20.0.0.1: bytes=32 time=0ms TTL=254Ping statistics for 20.0.0.1:Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0msPing通后远程分别连接switch0和switch1如下:
PC>telnet 10.0.0.2 Trying 10.0.0.2 ...OpenUser Access Verification
Password:
Switch>enPassword: Switch#PC>telnet 20.0.0.1
Trying 20.0.0.1 ...OpenUser Access Verification
Password:
Switch>enPassword: Switch#两台交换机都可以远程连接到,任务完成。转载于:https://blog.51cto.com/13568842/2059276