The reasons why the serial interface cannot be pinged and its in-depth analysis

The material comes from the students who come into contact with in daily work, or the experiment or the failure of the live network encountered by others. It is intended for analysis, summary and sharing. Please do not reprint, thank you.

Network topology:

image

The two routers are connected through the serial interface S1/1, and the IP subnet in the middle is 12.1.1.0/24, R1 is .1, and R2 is .2

The simulation environment uses the EVE simulation environment and loads the IOL simulator, thanks to the developers of the simulation environment and simulator.


Fault description:

The administrator made the following configuration, but R1 and R2 could not ping each other, and even ping themselves could not communicate.


R1

configure terminal

interface s1/1

encapsulation ppp

ip address 12.1.1.1 255.255.255.0

no shutdown

end


R2

configure terminal

interface s1/1

ip address 12.1.1.2 255.255.255.0

no shutdown


Fault phenomenon:

R1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#ping 12.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)


Troubleshooting:

    Method 1: By viewing the basic configuration.

R1和R2的接口下一个配置了封装类型为PPP,另外一个却没有配置,而IOS操作系统下,串行接口默认的封装类型为HDLC,这就好比两个人在使用不同国家的语言聊天,根本互相听不懂啊。

    结论为,链路两端接口数据封装类型不一致导致故障。但是这种方法太过武断,需要有丰富的实践操作经验和扎实的理论基础支撑,并不推荐哦。经验老道的工程师们,可以在此基础上做进一步诊断,确定故障原因。


    方法二:通过log做出诊断

    对于有一定经验的工程师来说,其实在前面的配置过程中通过查看IOS操作系统给出的反馈就可以得出结论,看哪里呢?

R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s1/1
R1(config-if)#encapsulation ppp
R1(config-if)#ip add 12.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#
*May  4 08:19:21.872: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
R1(config-if)#end
R1#

是的,细心的人会注意到,这个位置少了点什么,所谓事物反常即为妖,那么究竟少了什么呢?我们来看一个接口开启之后应该出现些什么。

R1(config)#int e0/0
R1(config-if)#no shutdown
*May  4 08:31:02.560: %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up
R1(config-if)#
*May  4 08:31:03.564: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
R1(config-if)#

不仅会有一个接口开启的log,同时正常情况下链路层也应该工作正常,因此还会出现一个链路层up的log。也就是说,实际上,R1的S1/1接口网络接口层并没有正常工作;

R2(config)#int s1/1
R2(config-if)#ip add 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
*May  4 08:20:55.922: %SYS-5-CONFIG_I: Configured from console by console
R2#
*May  4 08:20:57.488: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*May  4 08:20:58.496: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R2#
*May  4 08:21:23.792: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to down

再来看R2上面的log,接口链路层UP后又down了,这说明什么问题呢?说明R2的S1/1接口网络接口层也没有正常工作;

接下来验证我们的猜测:网络接口层工作不正常

R1#show ip interface brief s1/1
Interface                  IP-Address      OK?   Method       Status               Protocol
Serial1/1                  12.1.1.1          YES      manual         up                    down   


R2#show ip interface brief s1/1
Interface                  IP-Address      OK?    Method      Status                Protocol
Serial1/1                  12.1.1.2          YES       manual        up                   down


R1#show interfaces s1/1
Serial1/1 is up, line protocol is down
   Hardware is M4T
   Internet address is 12.1.1.1/24
   MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
      reliability 255/255, txload 1/255, rxload 1/255
   Encapsulation PPP, LCP Closed, crc 16, loopback not set


R2#show interfaces s1/1
Serial1/1 is up, line protocol is down
   Hardware is M4T
   Internet address is 12.1.1.2/24
   MTU 1500 bytes, BW 1544 Kbit/sec, DLY 20000 usec,
      reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set


通过上面log可以看出,我们的猜测是正确的,可以下诊断;


故障排除:

通过上面log判断,链路两端接口封装类型不一致导致了故障,因此我们需要普及一下普通话,让它们封装一致了。就一R1的S1/1接口配置为准吧,现在我们将R2的接口封装类型也配置为PPP。

R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface s1/1
R2(config-if)#encapsulation ppp
R2(config-if)#end
R2#
*May  4 09:06:28.360: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
*May  4 09:06:28.821: %SYS-5-CONFIG_I: Configured from console by console
R2#


R1#
*May  4 09:06:28.365: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up
R1#

现在两边都弹出了log,通知管理员接口的数据链路层up了。

R1#show ip interface brief s1/1
Interface                  IP-Address      OK?   Method   Status                Protocol
Serial1/1                  12.1.1.1           YES   manual      up                   up


R2#show ip interface brief s1/1
Interface                  IP-Address      OK?   Method    Status                Protocol
Serial1/1                  12.1.1.2          YES     manual     up                   up     


检查故障是否排除:

R1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/8/9 ms
R1#ping 12.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/17/18 ms


解惑:

通常情况下我们发现远端主机无法ping通,第一反应是需要测试本地主机接口卡工作是否正常,因此该同学在ping 12.1.1.2不通之后,又ping了12.1.1.1,证实了本地也不通。这他就疑惑了,对端不通你说因为接口协议down的,那咋自己也不通呢?

首先我们还原故障现象。

then

无论R1还是R2,当S1/1接口数据链路层down掉之后,我们来看下路由表:


R1#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
        a - application route
        + - replicated route, % - next hop override

Gateway of last resort is not set

R1#


R2#show ip route
Codes: L - local, 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, H - NHRP, l - LISP
        a - application route
        + - replicated route, % - next hop override

Gateway of last resort is not set

R2#


路由表居然的空的!!!

The data link layer of the interface cannot work properly, so is there still a need for a direct route? There is no way to complete link layer encapsulation of data. Under normal circumstances, even if the data is sent to itself, the router needs to have routing table entries. Without a list item, it is like a person without a mouth. Even if he knows that someone else has given him his name, he will recite it in his heart, but he can't say it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325346640&siteId=291194637