先配置IP
建立pap认证r1到r5,r5为主认证方
[r5]local-user huazhu password cipher 123456
[r5]local-user huazhu service-type ppp
[r5-Serial4/0/0]ppp authentication-mode pap
[r1-Serial4/0/0]ppp pap local-user huazhu password cipher 123456
r2到r5建立chap认证,r5为主认证方式
[r5]local-user huazhu password cipher 123456
[r5-aaa]local-user huazhu service-type ppp
[r5-Serial4/0/0]ppp authentication-mode chap
[r1-Serial4/0/0]ppp chap password
[r1-Serial4/0/0]ppp chap user
r3到r5使用HOLC封装
建立一个MGRE环境,r1为中心站点,r1到r4为点到点的gre
创建隧道接口,配置IP地址
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 192.168.5.1 24
定义隧道封装协议
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
定义封装内容
[r5-Tunnel0/0/0]source 15.0.0.1
[r5-Tunnel0/0/0]nhrp network-id 100
配置分支
创建隧道接口,配置IP地址
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.2 24
定义隧道封装协议
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
source GigabitEthernet0/0/0
定义封装内容
[r1·-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.2 register
对r2和·r3进行相同配置
整个私有网基于rip全网可达
路由器ip地址在前面已经配置完成
接下来需要在路由器上分别配置rip协议
<Huawei>sys
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]rip 1
[Huawei-rip-1]version 2
[Huawei-rip-1]netwo
[Huawei-rip-1]network 192.168.1.0
[Huawei-rip-1]network 192.168.2.0
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]rip 1
[Huawei-rip-1]version 2
[Huawei-rip-1]netwo
[Huawei-rip-1]network 192.168.1.0
[Huawei-rip-1]network 192.168.2.0
..........
在其他路由器上进行完不同网段的配置后
在任意pc上ping其他pc看是否全网可达,rip协议是否配置成功