静态路由实验
如果没有serial线接口
在路由器上右键→设置把接口拖到路由器上就可以了
配置各路由器接口IP,并 在R1和R3的路由上需要分别配置两个LoopBack,如图所示
R1 接口IP配置
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.12.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.1.21.1 24
[R1-GigabitEthernet0/0/1]int lo0
[R1-LoopBack0]ip add 10.0.1.1 24
R2接口IP配置
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.0.12.2 24
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip add 10.0.21.2 24
[R2]int s4/0/0
[R2-Serial4/0/0]ip add 10.0.23.2 24
R3 接口IP配置
[R3]int s4/0/0
[R3-Serial4/0/0]ip add 10.0.23.3 24
[R3-Serial4/0/0]int lo0
[R3-LoopBack0]ip add 10.0.3.3 24
要求:为3个路由器设置静态路由,使得R1可以访问10.0.23.0/24以及10.0.3.3/24,
R3可以访问10.0.1.1/24 10.0.12.0/24 10.0.21.0/24,
R2可以访问10.0.1.0/24 10.0.3.3/24。
R1 静态路由配置
ip route-static 10.0.3.0 255.255.255.0 10.0.12.2
ip route-static 10.0.23.0 255.255.255.0 10.0.12.2
R2 静态路由配置
ip route-static 10.0.1.0 255.255.255.0 10.0.12.1
ip route-static 10.0.3.0 255.255.255.0 10.0.23.3
R3 静态路由配置
ip route-static 10.0.1.0 255.255.255.0 10.0.23.2
ip route-static 10.0.12.0 255.255.255.0 10.0.23.2
ip route-static 10.0.21.0 255.255.255.0 10.0.23.2
注意:能否访问成功需要借助ping命令查看;
R1可以访问10.0.23.0/24以及10.0.3.3/24,
[R1]ping 10.0.23.3
PING 10.0.23.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.23.3: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 10.0.23.3: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 10.0.23.3: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 10.0.23.3: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.0.23.3: bytes=56 Sequence=5 ttl=254 time=20 ms
--- 10.0.23.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/50 ms
[R1]ping 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 10.0.3.3: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 10.0.3.3: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 10.0.3.3: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 10.0.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/40 ms
R3可以访问10.0.1.1/24 10.0.12.0/24 10.0.21.0/24,
<R3>ping 10.0.1.1
PING 10.0.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 10.0.1.1: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 10.0.1.1: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 10.0.1.1: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.0.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 10.0.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/24/30 ms
<R3>ping 10.0.12.1
PING 10.0.12.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.12.1: bytes=56 Sequence=1 ttl=254 time=30 ms
Reply from 10.0.12.1: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 10.0.12.1: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 10.0.12.1: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.0.12.1: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 10.0.12.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/24/30 ms
[R3]ping 10.0.21.1
PING 10.0.21.1: 56 data bytes, press CTRL_C to break
Request time out
Reply from 10.0.21.1: bytes=56 Sequence=2 ttl=254 time=30 ms
Reply from 10.0.21.1: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 10.0.21.1: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 10.0.21.1: bytes=56 Sequence=5 ttl=254 time=30 ms
--- 10.0.21.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 20/27/30 ms
R2可以访问10.0.1.0/24 10.0.3.3/24。
<R2>ping 10.0.1.1
PING 10.0.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.1: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 10.0.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.1.1: bytes=56 Sequence=3 ttl=255 time=10 ms
Reply from 10.0.1.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.0.1.1: bytes=56 Sequence=5 ttl=255 time=10 ms
--- 10.0.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/22/40 ms
<R2>ping 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=5 ttl=255 time=10 ms
--- 10.0.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/18/20 ms