网络类型实验报告

 

 

1.配置IP

r1:

[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip address 12.1.1.1 24
[r1-Serial4/0/0]int gi 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24

r2:

[r2-Serial4/0/0]ip add 12.1.1.2 24
[r2-Serial4/0/0]int s 4/0/1
[r2-Serial4/0/1]ipadd 12.1.2.1 24
[r2-Serial4/0/1]int s 3/0/0
[r2-Serial3/0/0]ip add 12.1.3.1 24

[r2]int LoopBack 0  
[r2-LoopBack0]ip address 2.2.2.2 24

r3:

[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip add 12.1.2.2 24

[r3-Serial4/0/0]int gi 0/0/1 
[r3-GigabitEthernet0/0/1]ip add 192.168.2.1 24

r4:

[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ip add 12.1.3.2 24
[r4-Serial4/0/0]int gi 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.3.1 24

2.r1-r2之间为hdlc封装

r1:

[r1-Serial4/0/0]link-protocol hdlc  修改接口封装类型为hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

r2:

[r2]interface Serial 4/0/0
[r2-Serial4/0/0]link-protocol hdlc    修改接口封装类型为hdlc

’Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y

3. r2-r3之间为ppp封装,认证,r2为主认证方

 r2:

[r2]interface Serial 4/0/1
[r2-Serial4/0/1]link-protocol PPP 修改接口封装类型为PPP

r3:

[r3]interface Serial 4/0/0
[r3-Serial4/0/0]link-protocol PPP 修改封装接口类型为PPP

认证:

r2:

[r2]aaa
[r2-aaa]local-user qq privilege level 15 password cipher 123456 创建用户名 密码
Info: Add a new user.
[r2-aaa]local-user qq service-type ppp 设置类型
[r2-aaa]int s4/0/1
[r2-Serial4/0/1]ppp authentication-mode pap 在接口上声明需要pap认证


 r3(被认证方):

[r3-Serial4/0/0]ppp pap local-user qq password cipher 123456

4. r2-r4之间为ppp封装,chap认证,r2为主认证方

r2:

[r2]aaa
[r2-aaa]local-user pp privilege level 15 password cipher 123456
Info: Add a new user.  
[r2-aaa]local-user pp service-type ppp
[r2-aaa]int s 3/0/0
[r2-Serial3/0/0]ppp authentication-mode  chap 

r4:

[r4]interface Serial 4/0/0
[r4-Serial4/0/0]ppp chap user pp
[r4-Serial4/0/0]ppp chap password cipher 123456

5.r1,r2,r3构建MGRE环境,仅r1ip地址固定

缺省路由

[r1]ip route-static 0.0.0.0 0 12.1.1.2

[r3]ip route-static 0.0.0.0 0 12.1.2.1

[r4]ip route-static 0.0.0.0 0 12.1.3.1

然后搭建MGRE环境:

r1(中心站点):

[r1]interface Tunnel 0/0/0  创建隧道接口
[r1-Tunnel0/0/0]ip address 192.168.4.1 24  隧道接口ip
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp  定义该隧道为多点GRE隧道

[r1-Tunnel0/0/0]source 12.1.1.1 该隧道加封装报头源ip地址

通过nhrp协议来获取加封装的目标ip地址
[r1-Tunnel0/0/0]nhrp entry multicast dynamic本地为NHRP服务器  

[r1-Tunnel0/0/0]nhrp network-id 100   NHRP的工作编号 ,该网段所有设备必须在同一id

分支站点:

r3:

[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.4.2 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 

加封装的源ip地址为本地的隧道实际通过接口的ip地址,填写接口编号,而不是接口ip,原因在于该接口ip会变
[r3-Tunnel0/0/0]source GigabitEthernet 0/0/0

加封装的目标ip地址需要到NHRP中心站点获取
[r3-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.1 register 
[r3-Tunnel0/0/0]nhrp network-id 100

r4:

[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 192.168.4.3 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r4-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r4-Tunnel0/0/0]nhrp entry 192.168.4.1 12.1.1.1 register 
[r4-Tunnel0/0/0]nhrp network-id 100

6.利用rip动态路由的方式实现全网可达

r1:

[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.4.0

r3:

[r3-Tunnel0/0/0]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.2.0
[r3-rip-1]network 192.168.4.0

r4:

[r4]rip 1
[r4-rip-1]v 2
[r4-rip-1]network 192.168.3.0
[r4-rip-1]network 192.168.4.0

这里因为rip的水平分割机制导致r3无法与与r4分享网段所以需要关闭rip的水平分割机制

[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon 

[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000

[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000

[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r4]interface Serial 4/0/0
[r4-Serial4/0/0]nat outbound 2000

ping一下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值