【无标题】MGRE综合实验

 

 实验要求

1,R5为ISP,,只能进行IP地址配置;其所有地址均配为公有IP地址
2,R1和R5间使用ppp的PAP认证,R5为主认证方;
R2于R5之间使用ppp的chap认证,R5为主认证方,
R3于R5之间使用HDLC封装
3,R1/R2/R3构建一个MGRE环境,R1为中心站点;R1、R4间为点到点的GRE
4,整个私有网络基于RIP全网可达
5,所有PC设置私有IP为源IP,可以访问R5环回

第一步:配置ip地址

r1
[r1]int s 4/0/0
[r1-Serial4/0/0]ip add 15.0.0.1 24
[r1-Serial4/0/0]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]q
r2
[r2]int s 4/0/0
[r2-Serial4/0/0]ip add 25.0.0.1 24
[r2-Serial4/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.2.1 24
[r2-GigabitEthernet0/0/1]q
r3
[r3]int s 4/0/0
[r3-Serial4/0/0]ip add 35.0.0.1 24
[r3-Serial4/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[r3-GigabitEthernet0/0/1]q
[r3]
r4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 45.0.0.1 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[r4-GigabitEthernet0/0/1]
r5(isp)
[isp]int s 3/0/0
[isp-Serial3/0/0]ip add 15.0.0.2 24
[isp-Serial3/0/0]int s 3/0/1
[isp-Serial3/0/1]ip add 25.0.0.2 24
[isp-Serial3/0/1]int s 4/0/0
[isp-Serial4/0/0]ip add 35.0.0.2 24
[isp-Serial4/0/0]int g 0/0/0
[isp-GigabitEthernet0/0/0]ip add 45.0.0.2 24
[isp-GigabitEthernet0/0/0]int l0
[isp-LoopBack0]ip add 5.5.5.5 24
[isp-LoopBack0]q
[isp]

私网边界路由器配一条指向isp的缺省
[r1]ip route-static 0.0.0.0 0 15.0.0.2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[r4]ip route-static 0.0.0.0 0 45.0.0.2

R1认证,isp为主认证方
[isp]aaa
[isp-aaa]local-user r1 password cipher 123456
Info: Add a new user.
[isp-aaa]lo
[isp-aaa]local-user r1 se
[isp-aaa]local-user r1 service-type ppp
[isp-aaa]q
[isp]
[isp]int s 3/0/0
[isp-Serial3/0/0]ppp a
[isp-Serial3/0/0]ppp authentication-mode pap

[r1]int s 4/0/0
[r1-Serial4/0/0]ppp pap local-user r1 password cipher 123456
[r1-Serial4/0/0]

[r1-Serial4/0/0]shutdown
[r1-Serial4/0/0]undo shutdown
关闭接口后重新开启接口来进行测试


测试成功,r1pap认证成功 

R2和ISP之间采用chap认证
[isp]aaa
[isp-aaa]local-user r2 password cipher 123456
Info: Add a new user.
[isp-aaa]local-user r2 service-type ppp
[isp-aaa]q
[isp]int s 3/0/1
[isp-Serial3/0/1]ppp authentication-mode chap
[isp-Serial3/0/1]

[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap user r2
[r2-Serial4/0/0]ppp chap password cipher 123456
[r2-Serial4/0/0]q
[r2]
[r2-Serial4/0/0]shutdown
[r2-Serial4/0/0]undo shutdown
等待接口重新起来之后在ping25.0.0.2

 r2和r5认证成功

r3和r5之间使用HDLC封装
更改串线协议,注意r3和r5都要更改,否则协议不对,会失败
[r3]int s 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[isp]int s 4/0/0
[isp-Serial4/0/0]link
[isp-Serial4/0/0]link-protocol h
[isp-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

 测试成功

r1创建虚拟接口
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r1-Tunnel0/0/0]
[r1-Tunnel0/0/0]

选择封装类型
[r1-Tunnel0/0/0]tun
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.0.0.1

通过nhrp协议获取目标IP
[r1-Tunnel0/0/0]nhrp n
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic

r2分支站点
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp

分支允许出接口发生变化
[r2-Tunnel0/0/0]source Serial 4/0/0

加入r1中心域
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register

r3重复r2配置
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 192.168.5.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
r1测试r2,r3是否添加成功


r1,r4做点到点的GRE

[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip add 192.168.6.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.0.0.1
[r1-Tunnel0/0/1]destination 45.0.0.1

[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre
[r4-Tunnel0/0/0]source 45.0.0.1
[r4-Tunnel0/0/0]destination 15.0.0.1

私网边界路由器运行rip协议
r1-r4进行宣告
[r1]rip
[r1-rip-1]v 2
[r1-rip-1]
[r1-rip-1]net
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0
[r2]rip
[r2-rip-1]v 2
[r2-rip-1]ne
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r2-rip-1]
[r3]rip
[r3-rip-1]
[r3-rip-1]v 2
[r3-rip-1]
[r3-rip-1]net
[r3-rip-1]network 192.168.5.0
[r3-rip-1]network 192.168.3.0
[r3-rip-1]
[r4]rip
[r4-rip-1]v 2
[r4-rip-1]ne
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0

PC私有地址
pc1
192.168.1.2
pc2
192.168.4.2
pc3
192.168.3.2
pc4
192.168.2.2
在边界设备做nat
r1
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int s 4/0/0
[r1-Serial4/0/0]nat outbound 2000

r2
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]int s 4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r2-Serial4/0/0]

r3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int s 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r3-Serial4/0/0]q

r4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]q
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000

测试

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值