如何测试GRE数据包的连通性?

如何测试GRE数据包的连通性?

如果愿意的话测试5900到远程主机的TCP 端口(比如 IP 111.222.111.222),我这样做:

l$ nc -v 111.222.111.222 5901
Connection to localhost 5901 port [tcp/*] succeeded!
RFB 003.008

可以看出,网猫报告succeeded,我什至可以读取通信的起始标头(在本例中为 RFB,因为协议是VNC)。

有没有类似的方法考试 GRE连接性?

NetCat 将是一个很好的工具,只要它被广泛实施,但当然也允许使用其他工具或方法。

对于这个例子,我想我们可以假设我们有一个监听远程PPTPTCP 端口 1723 正确打开的服务器(PPTP 要求允许 GRE 数据包)。

答案1

你可以用来tcpdump验证

tcpdump -nvi any proto gre

15:50:49.834143 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 0, length 26: LCP, Conf-Request (0x01), id 0, length 12
15:50:51.857988 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 1, ack 4294967295, length 34: LCP, Conf-Request (0x01), id 1, length 16
15:50:51.858092 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 1, ack 1, length 34: LCP, Conf-Ack (0x02), id 1, length 16
15:51:00.192601 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 2, length 26: LCP, Conf-Request (0x01), id 1, length 12
15:51:00.193207 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 2, ack 2, length 30: LCP, Conf-Ack (0x02), id 1, length 12
15:51:00.193289 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 3, ack 2, length 34: PAP, Auth-Req (0x01), id 0, Peer ixia, Name ixia
15:51:00.219147 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 3, ack 3, length 25: PAP, Auth-ACK (0x02), id 0, Msg 
15:51:00.219231 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 4, ack 3, length 30: IPCP, Conf-Request (0x01), id 0, length 12
15:51:00.219259 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 4, ack 3, length 30: IPCP, Conf-Request (0x01), id 1, length 12
15:51:00.219321 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 5, ack 4, length 30: IPCP, Conf-Ack (0x02), id 1, length 12
15:51:00.221903 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 5, ack 5, length 30: IPCP, Conf-Nack (0x03), id 0, length 12
15:51:00.221962 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 6, ack 5, length 30: IPCP, Conf-Request (0x01), id 1, length 12
15:51:00.222481 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 6, ack 6, length 30: IPCP, Conf-Ack (0x02), id 1, length 12
15:51:00.721559 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, ack 6, no-payload, length 12
15:52:00.197893 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, seq 7, length 100: IP 17.1.1.122 > testforchris2.am.lilly.com: ICMP echo request, id 6187, seq 1, length 64
15:52:00.198930 IP 20.0.0.1 > 20.0.0.2: GREv1, call 1, seq 7, ack 7, length 104: IP testforchris2.am.lilly.com > 17.1.1.122: ICMP echo reply, id 6187, seq 1, length 64
15:52:00.697808 IP 20.0.0.2 > 20.0.0.1: GREv1, call 24, ack 7, no-payload, length 12

相关内容