ToPo图
目录
步骤一、各接口IP地址配置
[RTA]interface GigabitEthernet0/1
[RTA-GigabitEthernet0/1]ip address 192.168.1.1 255.255.255.0
[RTA-GigabitEthernet0/1]interface GigabitEthernet0/0
[RTA-GigabitEthernet0/0]ip address 1.1.1.1 255.255.255.0
[RTA-GigabitEthernet0/0]ip route-static 2.2.2.0 255.255.255.0 1.1.1.2
[RTB]interface GigabitEthernet0/1
[RTB-Gigabitathernet0/1]ip address 192.168.2.1 255.255.255.0
[RTB-GigabitEthernet0/1]interface GigabitEthernet0/0
[RTB-GigabitEthernet0/0]ip address 2.2.2.1 255.255.255.0
[RTB-GigabitEthernet0/0]ip route-static 1.1.1.0 255.255.255.0 2.2.2.2
[SWA]interface GigabitEthernet1/0/1
[SWA-GigabitEthernet0/1]port link-mode route
[SWA-GigabitEthernet0/1]ip address 1.1.1.2 255.255.255.252
[SWA]interface GigabitEthernet1/0/2
[SWA-GigabitEthernet0/2]port link-mode route
[SWA-GigabitEthernet0/2]ip address 2.2.2.1 255.255.255.252
以上配置为模拟公网配置,配置完成后公网正常互通
步骤二、在RTA和RTB上建立隧道接口,配置隧道起点和终点
[RTA]interface Tunnel0 mode gre
[RTA-Tunnel0]ip address 192.168.3.1 255.255.255.252
[RTA一Tunnel0 ]source 1.1.1.1
[RTA-Tunnel0 ]destination 2.2.2.1
[RTB]interface Tunnel0 mode gre
[RTB-Tunnel0]ip address 192.168.3.2 255.255.255.252
[RTB一Tunnel0]source 2.2.2.1
[RTB-Tunnel0 ]destination 1.1.1.1
步骤三、在RTA和RTB上为私网配置静态路由
[RTA]ip route-static 192.168.2.0 255.255.255.0 Tunnel 10
[RTB]ip route-static 192.168.1.0 255.255.255.0 Tunnel 10
步骤四、查看GRE封装及隧道建立情况
[RTA]display interface Tunnel 10
Tunnel10
Current state: UP
Line protocol state: UP
Description: 2.2.2.2
Bandwidth: 64 kbps
Maximum transmission unit: 1472
Internet address: 192.168.3.1/30 (Primary)
Tunnel source 1.1.1.1, destination 2.2.2.2
Tunnel keepalive enabled, Period(10 s), Retries(3)
Tunnel TTL 255
Tunnel protocol/transport GRE/IP
GRE key value is 123
Checksumming of GRE packets disabled
Output queue - Urgent queuing: Size/Length/Discards 0/1024/0
Output queue - Protocol queuing: Size/Length/Discards 0/500/0
Output queue - FIFO queuing: Size/Length/Discards 0/75/0
Last clearing of counters: Never
Last 300 seconds input rate: 4 bytes/sec, 32 bits/sec, 0 packets/sec
Last 300 seconds output rate: 4 bytes/sec, 32 bits/sec, 0 packets/sec
Input: 358 packets, 9736 bytes, 0 drops
Output: 254 packets, 11600 bytes, 0 drops
[H3C]display interface Tunnel 10
Tunnel10
Current state: UP
Line protocol state: UP
Description: 1.1.1.1
Bandwidth: 64 kbps
Maximum transmission unit: 1472
Internet address: 192.168.3.2/30 (Primary)
Tunnel source 2.2.2.2, destination 1.1.1.1
Tunnel keepalive enabled, Period(10 s), Retries(3)
Tunnel TTL 255
Tunnel protocol/transport GRE/IP
GRE key value is 123
Checksumming of GRE packets disabled
Output queue - Urgent queuing: Size/Length/Discards 0/1024/0
Output queue - Protocol queuing: Size/Length/Discards 0/500/0
Output queue - FIFO queuing: Size/Length/Discards 0/75/0
Last clearing of counters: Never
Last 300 seconds input rate: 4 bytes/sec, 32 bits/sec, 0 packets/sec
Last 300 seconds output rate: 4 bytes/sec, 32 bits/sec, 0 packets/sec
Input: 386 packets, 11208 bytes, 1 drops
Output: 236 packets, 10384 bytes, 0 drops
[RTA]display interface Tunnel brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
Tun10 UP UP 192.168.3.1 2.2.2.2
[H3C]display interface Tunnel brief
Brief information on interfaces in route mode:
Link: ADM - administratively down; Stby - standby
Protocol: (s) - spoofing
Interface Link Protocol Primary IP Description
Tun10 UP UP 192.168.3.2 1.1.1.1
步骤五、配置GRE隧道验证
[RTA-Tunnel10 ]gre key 123
[RTB-Tunnel10 ]gre key 123
步骤六、配置隧道Keeplive
[RTA]interface Tunnel 10
[RTA-Tunnel10]keepalive
[RTB]interface Tunnel 10
[RTB-Tunnel10]keepalive
故障排查相关命令
terminal monitor
terminal debugging
debugging gre all
debugging tunnel all