要求:
1、r5为isp,只能进行ip地址的配置,其所有ip地址均为共有ip地址
2、r1和r5使用ppp的PAP认证,r5为主认证方
r2和r5之间使用ppp的chap认证,r5为主认证方
r3和r5之间使用HDLC封装
3、r1 r2 r3构建一个MGRE环境,r1为中心站点,r1 r4间为点到点的gre
4、整个私有网络基于rip全网可达
5、所有pc设置私有ip为源ip,可以访问r5环回
实验拓补图:
1、配置ip
r1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int s4/0/0
[R1-Serial4/0/0]ip address 15.1.1.1 24
r2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int s4/0/0
[R2-Serial4/0/0]ip address 25.1.1.2 24
r3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip address 35.1.1.3 24
r4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 45.1.1.4 24
r5
[ISP]int s3/0/0
[ISP-Serial3/0/0]ip address 15.1.1.5 24
[ISP-Serial3/0/0]int s3/0/1
[ISP-Serial3/0/1]ip address 25.1.1.5 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip address 35.1.1.5 24
[ISP-Serial4/0/0]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 45.1.1.5 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip address 5.5.5.5 24
配置缺省路由:
[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
2、配置nat
r1
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1]int Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
r2
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2]int Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000
r3
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3]int Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
r4
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
3、r1和r5之间pap认证
r5为主认证
[ISP]aaa
[ISP-aaa]local-user huawei password cipher 1234 privilege level 15
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap
r1为被认证方
R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user huawei password cipher 123
4、r2和r5之间为chap认证
r5主
[ISP]aaa
[ISP-aaa]local-user huawei password cipher 123 privilege level 15
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap
r2
[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user huawei
[R2-Serial4/0/0]ppp chap password cipher 123
5、r3和r5dhlc封装
r5
[ISP]int s4/0/0
[ISP-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]:y
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
6、r1、2、3之间构建mgre环境
r1为中心站点
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.2.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.1.1.2
[R1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
r2分站点
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip address 10.1.2.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source Serial 4/0/0
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
r3分站点
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 10.1.2.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 10.1.2.1 15.1.1.1 register
7、r1和r4构建gre环境
r1
[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 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
[R4]int Tunnel 0/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
8、配置rip
mgre环境
r1
[R1]rip 1
[R1-rip-1]undo summary
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
r2
[R2]rip 1
[R2-rip-1]undo summary
[R2-rip-1]version 2
[R2-rip-1]network 192.168.2.0
[R2-rip-1]network 10.0.0.0
r3
[R3]rip 1
[R3-rip-1]undo summary
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0
[R3-rip-1]network 10.0.0.0
gre环境
r1
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip add 10.1.1.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
[R1]rip 1
[R1-rip-1]undo summary
[R1-rip-1]version 2
[R1-rip-1]network 10.0.0.0
r4
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip add 10.1.1.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.1
[r4-Tunnel0/0/1]destination 15.1.1.1
[R4]rip 1
[R4-rip-1]undo summary
[R4-rip-1]version 2
[R4-rip-1]network 10.0.0.0
[R4-rip-1]network 192.168.4.0
最后进行测试: