配置如下:
第一步:配置IP
R1
[r1-Serial4/0/0]ip add 15.0.0.1 24
[r1-Serial4/0/0]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24R2
[r2-Serial4/0/0]ip add 25.0.0.1 24
[r2-Serial4/0/0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.1 24R3
[r3-GigabitEthernet0/0/0]ip add 192.168.3.1 24
[r3-GigabitEthernet0/0/0]int s 4/0/0
[r3-Serial4/0/0]ip add 35.0.0.1 24R4
[r4-GigabitEthernet0/0/1]ip add 192.168.4.1 24
[r4-GigabitEthernet0/0/0]ip add 45.0.0.1 24
R5
[r5]int s3/0/0
[r5-Serial3/0/0]ip add 15.0.0.2 24[r5]int s 3/0/1
[r5-Serial3/0/1]ip add 25.0.0.2 24[r5-Serial3/0/1]int s 4/0/0
[r5-Serial4/0/0]ip add 35.0.0.2 24[r5-Serial4/0/0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.0.0.2 24[r5-GigabitEthernet0/0/0]int l0
[r5-LoopBack0]ip add 5.5.5.5 24
第二步:给所有边界设备配置缺省 --- 此时所有设备均可ping通
R1
[r1]ip route-static 0.0.0.0 0 15.0.0.2
R2
[r2]ip route-static 0.0.0.0 0 25.0.0.2
R3
[r3]ip route-static 0.0.0.0 0 35.0.0.2
R4
[r4]ip route-static 0.0.0.0 0 45.0.0.2
R5
第三步:R1-5 PAP R2-5 PPP CHAP R3-5 HDLC封装 R5均为主
R1 - R5:
此时R1已经是PPP,直接认证即可
R5
[r5]aaa -1
[r5-aaa]local-user admin password cipher 123456
[r5-aaa]local-user admin service-type ppp
[r5-Serial3/0/0]ppp authentication-mode pap
R1
[r1]int s 4/0/0
[r1-Serial4/0/0]ppp pap local-user admin password cipher 123456
R2-R5:
R5
此时aaa已经在R1-5运行过,不需要在配置
[r5-Serial3/0/1]ppp authentication-mode chap
R2
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap password cipher 123456
R3-R5:
R3
[r3-Serial4/0/0]link-protocol hdlc 选择链路协议hdlc
R5
[r5-Serial4/0/0]link-protocol hdlc 二者必须都修改封装方式
第四步:R1-2-3搭建一个MGRE,R1为中心,
R1 中心
[r1]interface t 0/0/0 ---创建隧道接口
[r1-Tunnel0/0/0]ip add 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp --定义封装类型
[r1-Tunnel0/0/0]source 15.0.0.1 ---封装内容,源IP
[r1-Tunnel0/0/0]nhrp network-id 100 创建nhrp域[r1-Tunnel0/0/0]nhrp entry multicast dynamic --- 开启伪广播
R2 分支
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 192.168.5.2 24[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source s4/0/0 --- 写出接口,防止IP改变
[r2-Tunnel0/0/0]nhrp network-id 100 ---和上对得上
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register 分支找中心 中心的隧道IP和RIP
R2信息到!
R3
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 192.168.5.3 24[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R3信息到!
R1-R4为点到点GRE
R1
[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.0.0.1
[r1-Tunnel0/0/1]description 45.0.0.1R4
[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.0.0.1
[r4-Tunnel0/0/0]destination 15.0.0.1
RIP全网可达
R1
[r1]rip
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 192.168.5.0
[r1-rip-1]network 192.168.6.0R2
[r2]rip
[r2-rip-1]v 2
[r2-rip-1]net 192.168.5.0
[r2-rip-1]network 192.168.2.0R3
[r3]rip
[r3-rip-1]v 2
[r3-rip-1]net 192.168.3.0
[r3-rip-1]network 192.168.5.0R4
[r4]rip
[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]undo rip split-horizon关闭水平分割,全网可达,路由表信息全了
display ip routing-table protocol rip 查看rip路由表