锐捷L2TP-VPN多分支配置实操

前言

L2TP-VPN锐捷官方理论笔记

这是锐捷L2TP配置要求和方案,下面是具体的拓扑与配置。EG1和EG2作为L2TP会话中的发起者LAC,R2作为L2TP会话的接受者LNS。

配置实例

拓扑与要求

​ 下图是一个多分支L2TP VPN,接口IP如下图所示。

​ L2TP启用隧道验证用户名密码均为Test@123,L2TP隧道密码为Test@123。L2TP用户地址池为172.16.0.1-172.16.0.254,服务端L2TP隧道接口引用本地Loopback 1接口地址。

设备配置

LNS-R2

1
2
3
4
5
R2(config)#vpdn enable
//VPDN(Virtual Private Dial - up Networks) 虚拟专用拨号网,是VPN业务中的一种;
//是基于拨号用户的虚拟专用拨号网业务;
//是利用IP网络的承载功能,结合相应的认证和授权机制建立起来的安全的虚拟专用网;
//VPDN主要有两种:PPTP和L2TP

点击并拖拽以移动

1
2
3
4
5
6
7
8
9
10
R2(config)#vpdn-group 1
R2(config-vpdn)#accept-dialin //VPDN accept-dialin group configuration
R2(config-vpdn-acc-in)#protocol l2tp //配置L2TP协议
R2(config-vpdn-acc-in)#virtual-template 1 //绑定虚拟拨号接口
R2(config-vpdn-acc-in)#ex
R2(config-vpdn)#l2tp tunnel authentication //隧道认证
R2(config-vpdn)#l2tp tunnel password Test@123 //隧道密码
/在LNS上配置了隧道认证和密码后,必须在L2TP客户端上也配置隧道认证和相同的密码
//否则L2TP无法协商成功。
R2(config-vpdn)#ex

点击并拖拽以移动

1
2
3
4
5
R2(config)#ip local pool l2tp 172.16.0.1 172.16.0.254 
//配置L2TP的地址池
% Invalid address range!
R2(config)#username Test@123 password Test@123
//配置L2TP使用的服务端本地用户

点击并拖拽以移动

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
R2(config)#interface virtual-template 1 
R2(config-if-Virtual-Template 1)#ppp authentication ?
chap Challenge Handshake Authentication Protocol (CHAP)
ms-chap Microsoft Challenge Handshake Authentication Protocol (MS-CHAP)
ms-chap-v2 Microsoft CHAP Version 2 (MS-CHAP-V2)
pap Password Authentication Protocol (PAP)
R2(config-if-Virtual-Template 1)#ppp authentication pap chap
//pap密码认证,chap握手认证;
//这里我们优先使用密码认证,也支持握手认证

R2(config-if-Virtual-Template 1)#ip unnumbered loopback 1
//virtual-template接口绑定loopback 1的IP
R2(config-if-Virtual-Template 1)#peer default ip address pool l2tp
//L2TP邻居的地址池
R2(config-if-Virtual-Template 1)#end

点击并拖拽以移动

LAC-EG1

1
2
3
4
GW1(config)#l2tp-class l2tp
GW1(config-l2tp-class)#authentication
GW1(config-l2tp-class)#password Test@123
//在l2TP客户端上配置的隧道认证密码必须与服务器上的相同,否则L2TP无法协商成功;

点击并拖拽以移动

1
2
3
4
5
GW1(config)#pseudowire-class l2tp
GW1(config-pw-class)#encapsulation l2tpv2
GW1(config-pw-class)#protocol l2tpv2 l2tp
GW1(config-pw-class)#ip local interface gigabitEthernet 0/0
//配置指定L2TP隧道协商的源地址,该地址为外网口

点击并拖拽以移动

1
2
3
4
GW1(config)#int virtual-ppp 1
GW1(config-if-Virtual-ppp 1)#ip address 172.16.0.3 255.255.255.0
GW1(config-if-Virtual-ppp 1)#pseudowire 12.1.1.2 1 pw-class l2tp
GW1(config-if-Virtual-ppp 1)#end

点击并拖拽以移动