题目
一.实验步骤
1.根据题目制作拓扑图(本次我制作的与题目一样,故不展示自己做的)
2.对四台pc电脑做IPv4的配置
为了方便辨认网段,做以下IP配置
3.配置IP地址
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r1-GigabitEthernet0/0/0]int s4/0/0
[r1-Serial4/0/0]ip add 15.1.1.1 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.2 24
[r2-GigabitEthernet0/0/0]int s4/0/0
[r2-Serial4/0/0]ip add 25.1.1.2 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.3 24
[r3-Serial4/0/0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.3 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.3 24
[r3-Serial4/0/0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.3 24
[r5]int s4/0/1
[r5-Serial4/0/1]ip add 15.1.1.5 24
[r5-Serial4/0/1]int s3/0/1
[r5-Serial3/0/1]ip add 25.1.1.5 24
[r5-Serial3/0/1]int s4/0/0
[r5-Serial4/0/0]ip add 35.1.1.5 24
[r5-Serial4/0/0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.5 24
[r5-GigabitEthernet0/0/0]int l0
[r5-LoopBack0]ip add 5.5.5.0 24
Error: The specified IP address is invalid.
[r5-LoopBack0]ip add 5.5.5.5 24
4.配置静态路由
[r1]ip route-static 0.0.0.0 0 15.1.1.5
[r2]ip route-static 0.0.0.0 0 25.1.1.5
[r3]ip route-static 0.0.0.0 0 35.1.1.5
[r4]ip route-static 0.0.0.0 0 45.1.1.5
5.对R1和R5配置ppp的pap协议
对认证方AR5进行配置:创建用户信息,指定认证用户业务类型,指定认证模式为PAP
对被认证方AR1进行配置:进入接口中添加PPP认证的用户信息
r5作为主认证方
[r5]aaa
[r5-aaa]
[r5-aaa]local-user jin password cipher 123
Info: Add a new user.
[r5-aaa]local-user jin service-type ppp # 指定认证用户业务类型
[r5-aaa]int s4/0/1
[r5-Serial4/0/1]link-protocol ppp # 设置接口报文的封装模式
[r5-Serial4/0/1]ppp authentication-mode pap # 设置验证类型
r1作为被认证方
[r1]int s4/0/0
[r1-Serial4/0/0]link-protocol ppp
[r1-Serial4/0/0]ppp pap local-user jin password cipher 123 # 添加PPP认证的用户信息
6.对R2和R5配置DHCP协议
认证方AR5进行配置:创建用户信息,指定认证用户业务类型,指定认证模式为CHAP
对认证方AR2进行配置:进入接口中添加PPP认证的用户信息
r5作为主认证方
[r5]aaa
[r5-aaa]local-user jia password cipher 123
Info: Add a new user.
[r5-aaa]local-user jia service-type ppp
[r5-aaa]int s3/0/1
[r5-Serial3/0/1]ppp authentication-mode chap # 设置验证类型
[r5-Serial3/0/1]link-protocol ppp
r2作为被认证方
[r2]int s4/0/0
[r2-Serial4/0/0]ppp chap user jia
[r2-Serial4/0/0]ppp chap password cipher 123
7.R3和R5之间进行HDLC封装
在AR3,AR5两边接口下修改链路类型,改为HDLC
r3
[r3]int s4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
r5
[r5]int s4/0/0
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
使用命令行查看接口的协议类型是否是HDLC协议
[r5]dis int s4/0/0
8.R1、R2、R3构建一个MGRE环境,R1为中心站点,R1、R4间为点到点的GRE
AR1创建MGRE隧道接口Tunnel 0/0/0,创建NHRP域,配置IP地址,定义封装类型,定义被封装的源地址,配置NHRP,AR2和AR3加入到中心站点域100并注册自己的信息;都配置完后再查看NHRP邻居情况。
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24 # 配置隧道IP地址
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp #定义封装方式
[r1-Tunnel0/0/0]source 15.1.1.1 # 定义隧道被封装的源地址
[r1-Tunnel0/0/0]nhrp network-id 100 # 创建NHRP域
[r1-Tunnel0/0/0]nhrp entry multicast dynamic # 开启伪广播
[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
[r2-Tunnel0/0/0]nhrp network-id 100 # 让分支加入中心站点域
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register # 分支找中心注册自己的信息
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
AR1创建GRE隧道接口Tunnel 0/0/1,AR1和AR4两端都配置IP地址,定义封装方式,定义被封装的源地址和目标地址。
ps:!!!注意destination和description的不同,在我们配置是容易tap到后者,如果单词不对则不能实现后面的步骤---全网可通
[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre
[r1-Tunnel0/0/1]source 15.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.4
[r4]int t0/0/1
[r4-Tunnel0/0/1]ip address 10.1.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.4
[r4-Tunnel0/0/1]destination 15.1.1.1
9.私网RIP全网可达
添加缺省路由,指向运营商ISP;使用rip宣告网段地址的路由信息,再关闭rip的水平分割机制
[r1]rip 1
[r1-rip-1]undo summary # 关闭子网汇总
[r1-rip-1]v 2
[r1-rip-1]network 192.168.1.0 # 向全网宣告IP地址
[r1-rip-1]network 10.0.0.0
[r2]rip 1
[r2-rip-1]undo summary
[r2-rip-1]v 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]undo summary
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
[r4]rip 1
[r4-rip-1]undo summary
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
[r1]int t0/0/0
[r1-Tunnel0/0/0]undo rip split-horizon # 取消rip的水平分割机制
r2要实现四个目的地
10.配置NAT
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]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-acl-basic-2000]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-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000