模拟GRE隧道建立过程

ToPo图

 

目录

ToPo图

 步骤一、各接口IP地址配置

步骤二、在RTA和RTB上建立隧道接口,配置隧道起点和终点

步骤三、在RTA和RTB上为私网配置静态路由

步骤四、查看GRE封装及隧道建立情况

步骤五、配置GRE隧道验证

步骤六、配置隧道Keeplive

故障排查相关命令


步骤一、各接口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

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

帽子大法师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值