2、实验过程
R1:
r1(config)#int lo0
r1(config-if)#ip add 1.1.1.1 255.255.255.0
r1(config-if)#int s1/0
r1(config-if)#ip add 192.168.12.1 255.255.255.0
r1(config-if)#no shut
R2
r2(config)#int lo0
r2(config-if)#ip add 2.2.2.2 255.255.255.0
r2(config-if)#int s1/0
r2(config-if)#ip add 192.168.12.2 255.255.255.0
r2(config-if)#no shut
r2(config-if)#int s1/1
r2(config-if)#ip add 192.168.23.2 255.255.255.0
r2(config-if)#no shut
R3
r3(config)#int s1/1
r3(config-if)#ip add 192.168.23.3 255.255.255.0
r3(config-if)#no shut
r3(config-if)#int lo0
r3(config-if)#ip add 3.3.3.3 255.255.255.0
测试直连的连通性
r2#ping 192.168.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/42/104 ms
r2#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/58/144 ms
r2#
实验要求:使得1.1.1.0/24、2.2.2.0/24、3.3.3.0/24网段之间相互通信。
r1(config)#ip route 2.2.2.0 255.255.255.0 192.168.12.2
r1(config)#ip route 3.3.3.0 255.255.255.0 192.168.12.2
r2(config)#ip route 1.1.1.0 255.255.255.0 192.168.12.1
r2(config)#ip route 3.3.3.0 255.255.255.0 192.168.23.3
这是测试:
r2#debug ip packet
r3#debug ip packet
r1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r3#
*Jul 23 18:51:46.923: IP: tableid=0, s=192.168.12.1 (Serial1/1), d=3.3.3.3 (Loopback0), routed via RIB
*Jul 23 18:51:46.923: IP: s=192.168.12.1 (Serial1/1), d=3.3.3.3, len 100, rcvd 4
*Jul 23 18:51:46.927: IP: s=3.3.3.3 (local), d=192.168.12.1, len 100, unroutable
r3#
*Jul 23 18:51:48.851: IP: tableid=0, s=192.168.12.1 (Serial1/1), d=3.3.3.3 (Loopback0), routed via RIB
*Jul 23 18:51:48.851: IP: s=192.168.12.1 (Serial1/1), d=3.3.3.3, len 100, rcvd 4
*Jul 23 18:51:48.855: IP: s=3.3.3.3 (local), d=192.168.12.1, len 100, unroutable
r3#
*Jul 23 18:51:50.835: IP: tableid=0, s=192.168.12.1 (Serial1/1), d=3.3.3.3 (Loopback0), routed via RIB
*Jul 23 18:51:50.835: IP: s=192.168.12.1 (Serial1/1), d=3.3.3.3, len 100, rcvd 4
*Jul 23 18:51:50.839: IP: s=3.3.3.3 (local), d=192.168.12.1, len 100, unroutable
r3#
*Jul 23 18:51:52.851: IP: tableid=0, s=192.168.12.1 (Serial1/1), d=3.3.3.3 (Loopback0), routed via RIB
*Jul 23 18:51:52.851: IP: s=192.168.12.1 (Serial1/1), d=3.3.3.3, len 100, rcvd 4
*Jul 23 18:51:52.855: IP: s=3.3.3.3 (local), d=192.168.12.1, len 100, unroutable
r3#
*Jul 23 18:51:54.859: IP: tableid=0, s=192.168.12.1 (Serial1/1), d=3.3.3.3 (Loopback0), routed via RIB
*Jul 23 18:51:54.859: IP: s=192.168.12.1 (Serial1/1), d=3.3.3.3, len 100, rcvd 4
*Jul 23 18:51:54.859: IP: s=3.3.3.3 (local), d=192.168.12.1, len 100, unroutable
注:在R2上无任何debug信息。
在R3上配置:
r3(config)#ip route 1.1.1.0 255.255.255.0 192.168.23.2
r3(config)#ip route 192.168.12.0 255.255.255.0 192.168.23.2
r1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/56/132 ms
r1#ping 192.168.23.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
r2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/44/112 ms
r2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/99/384 ms