1、GRE配置
大哥帮忙敲一下命令!谢谢
(0)
最佳答案
Switch A和Switch B分别连接IPv4私有网络Group 1和Group 2。这两个私有网络都使用私网地址,且属于同一个VPN。通过在Switch A和Switch B之间建立GRE隧道,实现两个私有网络的互联。
图1-7 GRE over IPv4隧道应用组网图
在开始下面的配置之前,假设设备各接口的地址都已配置完毕,并且Switch A和Switch B之间路由可达。
(1) 配置Switch A
# 创建业务环回组1,并配置服务类型为Tunnel。
<SwitchA> system-view
[SwitchA] service-loopback group 1 type tunnel
# 将接口GigabitEthernet1/0/3加入业务环回组1。
[SwitchA] interface gigabitethernet 1/0/3
[SwitchA-GigabitEthernet1/0/3] port service-loopback group 1
[SwitchA-GigabitEthernet1/0/3] quit
# 创建Tunnel1接口,并指定隧道模式为GRE over IPv4隧道。
[SwitchA] interface tunnel 1 mode gre
# 配置Tunnel1接口的IP地址。
[SwitchA-Tunnel1] ip address 10.1.2.1 255.255.255.0
# 配置Tunnel1接口的源端地址(Switch A的Vlan-interface101的IP地址)。
[SwitchA-Tunnel1] source 1.1.1.1
# 配置Tunnel1接口的目的端地址(Switch B的Vlan-interface101的IP地址)。
[SwitchA-Tunnel1] destination 2.2.2.2
[SwitchA-Tunnel1] quit
# 配置从Switch A经过Tunnel1接口到Group 2的静态路由。
[SwitchA] ip route-static 10.1.3.0 255.255.255.0 tunnel 1
(2) 配置Switch B
# 创建业务环回组1,并配置服务类型为Tunnel。
<SwitchB> system-view
[SwitchB] service-loopback group 1 type tunnel
# 将接口GigabitEthernet1/0/3加入业务环回组1。
[SwitchB] interface gigabitethernet 1/0/3
[SwitchB-GigabitEthernet1/0/3] port service-loopback group 1
[SwitchB-GigabitEthernet1/0/3] quit
# 创建Tunnel1接口,并指定隧道模式为GRE over IPv4隧道。
[SwitchB] interface tunnel 1 mode gre
# 配置Tunnel1接口的IP地址。
[SwitchB-Tunnel1] ip address 10.1.2.2 255.255.255.0
# 配置Tunnel1接口的源端地址(Switch B的Vlan-interface101的IP地址)。
[SwitchB-Tunnel1] source 2.2.2.2
# 配置Tunnel1接口的目的端地址(Switch A的Vlan-interface101的IP地址)。
[SwitchB-Tunnel1] destination 1.1.1.1
[SwitchB-Tunnel1] quit
# 配置从Switch B经过Tunnel1接口到Group 1的静态路由。
[SwitchB] ip route-static 10.1.1.0 255.255.255.0 Tunnel 1
# 查看Switch A的Tunnel接口状态。
[SwitchA] display interface tunnel 1
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64kbps
Maximum transmission unit: 1476
Internet address: 10.1.2.1/24 (primary)
Tunnel source 1.1.1.1, destination 2.2.2.2
Tunnel keepalive disabled
Tunnel TTL 255
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 rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 查看Switch B的Tunnel接口状态。
[SwitchB] display interface tunnel 1
Tunnel1
Current state: UP
Line protocol state: UP
Description: Tunnel1 Interface
Bandwidth: 64kbps
Maximum transmission unit: 1476
Internet address: 10.1.2.2/24 (primary)
Tunnel source 2.2.2.2, destination 1.1.1.1
Tunnel keepalive disabled
Tunnel TTL 255
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 rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bytes/sec, 0 bits/sec, 0 packets/sec
Input: 0 packets, 0 bytes, 0 drops
Output: 0 packets, 0 bytes, 0 drops
# 从Switch B可以Ping通Switch A上Vlan-interface100的地址。
[SwitchB] ping -a 10.1.3.1 10.1.1.1
Ping 10.1.1.1 (10.1.1.1) from 10.1.3.1: 56 data bytes, press CTRL_C to break
56 bytes from 10.1.1.1: icmp_seq=0 ttl=255 time=11.000 ms
56 bytes from 10.1.1.1: icmp_seq=1 ttl=255 time=1.000 ms
56 bytes from 10.1.1.1: icmp_seq=2 ttl=255 time=0.000 ms
56 bytes from 10.1.1.1: icmp_seq=3 ttl=255 time=0.000 ms
56 bytes from 10.1.1.1: icmp_seq=4 ttl=255 time=0.000 ms
--- Ping statistics for 10.1.1.1 ---
5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.000/2.400/11.000/4.317 ms
(0)
多好的机会 继续学。万事开头难
(0)
这块儿还没学到,就要比赛
这块儿还没学到,就要比赛
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明