H3C之GRE VPN

GRE实验

在这里插入图片描述

  • 第一步:接口配置IP地址
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname r1
[r1]int g0/0
[r1-GigabitEthernet0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0]int g0/1
[r1-GigabitEthernet0/1]ip add 12.1.1.1 24
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]
[H3C]sysname r2
[r2]int g0/0
[r2-GigabitEthernet0/0]ip add 12.1.1.2 24
[r2-GigabitEthernet0/0]int g0/1
[r2-GigabitEthernet0/1]ip add 23.1.1.2 24
[r2-GigabitEthernet0/1]int loo0
[r2-LoopBack0]ip add 4.4.4.4 24
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname r3
[r3]int g0/0
[r3-GigabitEthernet0/0]ip add 23.1.1.1 24
[r3-GigabitEthernet0/0]int g0/1
[r3-GigabitEthernet0/1]ip add 192.168.3.1 24
  • 公网路由:配置静态
[r1]ip route-static 0.0.0.0 0 12.1.1.2
[r3]ip route-static 0.0.0.0 0 23.1.1.2
  • r1r3配置DHCP服务
[r1]dhcp enable
[r1]dhcp server ip-pool aaa
[r1-dhcp-pool-aaa]network 192.168.1.0 mask 255.255.255.0
[r1-dhcp-pool-aaa]gateway-list 192.168.1.1
[r3]dhcp enable
[r3]dhcp server ip-pool bbb
[r3-dhcp-pool-bbb]network 192.168.3.0 mask 255.255.255.0
[r3-dhcp-pool-bbb]gateway-list 192.168.3.1
  • pc能够访问公网
[r1]acl basic 2000
[r1-acl-ipv4-basic-2000]rule permit source any
[r1-acl-ipv4-basic-2000]quit
[r1]int g0/1
[r1-GigabitEthernet0/1]nat outbound 2000
[r3]acl basic 2000
[r3-acl-ipv4-basic-2000]rule permit source any
[r3-acl-ipv4-basic-2000]quit
[r3]int g0/0
[r3-GigabitEthernet0/0]nat outbound 2000
  • 私网可以访问私网(通过GRE技术)
[r1]int Tunnel 0  mode gre
[r1-Tunnel0]ip add 192.168.2.1 24
[r1-Tunnel0]source g0/1
[r1-Tunnel0]destination 23.1.1.1
[r3]int Tunnel 0 mode gre
[r3-Tunnel0]ip add 192.168.2.2 24
[r3-Tunnel0]source g0/0
[r3-Tunnel0]destination 12.1.1.1
  • 私网路由通
[r1]ip route-static 192.168.3.0 24 192.168.2.2
[r3]ip route-static 192.168.1.0 24 192.168.2.1

测试

  • 访问公网
<H3C>ping 4.4.4.4
Ping 4.4.4.4 (4.4.4.4): 56 data bytes, press CTRL_C to break
56 bytes from 4.4.4.4: icmp_seq=0 ttl=254 time=3.000 ms
56 bytes from 4.4.4.4: icmp_seq=1 ttl=254 time=3.000 ms
56 bytes from 4.4.4.4: icmp_seq=2 ttl=254 time=2.000 ms
56 bytes from 4.4.4.4: icmp_seq=3 ttl=254 time=3.000 ms
56 bytes from 4.4.4.4: icmp_seq=4 ttl=254 time=2.000 ms
  • 私网访问私网
<H3C>ping 192.168.3.2
Ping 192.168.3.2 (192.168.3.2): 56 data bytes, press CTRL_C to break
56 bytes from 192.168.3.2: icmp_seq=0 ttl=253 time=3.000 ms
56 bytes from 192.168.3.2: icmp_seq=1 ttl=253 time=4.000 ms
56 bytes from 192.168.3.2: icmp_seq=2 ttl=253 time=5.000 ms
56 bytes from 192.168.3.2: icmp_seq=3 ttl=253 time=5.000 ms
56 bytes from 192.168.3.2: icmp_seq=4 ttl=253 time=4.000 ms

MGRE实验

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

^~^前行者~~~

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

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

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

打赏作者

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

抵扣说明:

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

余额充值