实验
- 1. 拓扑搭建
- 2. 配置各路由器物理接口IP地址
- 边界路由器到ISP通
- 测试
- PAP认证
- CHAP认证
- R3与R5间使用HDLC封装
- R1与R4为GRE环境
- R1、R2、R3为MGRE环境
- 私有网络基于RIP全网可达
- 给PC配置IP地址
- 测试ping通性
环境:华为模拟器
实验要求
1. 拓扑搭建
2. 配置各路由器物理接口IP地址
R1
[R1]int s4/0/0
[R1-Serial4/0/0]ip add 15.1.1.1 24
R2
[R2]int s4/0/0
[R2-Serial4/0/0]ip add 25.1.1.1 24
R3
[R3]int s4/0/0
[R3-Serial4/0/0]ip add 35.1.1.1 24
R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
R5
[R5]int s3/0/0
[R5-Serial3/0/0]ip add 15.1.1.2 24
[R5-Serial3/0/0]int s3/0/1
[R5-Serial3/0/1]ip add 25.1.1.2 24
[R5-Serial3/0/1]int s4/0/0
[R5-Serial4/0/0]ip add 35.1.1.2 24
[R5-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[R5-GigabitEthernet0/0/0]int lo1
[R5-LoopBack1]ip add 5.5.5.5 24
边界路由器到ISP通
将R1、R2、R3、R4当做内网的边界路由器,R5当做ISP运营商,所以边界路由器需要配置缺省路由指向自己公网的运营商设备
[R1]ip route-static 0.0.0.0 0 15.1.1.2
[R2]ip route-static 0.0.0.0 0 25.1.1.2
[R3]ip route-static 0.0.0.0 0 35.1.1.2
[R4]ip route-static 0.0.0.0 0 45.1.1.2
测试
R1 测试
R4测试
PAP认证
R5 主认证方
[R5]aaa
[R5-aaa]local-user xixi password cipher xixi123
Info: Add a new user.
[R5-aaa]local-user xixi service-type ppp
[R5-aaa]int s3/0/0 连接客户端的接口
[R5-Serial3/0/0]link-protocol ppp
[R5-Serial3/0/0]ppp authentication-mode pap
此时被认证方R1pingR5的接口不通
被认证方R1
[R1]int s4/0/0
[R1-Serial4/0/0]link-protocol ppp
[R1-Serial4/0/0]ppp pap local-user xixi password cipher xixi123
R1做完认证再次pingR5的接口
CHAP认证
R5主认证方
[R5]aaa
[R5-aaa]local-user heihei password cipher heihei123
Info: Add a new user.
[R5-aaa]local-user heihei service-type ppp
[R5-aaa]int s3/0/1
[R5-Serial3/0/1]link-protocol ppp
[R5-Serial3/0/1]ppp authentication-mode chap
被认证方
[R2]int s4/0/0
[R2-Serial4/0/0]link-protocol ppp
[R2-Serial4/0/0]ppp chap user heihei
[R2-Serial4/0/0]ppp chap password cipher heihei123
R2完成认证ping连接R5的接口
R3与R5间使用HDLC封装
[R3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
[R5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
R1与R4为GRE环境
R1
[R1]int Tunne0/0/0
[R1-Tunnel0/0/0]ip add 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre
[R1-Tunnel0/0/0]source 15.1.1.1
[R1-Tunnel0/0/0]destination 45.1.1.1
R4
[R4]int Tunnel 0/0/0
[R4-Tunnel0/0/0]ip add 10.1.1.2 24
[R4-Tunnel0/0/0]tunnel-protocol gre
[R4-Tunnel0/0/0]source 45.1.1.1
[R4-Tunnel0/0/0]destination 15.1.1.1
R1、R2、R3为MGRE环境
R1
[R1]int Tunnel 0/0/1 创建tunnel口
[R1-Tunnel0/0/1]ip add 10.1.2.1 24 配置IP地址
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp 修改接口模式为多点GRE
[R1-Tunnel0/0/1]source 15.1.1.1 定义公有源IP地址
[R1-Tunnel0/0/1]nhrp entry multicast dynamic 本地成为NHRP中心,同时可以进行伪广播
[R1-Tunnel0/0/1]nhrp network-id 100
分支站点R2
[R2]int Tunnel 0/0/1
[R2-Tunnel0/0/1]ip add 10.1.2.2 24
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp
[R2-Tunnel0/0/1]source s4/0/0
[R2-Tunnel0/0/1]nhrp network-id 100
[R2-Tunnel0/0/1]nhrp entry 10.1.2.1 15.1.1.1 register
分支站点R3
[R3]int Tunnel 0/0/1
[R3-Tunnel0/0/1]ip add 10.1.2.3 24
[R3-Tunnel0/0/1]tunnel-protocol gre p2mp
[R3-Tunnel0/0/1]source s4/0/0
[R3-Tunnel0/0/1]nhrp network-id 100
[R3-Tunnel0/0/1]nhrp entry 10.1.2.1 15.1.1.1 register
私有网络基于RIP全网可达
R1
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]un summary
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
R2
[R2]rip 1
[R2-rip-1]ver 2
[R2-rip-1]un summary
[R2-rip-1]network 10.0.0.0
[R2-rip-1]network 192.168.2.0
R3
[R3]rip 1
[R3-rip-1] ver 2
[R3-rip-1]un summary
[R3-rip-1]network 10.0.0.0
[R3-rip-1]network 192.168.3.0
R4
[R4]rip 1
[R4-rip-1]ver 2
[R4-rip-1]un summary
[R4-rip-1]network 10.0.0.0
[R4-rip-1]network 192.168.4.0
当拓扑结构为中心到站点(轴辐状、星型)——不是所有网点均为固定的公有IP、没法所有tunnel设备互相注册,只能通过关闭水平分割来实现路由的全网正常收敛;
[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]undo rip split-horizon
给PC配置IP地址
测试ping通性