1
2
3
4
R1路由的配置
Router>
Router>en
Router>enable
Router#conf
Router#configure ter
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos
Router(config)#hostname R1
R1(config)#int
R1(config)#interface g0/0
R1(config-if)#ip ad
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R1(config-if)#do ping 192.168.1.110
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.110, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms
R2路由配置
Router>en
Router>enable
Router#con
Router#conf
Router#configure te
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hos
Router(config)#hostname R2
R2(config)#inte
R2(config)#interface s0/0/0
R2(config-if)#ip ad
R2(config-if)#ip address 12.0.0.2 255.255.255.252
R2(config-if)#no sh
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R2(config-if)#inte
R2(config-if)#interf
R2(config-if)#interface g0/0
R2(config-if)#ip ad
R2(config-if)#ip address 172.16.1.1 255.255.255.0
R2(config-if)#no shu
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
R2(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
R2(config-if)#
R2(config-if)#do wr
Building configuration...
[OK]
R2(config-if)#
R2(config-if)#ip rou
R2(config-if)#exit
R2(config)#ip ro
R2(config)#ip route 192.168.1.0 255.255.255.0 s0/0/0
%Default route without gateway, if not a point-to-point interface, may impact performance
R2(config)#
R2(config)#do show ip route sta
R2(config)#do show ip route static
S 192.168.1.0/24 is directly connected, Serial0/0/0
R2(config)#
R2 con0 is now available
Press RETURN to get started.
5
去客户端 测试www.test.com
6
然后看左下角是不是 successful成功 就行
7
2022-12-1
密码配置
全局模式输入下面
enable password 123
line console 0
password 456
login
line vty 0 4
password 789
login