一、实验拓扑图
二、实验要求
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环回
三、实验步骤
1. R5为ISP,只能进行IP地址配置;其所有地址均为公有IP地址
配置IP
R1:
[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]ip address 15.0.0.1 8
R2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ip address 25.0.0.1 8
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
R3:
<Huawei>sys
[Huawei]sys r3
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]ip address 35.0.0.1 8
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
R4:
<Huawei>sys
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]ip address 45.0.0.1 8
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.4.1 24
R5:
<Huawei>sys
[Huawei]sys r5
[r5]interface Serial 3/0/0
[r5-Serial3/0/0]ip address 15.0.0.2 8
[r5]interface Serial 3/0/1
[r5-Serial3/0/1]ip address 25.0.0.2 8
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]ip address 35.0.0.2 8
[r5]interface GigabitEthernet 0/0/0
[r5-GigabitEthernet0/0/0]ip address 45.0.0.2 8
2. R1和R5间使用PPP的PAP认证,R5为主认证方;
R2与R5之间使用PPP的chap认证,R5为主认证方;
R3与R5之间使用HDLC封装。
R1和R5间使用PPP的PAP认证,R5为主认证方;
R5(主认证方):
[r5]aaa
[r5-aaa]local-user lv password cipher 123456
Info: Add a new user.
[r5-aaa]local-user lv service-type ppp
[r5-aaa]q
[r5]interface Serial 3/0/0
[r5-Serial3/0/0]ppp authentication-mode pap
[r5-Serial3/0/0] shutdown 断开接口连接
[r5-Serial3/0/0]undo shutdown 重新连接接口
R1(被认证方):
[r1-Serial4/0/0]ppp pap local-user lv password cipher 123456
[r5-Serial3/0/0] shutdown 断开接口连接
[r5-Serial3/0/0]undo shutdown 重新连接接口
R2与R5之间使用PPP的chap认证,R5为主认证方;
R5(主认证方):
[r5]aaa
[r5-aaa]local-user feng password cipher 111111
Info: Add a new user.
[r5-aaa]local-user feng service-type ppp
[r5-aaa]q
[r5]interface Serial 3/0/0
[r5-Serial3/0/1]ppp authentication-mode chap
[r5-Serial3/0/0] shutdown 断开接口连接
[r5-Serial3/0/0]undo shutdown 重新连接接口
R2(被认证方):
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]ppp chap user feng
[r2-Serial4/0/0]ppp chap password cipher 111111
R3与R5之间使用HDLC封装。
R3:
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Jul 8 2024 13:23:43-08:00 r3 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
the configuration that will change the encapsulation protocol of the link and th
en selected Y.
R5 :
[r5]interface Serial 4/0/0
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Jul 8 2024 13:25:54-08:00 r5 %%01IFNET/4/CHANGE_ENCAP(l)[0]:The user performed
the configuration that will change the encapsulation protocol of the link and th
en selected Y.
3. R1/R2/R3构建一个MGRE环境,R1为中心站点;R1、R4间为点到点的GRE。
MGRE环境:
R1:
[r1]ip route-static 0.0.0.0 0 15.0.0.2
r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip address 192.168.5.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.0.0.1
[r1-Tunnel0/0/0]nhrp network-id 100
R2:
[r2]ip route-static 0.0.0.0 0 25.0.0.2
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]ip address 192.168.5.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 25.0.0.1
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
R3:
[r3]ip route-static 0.0.0.0 0 35.0.0.2
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip address 192.168.5.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 35.0.0.1
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
GRE环境:
R1:
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 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]destination 45.0.0.1
R4:
[r4]ip route-static 0.0.0.0 0 45.0.0.2
[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1]ip address 192.168.6.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.0.0.1
[r4-Tunnel0/0/1]destination 15.0.0.1
4. 整个私有网络基于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.0
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]undo rip split-horizon
R2:
[r2]rip
[r2-rip-1]version 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 192.168.5.0
[r2]interface Tunnel 0/0/0
[r2-Tunnel0/0/0]undo rip split-horizon
R3:
[r3]rip
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 192.168.5.0
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]undo rip split-horizon
R4:
[r4]rip
[r4-rip-1]version 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 192.168.6.0
[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1]undo rip split-horizon
5. 所有PC设置私有IP为源IP,可以访问R5环回
R1:
[r1]acl 2000
[r1-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
[r1]interface Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000
R2:
[r2]acl 2000
[r2-acl-basic-2000]rule 5 permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]q
[r2]interface Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000
R3:
[r3]acl 2000
[r3-acl-basic-2000]rule 5 permit source 192.168.3.0 0.0.0.255
[r3]interface Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
R4:
[r4]acl 2000
[r4-acl-basic-2000]rule 5 permit source 192.168.4.0 0.0.0.255
[r4]interface GigabitEthernet 0/0/1
[r4-GigabitEthernet0/0/1]nat outbound 2000