1,R5为ISP,只能进行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环回。
步骤
配置IP
R1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]int s 4/0/0
[r1-Serial4/0/0]ip address 15.1.1.1 24
R2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[r2]int s 4/0/0
[r2-Serial4/0/0]ip address 25.1.1.1 24
R3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[r3]int s 4/0/0
[r3-Serial4/0/0]ip address 35.1.1.1 24
R4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip address 45.1.1.1 24
[r4]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
R5
[r5]int s 3/0/0
[r5-Serial3/0/0]ip address 15.1.1.2 24
[r5]int s 3/0/1
[r5-Serial3/0/1]ip address 25.1.1.2 24
[r5]int s 4/0/0
[r5-Serial4/0/0]ip address 35.1.1.2 24
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[r5]int l 0
[r5-LoopBack0]ip address 5.5.5.5 24
缺省
[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
NAT
R1 R2 R3一样
[r1]acl 2000
[r1-acl-basic-2000]rule 1 permit source any
[r1]int s 4/0/0
[r1-Serial4/0/0]nat outbound 2000
R4
[r4]acl 2000
[r4-acl-basic-2000]rule 1 permit source any
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
PC1测5.5.5.5
PAP认证
主认证方
[r5]aaa
[r5-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[r5-aaa]local-user huawei service-type ppp
[r5-aaa]q
[r5]int s 3/0/0
[r5-Serial3/0/0]ppp authentication-mode pap
[r5-Serial3/0/0]ppp authentication-mode pap
被认证方
[r1]int s 4/0/0
[r1-Serial4/0/0]ppp pap local-user huawei password cipher huawei
CHAP认证
主认证方
[r5]aaa
[r5-aaa]local-user huawei password cipher huawei
Info: Add a new user.
[r5-aaa]local-user huawei service-type ppp
[r5]int s 3/0/1
[r5-Serial3/0/1]ppp authentication-mode chap
被认证方
[r2]int s 4/0/0
[r2-Serial4/0/0]ppp chap user huawei
[r2-Serial4/0/0]ppp chap password cipher huawei
HDLC封装
[r3]int s 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
[r5]int s 4/0/0
[r5-Serial4/0/0]link-protocol hdlc
R1R2R3构建MGRE
中心
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip address 10.1.1.1 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]int t 0/0/0
[r2-Tunnel0/0/0]ip address 10.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
[r2-Tunnel0/0/0]nhrp network-id 100
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source s 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 register
R1R4配置GRE
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip address 20.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
[r4]int t 0/0/1
[r4-Tunnel0/0/1]ip address 20.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
RIP全网可达
MGRE
[r1]rip
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r1]int t 0/0/0
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 开启伪广播
[r1-Tunnel0/0/0]undo rip split-horizon 关闭接口的水平分割
[r2]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
GRE
[r1]rip 1
[r1-rip-1]version 2
[r1-rip-1]network 192.168.1.0
Error: The specified network already exists in the process.
[r1-rip-1]network 20.0.0.0
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 20.0.0.0
ping