网络中级实验 --- 封装、MGRE、RIP

拓扑设计和IP地址规划

1.为R4进行HDLC封装、PAP认证、CHAP认证以及环回配置

[r4]int s4/0/0
(进行HDLC封装)
[r4-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
[r4-Serial4/0/0]ip address 14.1.1.2 24
(创建账号,账号的功能是进行PPP封装)
[r4]int s3/0/0
[r4-Serial3/0/0]ppp authentication-mode pap
[r4-Serial3/0/0]ip add 24.1.1.1 24
[r4]aaa
[r4-aaa]local-user sss privilege level 15 password cipher 123456
Info: Add a new user.
[r4-aaa]local-user sss service-type ppp
[r4]int s4/0/1
[r4-Serial4/0/1]ppp authentication-mode chap
[r4-Serial4/0/1]ip add 34.1.1.2 24
[r4]aaa
[r4-aaa]local-user aaa privilege level 15 password cipher 123456
Info: Add a new user.
[r4-aaa]local-user aaa service-type ppp
[r4]int LoopBack 0
[r4-LoopBack0]ip address 4.4.4.4 24

(查看)

检测

(默认两边都是PPP封装,处于 up 状态)

[r4]int s3/0/0
[r4-Serial3/0/0]shutdown 
[r4-Serial3/0/0]undo shutdown
[r4]int s4/0/1
[r4-Serial4/0/1]shutdown 
[r4-Serial4/0/1]undo shutdown

(查看)

2.对私网路由器配置

[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]int s4/0/0
[r1-Serial4/0/0]ip address 14.1.1.1 24
[r1-Serial4/0/0]link-protocol hdlc 
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y

[r2]int g0/0/0 
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24 
[r2]int s4/0/0
[r2-Serial4/0/0]ip address 24.1.1.1 24
[r2-Serial4/0/0]ppp pap local-user sss password cipher 123456

[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip address 34.1.1.1 24
[r3-Serial4/0/0]ppp chap user aaa
[r3-Serial4/0/0]ppp chap password cipher 123456

(验证)

3.给电脑配置IP地址

 

4.配置缺省路由

[r1]ip route-static 0.0.0.0 0 14.1.1.2
[r2]ip route-static 0.0.0.0 0 24.1.1.2
[r3]ip route-static 0.0.0.0 0 34.1.1.2

(验证)

5.建立MGRE环境(MGRE环境--NBMA网段)

[r1]int t0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r1-Tunnel0/0/0]source 14.1.1.1
(启动nhrp,作为nhrp的服务端)
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 
[r1-Tunnel0/0/0]nhrp network-id 100
[r2]int t0/0/0
[r2-Tunnel0/0/0]ip add 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r2-Tunnel0/0/0]source s4/0/0     
(找到10.1.1.1进行注册,用其公有ip进行注册)
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register 
[r2-Tunnel0/0/0]nhrp network-id 100
[r3]int t0/0/0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]source s4/0/0
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 14.1.1.1 register 
[r3-Tunnel0/0/0]nhrp network-id 100

(查看)

(R2 ping 10.1.1.3 之后)

6.宣告(RIP)

[r1]rip 1 
[r1-rip-1]ver 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0

(R1将路由共享给R2和R3,R2和R3之间不共享路由)
(关闭水平分割)

[r1]int t0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon 

优化:手写静态路由

[r3]ip route-static 192.168.2.0 24 10.1.1.2
[r2]ip route-static 192.168.3.0 24 10.1.1.3

验证

7.进行NAT(将源IP变成公有IP)

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]int s4/0/0
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000        
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2]int s4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3]int s4/0/0 
[r3-Serial4/0/0]nat outbound 2000

(验证)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

雨天_

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

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

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

打赏作者

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

抵扣说明:

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

余额充值