目录
配置IP地址
[r1]int s4/0/0
[r1-Serial4/0/0]ip add 15.1.1.1 24
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[r2]int s4/0/0
[r2-Serial4/0/0]ip add 25.1.1.1 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.1 24
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[isp]int s3/0/0
[isp-Serial3/0/0]ip add 15.1.1.2 24
[isp]int s3/0/1
[isp-Serial3/0/1]ip add 25.1.1.2 24
[isp]int s4/0/0
[isp-Serial4/0/0]ip add 35.1.1.2 24
[isp]int g0/0/0
[isp-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[isp]int lo0
[isp-LoopBack0]ip add 5.5.5.5 24
进行PAP认证
[isp]aaa
[isp-aaa]local-user sss password cipher 123456
[isp-aaa]local-user sss service-type ppp
[isp]int s3/0/0
[isp-Serial3/0/0]ppp authentication-mode pap
[r1]int s4/0/0
[r1-Serial4/0/0]ppp pap local-user sss password cipher 123456
进行CHAP认证
[isp]aaa
[isp-aaa]local-user aaa password cipher 123456
[isp-aaa]local-user aaa service-type ppp
[isp]int s3/0/1
[isp-Serial3/0/1]ppp authentication-mode chap
[r2]int s4/0/0
[r2-Serial4/0/0]ppp chap user aaa
[r2-Serial4/0/0]ppp chap password cipher 123456
进行HDLC封装
[r3]display interface s4/0/0
[isp]display interface Serial4/0/0
[isp-Serial4/0/0]link-protocol hdlc
[r3-Serial4/0/0]link-protocol hdlc
构建MGRE环境
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r2]int t0/0/0
[r2-Tunnel0/0/0]ip add 192.168.5.2 24
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 192.168.5.3 24
[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
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 25.1.1.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.1.1.1 register
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 35.1.1.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.1.1.1 register
配置缺省路由
[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
构建GRE环境
[r1]int t0/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.1.1.1
[r1-Tunnel0/0/1]destination 45.1.1.1
[r4]int t0/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.1.1.1
[r4-Tunnel0/0/0]destination 15.1.1.1
配置缺省路由
[r4]ip route-static 0.0.0.0 0 45.1.1.2
RIP的配置
[r1]rip 1
[r1-rip-1]v 2
[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 1
[r2-rip-1]v 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r3]rip 1
[r3-rip-1]v 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[r4]rip 1
[r4-rip-1]v 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0
查看R1获取到的路由信息
在中心开启伪广播
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
关闭水平分割
[r1-Tunnel0/0/0]undo rip split-horizon
测试通路
访问R5环回
配置缺省路由
[isp]ip route-static 0.0.0.0 0 15.1.1.1
[isp]ip route-static 0.0.0.0 0 25.1.1.1
[isp]ip route-static 0.0.0.0 0 35.1.1.1
[isp]ip route-static 0.0.0.0 0 45.1.1.1