
Setp 1
R1#debug ip packet //调试IP包
IP packet debugging is on
R1#ping 172.16.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/97/208 ms
R1#
*Mar 1 00:05:12.151: IP: tableid=0, s=172.16.12.1 (local), d=172.16.12.2 (FastEthernet0/0), routed via FIB
Setp 2
R1#ping 172.16.12.2 source 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.2, timeout is 2 seconds:
Packet sent with a source address of 192.168.10.1
.....
Success rate is 0 percent (0/5)
R2#debug ip packet //R2上没有回到192.168.10.1的路由表
IP packet debugging is on
R2#
*Mar 1 00:06:20.123: IP: tableid=0, s=192.168.10.1 (FastEthernet0/0), d=172.16.12.2 (FastEthernet0/0), routed via RIB
*Mar 1 00:06:20.123: IP: s=192.168.10.1 (FastEthernet0/0), d=172.16.12.2 (FastEthernet0/0), len 100, rcvd 3
*Mar 1 00:06:20.127: IP: s=172.16.12.2 (local), d=192.168.10.1, len 100, unroutable
Setp 3
R2(config)# ip route 192.168.10.1 255.255.255.255 172.16.12.1 //指下一跳的方式
R2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.10.0/32 is subnetted, 1 subnets
S 192.168.10.1 [1/0] via 172.16.12.1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.12.0 is directly connected, FastEthernet0/0
C 192.168.100.0/24 is directly connected, Loopback0
R2(config)#ip route 192.168.10.1 255.255.255.255 fastEthernet 0/0 //指出接口的方式
R2(config)#do show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
192.168.10.0/32 is subnetted, 1 subnets
S 192.168.10.1 is directly connected, FastEthernet0/0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.12.0 is directly connected, FastEthernet0/0
C 192.168.100.0/24 is directly connected, Loopback0
转载于:https://blog.51cto.com/qq874915178/395361