一、实验要求
二、分析:
所有的PC机可以通过私网地址访问R5,全网可达,r1-r5使用PAP认证,r2-r5使用PPP的CHAP认证,r3-r5使用HDLC认证,之间需要使用RIP协议获得的位置网段的信息,因为MGRE只能让中心站点收到各节点的数据,但是却不能发送数据包到各个节点,这里不能使用OSPF协议。
三、配置:
1.先给每一个设备更改名字,以r1为例:
[Huawei]sy r1
[r1]
2.给路由器配置IP地址,以r1为例
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[r1]interface s4/0/0
[r1-Serial4/0/0]ip address 15.0.0.1 24
3.给isp作pap认证和chap认证
[isp]aaa
[isp-aaa]local-user r1 password cipher 123
[isp-aaa]local-user r1 service-type ppp
[isp-Serial3/0/0]ppp authentication-mode pap
[isp]aaa
[isp-aaa]local-user r2 password cipher 123
[isp-aaa]local-user r2 service-type ppp
[isp]int Serial 3/0/1
[isp-Serial3/0/1]ppp authentication-mode chap
4. 更改R3-s4/0/0接口和ISP的S4/0/0模式为HDLC
[r3-Serial4/0/0]link-protocol hdlc
[isp-Serial4/0/0]link-protocol hdlc
5.配置r1中心站点,r2、r3分站点
[r1]int t0/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
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r2]int t0/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 Serial 4/0/0
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
[r3]int t0/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 Serial 4/0/0
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.5.1 15.0.0.1 register
6.配置r1位中心站点,r4位节点的点到点gre
[r1]int t0/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]int t0/0/0
[r4-Tunnel0/0/0]ip address 192.168.6.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre
[r4-Tunnel0/0/0]source 45.0.0.1
[r4-Tunnel0/0/0]destination 15.0.0.1
7.启动rip,以r1为例
[r1]rip 1
[r1-rip-1]v 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-Tunnel0/0/0]undo rip split-horizon
四、测试
r1上进行pap测试
[r1]int s4/0/0
[r1-Serial4/0/0]ppp pap local-user r1 password cipher 123
[r1-Serial4/0/0]shutdown
[r1-Serial4/0/0]undo shutdown
[r1-Serial4/0/0]ping 15.0.0.2
PING 15.0.0.2: 56 data bytes, press CTRL_C to break
Reply from 15.0.0.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 15.0.0.2: bytes=56 Sequence=2 ttl=255 time=40 ms
Reply from 15.0.0.2: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 15.0.0.2: bytes=56 Sequence=4 ttl=255 time=20 ms
r2上进行chap认证
[r2-Serial4/0/0]shutdown
[r2-Serial4/0/0]undo shutdown
[r2-Serial4/0/0]ping 25.0.0.2
PING 25.0.0.2: 56 data bytes, press CTRL_C to break
Reply from 25.0.0.2: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 25.0.0.2: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 25.0.0.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 25.0.0.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 25.0.0.2: bytes=56 Sequence=5 ttl=255 time=10 ms
r3上进行hdlc认证
[r3]ping 35.0.0.2
PING 35.0.0.2: 56 data bytes, press CTRL_C to break
Reply from 35.0.0.2: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 35.0.0.2: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 35.0.0.2: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 35.0.0.2: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 35.0.0.2: bytes=56 Sequence=5 ttl=255 time=10 ms
r1中心站点查看r2、r3节点注册信息
[r1]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.5.2 32 25.0.0.1 192.168.5.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:04:19
Expire time : 01:55:41
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.5.3 32 35.0.0.1 192.168.5.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:01:33
Expire time : 01:58:27
Number of nhrp peers: 2
r1的路由表
[r1]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 3 Routes : 3
RIP routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.2.0/24 RIP 100 1 D 192.168.5.2 Tunnel0/0/0
192.168.3.0/24 RIP 100 1 D 192.168.5.3 Tunnel0/0/0
192.168.4.0/24 RIP 100 1 D 192.168.6.2 Tunnel0/0/1