MGRE实验

MGRE
使用模拟器:GNS3
要求:
(1)R5为ISP
(2)R1/R2/R3之间建立MGRE环境
(3)R4与R1/R2/R3的tunnel之间建立EIGRP环境(公网所在R5与其他路由器只连接口不能在ERGRP环境内)
(4)为了保障安全性,R1和R5之间运用CHAP认证,R5为主认证方
(5)R4可以正常访问R5的环回地址
一:路由器基本配置:
1 Router>enable
2 Router#config
3 Router(config)#no ip domain-lookup      (关闭域名解析)
4 Router(config)#line console 0                 
5 Router(config-line)#logg synchronous  (开启日至同步)
6 Router(config-line)#exec-timeout 0 0    (永不超时)
7 Router(config)#hostname xxxx               (给路由器改名)

二:地址划分(合理即可)

R4的loopback 1的地址为 :172.16,1.024
R5的loopback 1的地址为 :5.5.5.5/24
R2的loopback 1的地址为 :2.2.2.2/24
R3的loopback 1的地址为 :3.3.3.3/24
R4的s1/0接口的的地址为 :192.168.1.1/24
R1的s1/0接口的的地址为 :192.168.1.2/24
R1的s1/1接口的的地址为 :15.1.1.1/24
R5的s1/0接口的的地址为 :15.1.1.2/24
R5的s1/1接口的的地址为 :25.1.1.2/24
R5的s1/2接口的的地址为 :35.1.1.2/24
R2的s1/0接口的的地址为 :25.1.1.1/24
R3的s1/0接口的的地址为 :35.1.1.1/24

三:进行ISP环境配置:
1、R1(config)#ip router 0.0.0.0 0.0.0.0 15.1.1.2
2、R2(config)#ip router 0.0.0.0 0.0.0.0 25.1.1.2
3、R3(config)#ip router 0.0.0.0 0.0.0.0 35.1.1.2
配置完成后用R1/R2/R3访问R5的loopback 1 来验证ISP环境

四:R1/R2/R3上进行配置MGRE环境:   (隧道必须建立在公网环境通的情况下)
中心站点的配置:
R1(config)#int tunnel 0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#tunnel source 15.1.1.1
R1(config-if)# tunnel mode gre multipoint
R1(config-if)#ip nhrp map multicast dynamic  让他成为NHRP的服务器
R1(config-if)#ip nhrp network-id 100         所有的站点必须处于同一个ID内
multicast 让本设备在目标地址为组播或广播时,将流量基于表中所有的目标单独发送一次;
分支站点的配置:
R2(config-if)#interface tunnel 0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#tunnel source s1/0
R2(config-if)#tunnel mode gre multipoint 
R2(config-if)#ip nhrp nhs 10.1.1.1           定义NHRP的server,此处必须为tunnel口地址(相当于数据报道的地方)
R2(config-if)#ip nhrp map 10.1.1.1 15.1.1.1  映射tunnel的公网地址 
R2(config-if)#ip nhrp network 100 (ID必须一样)
R3:(R3同R2配置一样,虚地址不一样)

NBMA:多路访问,在同一个网段内节点数量不做限制,但是当目标ip地址为组播或广播地址时,流量必须逐一发送到每个节点;
若希望分支节点可以以组播或广播地址为目标ip,那么需要定义流量的具体目标
R2(config-if)#ip nhrp map multicast 15.1.1.1  (开启伪广播,MGRE不能进行广播,由于EIGRP是组播更新,所以要开启伪广播)

五:R4与R1/R2/R3之间的tunnel建立EIGRP:
R4配置:
R4(config)#router eigrp 90
R4(config-router)#no auto-summary
R4(config-router)#network 172.16.1.0
R4(config-router)#network 192.168.1.0
R4(config-router)#exit
R1配置:
R1(config)#router eigrp 90
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.1.0
R1(config-router)#network 10.0.0.0
R1(config-router)#exit
R2配置:
R2(config)#router eigrp 90
R2(config-router)#no auto-summary
R2(config-router)#network 2.2.2.0
R2(config-router)#network 10.0.0.0
R2(config-router)#exit
R3配置:
R3(config)#router eigrp 90
R3(config-router)#no auto-summary
R3(config-router)#network 3.3.3.0
R3(config-router)#network 10.0.0.0
R3(config-router)#exit

六:因为R5为ISP,内网上网需要通过NAT技术,R1上做NAT指向ISP
R1给R4下发缺省:
R1(config)#int s1/1
R1(config-if)#ip summary-address eigrp 90 0.0.0.0 0.0.0.0
配置NAT:
R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255
R1(config)#access-list 1 permit 172.16.1.0 0.0.0.255
R1(config)#ip nat inside source list 1 int s1/1 overload
R1(config)#int s1/1
R1(config-if)#ip nat outside
R1(config-if)#exit
R1(config)#int s1/0
R1(config-if)#ip nat inside
R1(config-if)#exit

七:为了链路的安全,在R1R-R5的链路上使用ppp封装,并且开启CHAP认证:
修改接口封装:
R1(config)#interface s1/1
R1(config-if)#encapsulation ppp
R5(config)#interface s1/1
R5(config-if)#encapsulation ppp
注:有两种认证方式:
1、基于主机名:
主认证方:
R5(config)#int s1/1
R5(config-if)#encapsulation ppp
R5(config-if)#ppp chap authentication chap
R5(config-if)#ppp chap passwd 123
R5(config-if)#exit
被认证方:
R1(config)#int s1/1
R1(config)#encapsulate ppp
R1(config)#ppp chap hostname R1
R1(config)#ppp chap passwd 123
R1(config)#exit
2、不基于主机名:
主认证方:
R5(config)#int s1/1
R5(config-if)#ppp authentication chap
R5(config-if)#username CCNA passwd 123(CCNA为主机名,123为密码)
被认证方:
R1(config)#interface s1/1
R5(config-if)#ppp chap passwd 123
R5(config-if)#ppp chap hostname CCNA
 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值