2、实验过程
r1(config)#int lo0
r1(config-if)#ip add 10.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
r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2
r2(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1
注:默认情况下ip classless 和ip cef是开启的。
r1#ping 10.2.2.2 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/34/84 ms
r1(config)#no ip classless
r1(config)#no ip cef
r1#ping 10.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5
r1#ping 10.2.2.2 source 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
Packet sent with a source address of 10.1.1.1
.....
Success rate is 0 percent (0/5)