一、拓扑图
实验要求:
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、搭建拓扑图,划分网段
AR1和AR5之间、AR2和AR5之间以及AR3和AR5之间用serial网线,AR5需要三个串线接口,所以需要添加两个2SA接口卡,AR1和AR2和AR3各添加一个。
2、配置公网部分
华为的ensp默认接口封装是ppp,需要修改ar1和ar5之间以及ar2和ar5之间的认证
R3于R5之间使用HDLC封装
3、R1/R2/R3构建一个MGRE环境,R1为中心站点
(1)创建隧道接口(2)配置IP地址 (3)定义封装方式 (4)定义封装内容 (5)配置NHRP
4、R1、R4间为点到点的GRE:
(1)创建隧道接口 (2)配置IP地址 (3)定义封装方式 (4)定义封装内容
三、配置
R1和R5间使用PPP的PAP认证,R5为主认证方;
r1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r1
[r1]int s4/0/0
[r1-Serial4/0/0]ip add
[r1-Serial4/0/0]ip address 15.1.1.1 24
[r1-Serial4/0/0]q
[r1]
Mar 28 2024 10:55:43-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r1]int s4/0/0
[r1-Serial4/0/0]ppp pap lo
[r1-Serial4/0/0]ppp pap local-user admin password ci
[r1-Serial4/0/0]ppp pap local-user admin password cipher 123456
r5:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r5
[r5]int s3/0/0
[r5-Serial3/0/0]ip add 15.1.1.2 24
[r5-Serial3/0/0]
Mar 28 2024 10:55:44-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial3/0/0 has entered the UP state.
[r5-Serial3/0/0]aaa
[r5-aaa]local-user admin pass
[r5-aaa]local-user admin password ciph
[r5-aaa]local-user admin password cipher 123456
[r5-aaa]local-user admin ser
[r5-aaa]local-user admin service-type ppp
[r5-aaa]q
[r5]int s3/0/0
[r5-Serial3/0/0]ppp au
[r5-Serial3/0/0]ppp authentication-mode pap
测试:
R2于R5之间使用PPP的chap认证,R5为主认证方;
r5:
[r5]int s3/0/1
[r5-Serial3/0/1]ip add 25.1.1.2 24
[r5-Serial3/0/1]ppp au
[r5-Serial3/0/1]ppp authentication-mode chap
[r5-Serial3/0/1]
Mar 28 2024 11:02:06-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol PPP
IPCP on the interface Serial3/0/1 has entered the UP state.
r2:
<r2>sys
Enter system view, return user view with Ctrl+Z.
[r2]int s4/0/0
[r2-Serial4/0/0]ip add 25.1.1.1 24
[r2-Serial4/0/0]
Mar 28 2024 11:02:06-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial4/0/0 has entered the UP state.
[r2-Serial4/0/0]ppp chap user admin
[r2-Serial4/0/0]ppp chap pass
[r2-Serial4/0/0]ppp chap password ci
[r2-Serial4/0/0]ppp chap password cipher 123456
测试:
R3于R5之间使用HDLC封装。
r3:
<r3>sys
Enter system view, return user view with Ctrl+Z.
[r3]int s4/0/0
[r3-Serial4/0/0]ip add 35.1.1.1 24
[r3-Serial4/0/0]link
[r3-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
Mar 28 2024 11:06:57-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.
[r3-Serial4/0/0]
[r3-Serial4/0/0]
Mar 28 2024 11:06:57-08:00 r3 %%01IFPDT/4/IF_STATE(l)[1]:Interface Serial4/0/0 h
as turned into DOWN state.
[r3-Serial4/0/0]
Mar 28 2024 11:06:57-08:00 r3 %%01IFPDT/4/IF_STATE(l)[2]:Interface Serial4/0/0 h
as turned into UP state.
[r3-Serial4/0/0]
Mar 28 2024 11:06:57-08:00 r3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface Serial4/0/0 has entered the UP state.
r5:
[r5-Serial3/0/1]int s4/0/0
[r5-Serial4/0/0]ip add 35.1.1.2 24
[r5-Serial4/0/0]lin
[r5-Serial4/0/0]link-protocol hdlc
Warning: The encapsulation protocol of the link will be changed. Continue? [Y/N]
:y
测试:
R4和R5之间的配置
r4:
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
Mar 28 2024 11:08:46-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
r5:
[r5-Serial4/0/0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
Mar 28 2024 11:08:11-08:00 r5 %%01IFNET/4/LINK_STATE(l)[10]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
添加R5的环回地址
[r5]int lo0
[r5-LoopBack0]ip add 5.5.5.5 24
配置私网部分ip地址
[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
R1/R2/R3构建一个MGRE环境,R1为中心站点
r1:
[r1]int t 0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tu
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 15.1.1.1
Mar 28 2024 11:17:24-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[r1-Tunnel0/0/1]
[r1-Tunnel0/0/1]nhrp entry mu
[r1-Tunnel0/0/1]nhrp entry multicast dy
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp net
[r1-Tunnel0/0/1]nhrp network-id 100
r2:
[r2]int t 0/0/0
[r2-Tunnel0/0/0]ip add 10.1.2.2 24
[r2-Tunnel0/0/0]tu
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]sou
[r2-Tunnel0/0/0]source Se
[r2-Tunnel0/0/0]source Serial 4/0/0
Mar 28 2024 11:20:14-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]
[r2-Tunnel0/0/0]nhrp net
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp en
[r2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 re
[r2-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
r3:
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 10.1.2.3 24
[r3-Tunnel0/0/0]tu
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]so
[r3-Tunnel0/0/0]source s 4/0/0
Mar 28 2024 11:22:09-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]
[r3-Tunnel0/0/0]nhrp en
[r3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 re
[r3-Tunnel0/0/0]nhrp entry 10.1.2.1 15.1.1.1 register
[r3-Tunnel0/0/0]nhrp net
[r3-Tunnel0/0/0]nhrp network-id 100
查看NHRP邻居情况
测试:
R1、R4间为点到点的GRE
[r1]int t 0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tu
[r1-Tunnel0/0/0]tunnel-protocol gre
[r1-Tunnel0/0/0]source 15.1.1.1
[r1-Tunnel0/0/0]de
[r1-Tunnel0/0/0]dest
[r1-Tunnel0/0/0]destination 45.1.1.1
[r4]int t 0/0/0
[r4-Tunnel0/0/0]ip add 10.1.1.2 24
[r4-Tunnel0/0/0]tu
[r4-Tunnel0/0/0]tunnel-protocol gre
[r4-Tunnel0/0/0]sou
[r4-Tunnel0/0/0]source 45.1.1.1
[r4-Tunnel0/0/0]dest
[r4-Tunnel0/0/0]destination 15.1.1.1
测试:
整个私有网络基于RIP全网可达
[r1]rip 1
[r1-rip-1]ve
[r1-rip-1]version 2
[r1-rip-1]net
[r1-rip-1]network 192.168.1.0
[r1-rip-1]network 10.0.0.0
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]network 192.168.2.0
[r2-rip-1]network 10.0.0.0
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 192.168.3.0
[r3-rip-1]network 10.0.0.0
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 192.168.4.0
[r4-rip-1]network 10.0.0.0
使用RIP做MGRE环境,分支只能学到中心的路由,但是没有分支的路由,需要关闭水平分割
[r1-rip-1]int t 0/0/1
[r1-Tunnel0/0/1]undo rip sp
[r1-Tunnel0/0/1]undo rip split-horizon
配置PC
测试:
所有PC设置私有Ip为源IP,可以访问R5环回。
<r1>sys
Enter system view, return user view with Ctrl+Z.
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]int s4/0/0
[r1-Serial4/0/0]nat out
[r1-Serial4/0/0]nat outbound 2000
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255
[r2-acl-basic-2000]int s4/0/0
[r2-Serial4/0/0]nat outbound 2000
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3-acl-basic-2000]int s4/0/0
[r3-Serial4/0/0]nat ou
[r3-Serial4/0/0]nat outbound 2000
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255
[r4-acl-basic-2000]int g0/0/0
[r4-GigabitEthernet0/0/0]nat out
[r4-GigabitEthernet0/0/0]nat outbound 2000