一、实验要求
1、R5为ISP,只能进行IP地址配置;其所有接口配置为共有IP地址
2、R1和R5间使用PPP的PAP认证,R5为主认证方;R2和R5间使用PPP的CHAP认证,R5为主认证方;R3与R5间使用HDLC封装
3、R1/2/3构建一个MGRE环境,R1为中心站点;R1/4间为点到点GRE
4、整个私有网络基于RIP全网可达
5、所有路由器基于环回私有地址为源IP时,可以正常访问R5环回
6、R1-4以环回为源ip地址可以访问R5环回,因为华为边界路由器的环回为源ip地址时走不了nat,所以不能实验,因此实验拓扑中R1-4的环回全部改成连接一台PC;最终让PC可以访问R5环回即可
二、实验拓扑
三、实验步骤
1、配置IP地址
R1:
192.168.1.0/24
15.1.1.0/24
R2
192.168.2.0/24
25.1.1.0/24
R3
192.168.3.0/24
35.1.1.0/24
R4
192.168.4.0/24
45.1.1.0/24
2、R1和R5间使用PPP的PAP认证,R5为主认证方
R5:
[r5]aaa
[r5-aaa]local-user huawei password cipher xinxin
Info: Add a new user.
[r5-aaa]local-user huawei service-type PPP
[r5-aaa]int s4/0/0
[r5-Serial4/0/0]link-protocol ppp
[r5-Serial4/0/0]ppp authentication-mode pap
R1:
[r1]int s4/0/0
[r1-Serial4/0/0]link-protocol ppp
[r1-Serial4/0/0]ppp pap local-user huawei
[r1-Serial4/0/0]ppp pap local-user huawei password cipher xinxin
3、R2和R5间使用PPP的CHAP认证,R5为主认证方
R5:
[r5-aaa]int s4/0/1
[r5-Serial4/0/1]link-protocol ppp
[r5-Serial4/0/1]ppp authentication-mode chap
R2:
[r2]int s4/0/1
[r2-Serial4/0/1]link-protocol ppp
[r2-Serial4/0/1]ppp chap user piupiu
[r2-Serial4/0/1]ppp chap password cipher xinxin
4、R3与R5间使用HDLC封装
R5:
[r5]int s3/0/0
[r5-Serial3/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
5、配置缺省
[r1]ip route-static 0.0.0.0 0 15.1.1.1
[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
6、R1、R2、R3、R4做nat
R1:
[r1]acl 2000
[r1-acl-basic-2000]rule 5 permit source 192.168.1.0 0.0.0.255
R2:
[r2]acl 2000
[r2-acl-basic-2000]rule 5 permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s4/0/1
[r2-Serial4/0/1]nat outbound 2000
R3:
[r3]acl 2000
[r3-acl-basic-2000]rule 5 permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]q
[r3]int s4/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-acl-basic-2000]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000
7、R1/2/3构建一个MGRE环境,R1为中心站点
R1:
[r1]int t0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 255.255.255.0
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]dis nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
10.1.1.2 32 25.1.1.2 10.1.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:02:22
Expire time : 01:57:38
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
10.1.1.3 32 35.1.1.2 10.1.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:00:31
Expire time : 01:59:29
Number of nhrp peers: 2
R2:
[r2]int t0/0/0
[r2-Tunnel0/0/0]ip add 10.1.1.2 255.255.255.0
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]so
[r2-Tunnel0/0/0]source s4/0/1
Oct 2 2020 01:29:38-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 re
R3:
[r3]interface Tunnel0/0/0
[r3-Tunnel0/0/0]ip address 10.1.1.3 255.255.255.0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source Serial4/0/0
Oct 2 2020 01:33:06-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]nhrp entry 10.1.1.1 15.1.1.1 reg
8、R1/4间为点到点GRE
R1
[r1]int Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 10.2.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.2
Oct 2 2020 01:35:06-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
R4
[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip address 10.2.2.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre
[r4-Tunnel0/0/1]source 45.1.1.2
[r4-Tunnel0/0/1]destination 15.1.1.1
Oct 2 2020 01:37:06-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
9、整个私有网络基于RIP全网可达
R1
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]net 192.168.1.0
[r1-rip-1]net 10.0.0.0
R2
[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
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
R4
[r4]rip 1
[r4-rip-1]version 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
10、打破水平分割
R1
[r1-Tunnel0/0/0]undo rip split-horizon