两台icg3000 df 用4g卡上网 如何建立GRE隧道保障内网互通
(0)
最佳答案
您好,请知:
以下是ICG3000的用户手册连接,请参考:
https://www.h3c.com/cn/Service/Document_Software/Document_Center/ICG/Catalog/ICG_3000/ICG_3000/
以下是GRE的配置案例,请参考:
路由器Router A和路由器Router B之间通过Internet相连。运行IP协议的私有网络的两个子网Group 1和Group 2,通过在两台路由器之间使用GRE建立隧道实现互联。
图1-8 GRE over IPv4应用组网图
在开始下面的配置之前,需确保Router A和Router B之间路由可达。
(1) 配置路由器Router A
# 配置接口Ethernet1/1。
<RouterA> system-view
[RouterA] interface ethernet 1/1
[RouterA-Ethernet1/1] ip address 10.1.1.1 255.255.255.0
[RouterA-Ethernet1/1] quit
# 配置接口Serial2/0(隧道的实际物理接口)。
[RouterA] interface serial 2/0
[RouterA-Serial2/0] ip address 1.1.1.1 255.255.255.0
[RouterA-Serial2/0] quit
# 创建Tunnel0接口。
[RouterA] interface tunnel 0
# 配置Tunnel0接口的IP地址。
[RouterA-Tunnel0] ip address 10.1.2.1 255.255.255.0
# 配置Tunnel封装模式为GRE over IPv4隧道模式。
[RouterA-Tunnel0] tunnel-protocol gre
# 配置Tunnel0接口的源地址(Serial2/0的IP地址)。
[RouterA-Tunnel0] source 1.1.1.1
# 配置Tunnel0接口的目的地址(Router B的Serial2/1的IP地址)。
[RouterA-Tunnel0] destination 2.2.2.2
[RouterA-Tunnel0] quit
# 配置从Router A经过Tunnel0接口到Group 2的静态路由。
[RouterA] ip route-static 10.1.3.0 255.255.255.0 tunnel 0
(2) 配置路由器Router B
# 配置接口Ethernet1/1。
<RouterB> system-view
[RouterB] interface ethernet 1/1
[RouterB-Ethernet1/1] ip address 10.1.3.1 255.255.255.0
[RouterB-Ethernet1/1] quit
# 配置接口Serial2/1(隧道的实际物理接口)。
[RouterB] interface serial 2/1
[RouterB-Serial2/1] ip address 2.2.2.2 255.255.255.0
[RouterB-Serial2/1] quit
# 创建Tunnel0接口。
[RouterB] interface tunnel 0
# 配置Tunnel0接口的IP地址。
[RouterB-Tunnel0] ip address 10.1.2.2 255.255.255.0
# 配置Tunnel封装模式为GRE over IPv4隧道模式。
[RouterB-Tunnel0] tunnel-protocol gre
# 配置Tunnel0接口的源地址(Serial2/1的IP地址)。
[RouterB-Tunnel0] source 2.2.2.2
# 配置Tunnel0接口的目的地址(Router A的Serial2/0的IP地址)。
[RouterB-Tunnel0] destination 1.1.1.1
[RouterB-Tunnel0] quit
# 配置从Router B经过Tunnel0接口到Group 1的静态路由。
[RouterB] ip route-static 10.1.1.0 255.255.255.0 tunnel 0
(3) 验证配置结果
# 完成以上配置后,分别查看Router A和Router B的Tunnel接口状态。
[RouterA] display interface tunnel 0
Tunnel0 current state: UP
Line protocol current state: UP
Description: Tunnel0 Interface
The Maximum Transmit Unit is 1476
Internet Address is 10.1.2.1/24 Primary
Encapsulation is TUNNEL, service-loopback-group ID not set.
Tunnel source 1.1.1.1, destination 2.2.2.2
Tunnel keepalive disabled
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/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: 0 bytes/sec, 0 packets/sec
Last 300 seconds output: 0 bytes/sec, 0 packets/sec
10 packets input, 840 bytes
0 input error
10 packets output, 840 bytes
0 output error
[RouterB] display interface tunnel 0
Tunnel0 current state: UP
Line protocol current state: UP
Description: Tunnel0 Interface
The Maximum Transmit Unit is 1476
Internet Address is 10.1.2.2/24 Primary
Encapsulation is TUNNEL, service-loopback-group ID not set.
Tunnel source 2.2.2.2, destination 1.1.1.1
Tunnel keepalive disabled
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/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: 2 bytes/sec, 0 packets/sec
Last 300 seconds output: 2 bytes/sec, 0 packets/sec
10 packets input, 840 bytes
0 input error
10 packets output, 840 bytes
0 output error
# 从Router B可以Ping通Router A上Ethernet1/1接口的地址。
[RouterB] ping 10.1.1.1
PING 10.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.1: bytes=56 Sequence=1 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=2 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=3 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=4 ttl=255 time=2 ms
Reply from 10.1.1.1: bytes=56 Sequence=5 ttl=255 time=2 ms
--- 10.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/2/2 ms
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论