L2TP 实现分之间互联

实验拓扑
在这里插入图片描述
R1 配置

R1 充当LNS
配置
 sysname r1

 l2tp enable   //开启L2tp 

ip pool h   //配置L2tp 分配的地址
 network 172.16.0.0 mask 255.255.255.0 

aaa     //配置认证用户
 local-user test password cipher test
 local-user test service-type ppp


interface Virtual-Template0   //创建虚拟接口模板
 ppp authentication-mode chap   //认证模式chap
 remote address pool h    //为客户端分配地址池中地址
 ip address 172.16.0.1 255.255.255.0   //本地地址

interface GigabitEthernet0/0/0
 ip address 12.0.0.1 255.255.255.0 


interface LoopBack0
 ip address 1.1.1.1 255.255.255.255 

l2tp-group 1
 undo tunnel authentication  //关闭隧道认证
 allow l2tp virtual-template 0   //# 配置LNS绑定虚拟接口模板。

ip route-static 0.0.0.0 0.0.0.0 12.0.0.2
ip route-static 3.3.3.3 255.255.255.255 172.16.0.254   //配置去往R3 子网的路由
ip route-static 4.4.4.4 255.255.255.255 172.16.0.253  //配置去往R4 子网的路由

R2 配置

R2 配置
 sysname r2
 
interface GigabitEthernet0/0/0
 ip address 12.0.0.2 255.255.255.0 

interface GigabitEthernet0/0/1
 ip address 23.0.0.2 255.255.255.0 

interface GigabitEthernet0/0/2
 ip address 24.0.0.2 255.255.255.0 

R3 配置

 sysname r3

interface Virtual-Template0
ppp chap user test
ppp chap password cipher test
ip address ppp-negotiate   //ip地址自动协商 协商候获取到地址 172.16.0.254
#   ip address 172.16.0.2 24  //手动指定 
l2tp-auto-client enable  // 触发自拨号建立L2TP隧道

interface GigabitEthernet0/0/1
ip address 23.0.0.3 255.255.255.0 

interface LoopBack0
ip address 3.3.3.3 255.255.255.255 


l2tp enable
//创建一个L2TP组并配置用户名称为huawei的用户与LNS建立L2TP连接。
l2tp-group 1
undo tunnel authentication
tunnel name test   //创建接口名称
start l2tp ip 12.0.0.1 fullusername test

ip route-static 0.0.0.0 0.0.0.0 23.0.0.2
ip route-static 1.1.1.1 255.255.255.255 172.16.0.1  //配置到R1 后子网的路由走l2tp
ip route-static 4.4.4.4 255.255.255.255 172.16.0.1  //配置到R4 子网的地址经过R1 中转
R4
 sysname r4

 l2tp enable

interface Virtual-Template0
 ppp chap user test
 ppp chap password cipher test
 ip address ppp-negotiate
 l2tp-auto-client enable

interface GigabitEthernet0/0/2
 ip address 24.0.0.4 255.255.255.0 

interface LoopBack0
 ip address 4.4.4.4 255.255.255.255 

l2tp-group 1
 undo tunnel authentication
 start l2tp ip 12.0.0.1 fullusername test

ip route-static 0.0.0.0 0.0.0.0 24.0.0.2
ip route-static 1.1.1.1 255.255.255.255 172.16.0.1
ip route-static 3.3.3.3 255.255.255.255 172.16.0.1

R3上测试
在这里插入图片描述
总结:
L2TP 实现分支间互访主要在于分之间配置静态路由,将去网目的网段的流量映入进L2TP隧道,由总部中转.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值