一、实验拓扑:

 

 

 二、配置实现:

[gz]int g0/0/0
[gz-GigabitEthernet0/0/0]ip address 12.0.0.2 255.255.255.0

[gz]interface Tunnel0/0/0
[gz-Tunnel0/0/0]tunnel-protocol gre
[gz-Tunnel0/0/0]source 12.0.0.2
[gz-Tunnel0/0/0]destination 13.0.0.3
[gz-Tunnel0/0/0]ip add 172.18.0.1 24
[gz]ip route-static 0.0.0.0 0 g0/0/0 12.0.0.1

[gz]ospf 1 router-id 2.2.2.2
[gz-ospf-1]area 0
[gz-ospf-1-area-0.0.0.0]net 172.16.0.2 0.0.0.0
[gz-ospf-1-area-0.0.0.0]net 172.18.0.1 0.0.0.0

 

[jm]int Tunnel 0/0/1
[jm-Tunnel0/0/1]tunnel-protocol gre
[jm-Tunnel0/0/1]source 13.0.0.3
[jm-Tunnel0/0/1]destination 12.0.0.2
[jm-Tunnel0/0/1]ip add 172.18.0.3 24
[jm]ip route-static 0.0.0.0 0 g0/0/1 13.0.0.4

[jm]ospf 1 router-id 1.1.1.1
[jm-ospf-1]area 0
[jm-ospf-1-area-0.0.0.0]network 172.18.0.3 0.0.0.0
[jm-ospf-1-area-0.0.0.0]network 173.17.0.3 0.0.0.0

验证通信:

 

 抓包信息:

 

 

Frame 43: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface -, id 0
Interface id: 0 (-)
Interface name: -
Encapsulation type: Ethernet (1)
Arrival Time: Jan 1, 1970 14:16:22.031000000 中国标准时间
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 22582.031000000 seconds
[Time delta from previous captured frame: 1.016000000 seconds]
[Time delta from previous displayed frame: 1.016000000 seconds]
[Time since reference or first frame: 124.250000000 seconds]
Frame Number: 43
Frame Length: 98 bytes (784 bits)
Capture Length: 98 bytes (784 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:gre:ip:icmp:data]
[Coloring Rule Name: ICMP]
[Coloring Rule String: icmp || icmpv6]
Ethernet II, Src: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a), Dst: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
Destination: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
Address: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a)
Address: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 12.0.0.2, Dst: 13.0.0.3
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 84
Identification: 0x001b (27)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment Offset: 0
Time to Live: 254
Protocol: Generic Routing Encapsulation (47)
Header Checksum: 0xa35b [validation disabled]
[Header checksum status: Unverified]
Source Address: 12.0.0.2
Destination Address: 13.0.0.3
Generic Routing Encapsulation (IP)
Flags and Version: 0x0000
0... .... .... .... = Checksum Bit: No
.0.. .... .... .... = Routing Bit: No
..0. .... .... .... = Key Bit: No
...0 .... .... .... = Sequence Number Bit: No
.... 0... .... .... = Strict Source Route Bit: No
.... .000 .... .... = Recursion control: 0
.... .... 0000 0... = Flags (Reserved): 0
.... .... .... .000 = Version: GRE (0)
Protocol Type: IP (0x0800)
Internet Protocol Version 4, Src: 172.16.0.1, Dst: 173.17.0.1
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT)
0000 00.. = Differentiated Services Codepoint: Default (0)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 60
Identification: 0xa092 (41106)
Flags: 0x40, Don't fragment
0... .... = Reserved bit: Not set
.1.. .... = Don't fragment: Set
..0. .... = More fragments: Not set
Fragment Offset: 0
Time to Live: 127
Protocol: ICMP (1)
Header Checksum: 0x020b [validation disabled]
[Header checksum status: Unverified]
Source Address: 172.16.0.1
Destination Address: 173.17.0.1
Internet Control Message Protocol
Type: 8 (Echo (ping) request)
Code: 0
Checksum: 0xf3d9 [correct]
[Checksum Status: Good]
Identifier (BE): 37536 (0x92a0)
Identifier (LE): 41106 (0xa092)
Sequence Number (BE): 4 (0x0004)
Sequence Number (LE): 1024 (0x0400)
[Response frame: 44]
Data (32 bytes)
Data: 08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2021222324252627
[Length: 32]

 

