拓撲圖
一、搭建拓撲并配置基礎 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/0ip address 10.1.1.1 255.255.255.0 interface GigabitEthernet 1/0/1ip address 20.1.1.1 255.255.255.0
-
LNS:
interface GigabitEthernet 1/0/0ip address 20.1.1.2 255.255.255.0 interface GigabitEthernet 1/0/1ip 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_poolnetwork 172.16.1.0 mask 255.255.255.0gateway - 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 1ip address 172.16.1.1 255.255.255.0l2tp virtual - templateremote address pool l2tp_poolppp authentication - mode chap quit
-
配置認證用戶
aaalocal - 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/1ppp - multilinkppp - multilink group 1l2tp - client tunnel - name lac_tunnel quit