L2TP实验(无图后补)
拓扑图
一、搭建拓扑并配置基础 IP 地址
-
设备选型与拓扑搭建:在 eNSP 中,拖入所需设备,包括 LAC(L2TP Access Concentrator,L2TP 接入集中器 )、LNS(L2TP Network Server,L2TP 网络服务器 )、PC 和 Server,按照给定拓扑连接好设备。
-
配置 IP 地址
-
PC1:进入 PC1 的配置界面,设置 IP 地址为
10.1.1.2/24
,默认网关为10.1.1.1
。 -
LAC:
interface GigabitEthernet 1/0/0 ip address 10.1.1.1 255.255.255.0 interface GigabitEthernet 1/0/1 ip address 20.1.1.1 255.255.255.0
-
LNS:
interface GigabitEthernet 1/0/0 ip address 20.1.1.2 255.255.255.0 interface GigabitEthernet 1/0/1 ip address 192.168.1.1 255.255.255.0
-
Server1:设置 IP 地址为
192.168.1.2/24
,默认网关为192.168.1.1
。
-
二、LNS 配置
-
创建 L2TP 地址池
ip pool l2tp_pool network 172.16.1.0 mask 255.255.255.0 gateway - list 172.16.1.1 quit
-
使能 L2TP 服务器功能
l2tp - server enable
-
配置 L2TP 隧道参数
tunnel name lns_tunnel tunnel password cipher Huawei123 // 设置隧道密码,可自定义强密码 local - ip 20.1.1.2 // LNS 公网侧 IP domain - name l2tp_domain // 自定义域名
-
创建并配置虚拟模板接口
interface Virtual - Template 1 ip address 172.16.1.1 255.255.255.0 l2tp virtual - template remote address pool l2tp_pool ppp authentication - mode chap quit
-
配置认证用户
aaa local - user user1 password cipher user1pass // 创建用户名和密码 local - user user1 service - type ppp quit
三、LAC 配置
-
使能 L2TP 客户端功能
l2tp - client enable
-
配置 L2TP 隧道参数
tunnel name lac_tunnel tunnel password cipher Huawei123 // 与 LNS 隧道密码一致 destination 20.1.1.2 // LNS 公网 IP local - ip 20.1.1.1 // LAC 公网侧 IP domain - name l2tp_domain // 与 LNS 域名一致
-
在接口上关联 L2TP
interface GigabitEthernet 1/0/1 ppp - multilink ppp - multilink group 1 l2tp - client tunnel - name lac_tunnel quit