Frame 61: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface -, id 0
Interface id: 0 (-)
Interface name: -
Encapsulation type: Ethernet (1)
Arrival Time: Jan 1, 1970 14:17:25.593000000 中国标准时间
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 22645.593000000 seconds
[Time delta from previous captured frame: 5.406000000 seconds]
[Time delta from previous displayed frame: 5.406000000 seconds]
[Time since reference or first frame: 187.812000000 seconds]
Frame Number: 61
Frame Length: 106 bytes (848 bits)
Capture Length: 106 bytes (848 bits)
[Frame is marked: False]
[Frame is ignored: False]
[Protocols in frame: eth:ethertype:ip:udp:rip]
[Coloring Rule Name: TTL low or unexpected]
[Coloring Rule String: ( ! ip.dst == 224.0.0.0/4 && ip.ttl < 5 && !pim && !ospf) || (ip.dst == 224.0.0.0/24 && ip.dst != 224.0.0.251 && ip.ttl != 1 && !(vrrp || carp))]
Ethernet II, Src: HuaweiTe_59:76:07 (00:e0:fc:59:76:07), Dst: IPv4mcast_09 (01:00:5e:00:00:09)
Destination: IPv4mcast_09 (01:00:5e:00:00:09)
Address: IPv4mcast_09 (01:00:5e:00:00:09)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...1 .... .... .... .... = IG bit: Group address (multicast/broadcast)
Source: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
Address: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 12.0.0.1, Dst: 224.0.0.9
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 92
Identification: 0x0066 (102)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment Offset: 0
Time to Live: 14
Protocol: UDP (17)
Header Checksum: 0xbf61 [validation disabled]
[Header checksum status: Unverified]
Source Address: 12.0.0.1
Destination Address: 224.0.0.9
User Datagram Protocol, Src Port: 520, Dst Port: 520
Source Port: 520
Destination Port: 520
Length: 72
Checksum: 0xe934 [unverified]
[Checksum Status: Unverified]
[Stream index: 0]
[Timestamps]
UDP payload (64 bytes)
Routing Information Protocol
Command: Response (2)
Version: RIPv2 (2)
IP Address: 12.0.0.0, Metric: 1
Address Family: IP (2)
Route Tag: 0
IP Address: 12.0.0.0
Netmask: 255.255.255.0
Next Hop: 0.0.0.0
Metric: 1
IP Address: 13.0.0.0, Metric: 2
Address Family: IP (2)
Route Tag: 0
IP Address: 13.0.0.0
Netmask: 255.255.255.0
Next Hop: 0.0.0.0
Metric: 2
IP Address: 14.0.0.0, Metric: 1
Address Family: IP (2)
Route Tag: 0
IP Address: 14.0.0.0
Netmask: 255.255.255.0
Next Hop: 0.0.0.0
Metric: 1

 

Frame 13: 106 bytes on wire (848 bits), 106 bytes captured (848 bits) on interface -, id 0
Ethernet II, Src: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a), Dst: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
Destination: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
Address: HuaweiTe_59:76:07 (00:e0:fc:59:76:07)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Source: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a)
Address: HuaweiTe_6d:3b:8a (00:e0:fc:6d:3b:8a)
.... ..0. .... .... .... .... = LG bit: Globally unique address (factory default)
.... ...0 .... .... .... .... = IG bit: Individual address (unicast)
Type: IPv4 (0x0800)
Internet Protocol Version 4, Src: 12.0.0.2, Dst: 13.0.0.3
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 92
Identification: 0x019c (412)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment Offset: 0
Time to Live: 255
Protocol: Generic Routing Encapsulation (47)
Header Checksum: 0xa012 [validation disabled]
[Header checksum status: Unverified]
Source Address: 12.0.0.2
Destination Address: 13.0.0.3
Generic Routing Encapsulation (IP)
Flags and Version: 0x0000
0... .... .... .... = Checksum Bit: No
.0.. .... .... .... = Routing Bit: No
..0. .... .... .... = Key Bit: No
...0 .... .... .... = Sequence Number Bit: No
.... 0... .... .... = Strict Source Route Bit: No
.... .000 .... .... = Recursion control: 0
.... .... 0000 0... = Flags (Reserved): 0
.... .... .... .000 = Version: GRE (0)
Protocol Type: IP (0x0800)
Internet Protocol Version 4, Src: 172.18.0.1, Dst: 224.0.0.5
0100 .... = Version: 4
.... 0101 = Header Length: 20 bytes (5)
Differentiated Services Field: 0xc0 (DSCP: CS6, ECN: Not-ECT)
1100 00.. = Differentiated Services Codepoint: Class Selector 6 (48)
.... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0)
Total Length: 68
Identification: 0x019b (411)
Flags: 0x00
0... .... = Reserved bit: Not set
.0.. .... = Don't fragment: Not set
..0. .... = More fragments: Not set
Fragment Offset: 0
Time to Live: 1
Protocol: OSPF IGP (89)
Header Checksum: 0x2aee [validation disabled]
[Header checksum status: Unverified]
Source Address: 172.18.0.1
Destination Address: 224.0.0.5
Open Shortest Path First
OSPF Header
Version: 2
Message Type: Hello Packet (1)
Packet Length: 48
Source OSPF Router: 2.2.2.2
Area ID: 0.0.0.0 (Backbone)
Checksum: 0xf694 [correct]
Auth Type: Null (0)
Auth Data (none): 0000000000000000
OSPF Hello Packet
Network Mask: 255.255.255.0
Hello Interval [sec]: 10
Options: 0x02, (E) External Routing
0... .... = DN: Not set
.0.. .... = O: Not set
..0. .... = (DC) Demand Circuits: Not supported
...0 .... = (L) LLS Data block: Not Present
.... 0... = (N) NSSA: Not supported
.... .0.. = (MC) Multicast: Not capable
.... ..1. = (E) External Routing: Capable
.... ...0 = (MT) Multi-Topology Routing: No
Router Priority: 1
Router Dead Interval [sec]: 40
Designated Router: 0.0.0.0
Backup Designated Router: 0.0.0.0
Active Neighbor: 1.1.1.1

 

posted on 2022-10-19 15:08  湘雷公  阅读(539)  评论(0编辑  收藏  举报