vpn综合实验

本文详细描述了一个实验性的网络配置过程,涉及ISP设备的IP配置、PPP/PAP/CHAP认证、HDLC封装、MGRE/GRE隧道以及RIP路由协议的配置,还包含了NAT和私有IP的使用,旨在实现全网可达并确保网络安全

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

要求:

1、r5为isp,只能进行ip地址的配置,其所有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、配置ip

r1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int s4/0/0
[R1-Serial4/0/0]ip address 15.1.1.1 24

r2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int s4/0/0
[R2-Serial4/0/0]ip address 25.1.1.2 24

r3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip address 35.1.1.3 24

r4
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.4.1 24
[R4-GigabitEthernet0/0/1]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 45.1.1.4 24

r5
[ISP]int s3/0/0 
[ISP-Serial3/0/0]ip address 15.1.1.5 24
[ISP-Serial3/0/0]int s3/0/1
[ISP-Serial3/0/1]ip address 25.1.1.5 24
[ISP-Serial3/0/1]int s4/0/0
[ISP-Serial4/0/0]ip address 35.1.1.5 24
[ISP-Serial4/0/0]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip address 45.1.1.5 24
[ISP-GigabitEthernet0/0/0]int l0
[ISP-LoopBack0]ip address 5.5.5.5 24


配置缺省路由:

[R1]IP route-static 0.0.0.0 0 15.1.1.5
 
[R2]IP route-static 0.0.0.0 0 25.1.1.5
 
[R3]IP route-static 0.0.0.0 0 35.1.1.5
 
[R4]IP route-static 0.0.0.0 0 45.1.1.5

2、配置nat

r1

[r1]acl 2000
[r1-acl-basic-2000]rule  permit source 192.168.1.0 0.0.0.255
[r1]int Serial 4/0/0
[r1-Serial4/0/0]nat outbound 2000

r2

[r2]acl 2000
[r2-acl-basic-2000]rule permit source 192.168.2.0 0.0.0.255     
[r2]int Serial 4/0/0
[r2-Serial4/0/0]nat outbound 2000

r3

[r3]acl 2000    
[r3-acl-basic-2000]rule permit source 192.168.3.0 0.0.0.255
[r3]int Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000

r4

[r4]acl 2000    
[r4-acl-basic-2000]rule permit source 192.168.4.0 0.0.0.255    
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]nat outbound 2000

3、r1和r5之间pap认证

r5为主认证

[ISP]aaa
[ISP-aaa]local-user huawei password cipher 1234  privilege level 15
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/0
[ISP-Serial3/0/0]ppp authentication-mode pap 

r1为被认证方

R1]int s4/0/0
[R1-Serial4/0/0]ppp pap local-user huawei password cipher 123

4、r2和r5之间为chap认证

r5主

[ISP]aaa
[ISP-aaa]local-user huawei password cipher 123 privilege level 15
[ISP-aaa]local-user huawei service-type ppp
[ISP-aaa]q
[ISP]int s3/0/1
[ISP-Serial3/0/1]ppp authentication-mode chap

r2

[R2]int s4/0/0
[R2-Serial4/0/0]ppp chap user huawei
[R2-Serial4/0/0]ppp chap password cipher 123

5、r3和r5dhlc封装

r5

[ISP]int s4/0/0
[ISP-Serial4/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

6、r1、2、3之间构建mgre环境

r1为中心站点

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]ip address 10.1.2.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 15.1.1.2
[R1-Tunnel0/0/0]nhrp network-id 100
[r1-Tunnel0/0/0]nhrp entry multicast dynamic

r2分站点

[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]ip address 10.1.2.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 10.1.2.1 15.1.1.1 register

r3分站点

[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip address 10.1.2.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 10.1.2.1 15.1.1.1 register

7、r1和r4构建gre环境

r1

[R1]int Tunnel 0/0/1
[R1-Tunnel0/0/1]ip address 10.1.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.4

r4

[R4]int Tunnel 0/0/1
[R4-Tunnel0/0/1]ip address 10.1.2.2 24
[R4-Tunnel0/0/1]tunnel-protocol gre
[R4-Tunnel0/0/1]source 45.1.1.4
[R4-Tunnel0/0/1]destination 15.1.1.1

8、配置rip

mgre环境

r1

[R1]rip 1
[R1-rip-1]undo summary
[R1-rip-1]version 2
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0

[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]undo rip split-horizon
[R1-Tunnel0/0/0]nhrp entry multicast dynamic

r2

[R2]rip 1
[R2-rip-1]undo summary
[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]undo summary
[R3-rip-1]version 2
[R3-rip-1]network 192.168.3.0 
[R3-rip-1]network 10.0.0.0

gre环境

r1

[r1]interface Tunnel 0/0/1            
[r1-Tunnel0/0/1]ip add 10.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    
[R1]rip 1
[R1-rip-1]undo summary
[R1-rip-1]version 2
[R1-rip-1]network 10.0.0.0

r4

[r4]int Tunnel 0/0/1
[r4-Tunnel0/0/1]ip add 10.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
[R4]rip 1
[R4-rip-1]undo summary
[R4-rip-1]version 2
[R4-rip-1]network 10.0.0.0
[R4-rip-1]network 192.168.4.0

最后进行测试:

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值