在局域网中接口封装的是以太网类型
在WAN中接口一般是串口封装PPP HDLC SNIP Frame-Realy
以太网是要用到ARP,它是以MAC地址来通信的
串口的话两边2层都是PPP或者HDLC 2层就通了,帧中继用到DLCI。
(N.1)RI\R2的s0\0口都封住PPP R1s0\0 ip address 192.168.1.1 255.255.255.0
R2s0\0 ip address 172.16.1.1 255.255.255.0
R1#ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/93/160 ms
R1#show io route
Gateway of last resort is not set
172.16.0.0/32 is subnetted, 1 subnets
C 172.16.1.1 is directly connected, Serial0/0
C 192.168.1.0/24 is directly connected, Serial0/0
(N.2)两边都封住HDLC
R1#ping 172.16.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#show ip route(其余不变)
Gateway of last resort is not set
C 192.168.1.0/24 is directly connected, Serial0/0
(N.3)两边都封装HDLC
R1 地址是172.16.1.1 255.255.255.0 R2地址是172.16.2.2 255.255.255.0
R1#ping 172.16.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
(N.4)两边都封住HDLC
R1 ip address 172.16.1.1 255.255.255.0 R2 ip address 172.16.1.2 255.255.0.0
R1#ping 172.16.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/95/196 ms
R1#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0/0
(N.1)R1 ip address 10.1.1.1 255.255.255.0 R2 ip addrss 10.1.1.2 255.255.255.0
R1 ping R2 !!!!!
(N.2)R1 10.1.1.1 255.255.255.0 R2 10.2.2.2 255.255.255.0
R1 ping R2 不通
(N.3)R1 10.1.1.1 255.255.255.0 R2 10.2.2.2 255.255.255.0
R1(config)#no ip routing
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 不同网段就要发出ARP请求 但R2没有关闭路由功能它查看路由表不有去往10.1.1.1 的路由所以不通
当我们再把R2的路由功能关闭后
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 80 percent (4/5), round-trip min/avg/max = 12/67/156 ms