当前只能通过移动线路拨入,主要原因可能是:
L2TP监听地址只绑定了移动出口
路由策略导致电信出口的L2TP流量无法正确处理
NAT和策略配置不完整
解决方案
第一步:配置L2TP监听多出口
# 进入L2TP组配置
interface virtual-template 1
ip address 192.168.100.1 255.255.255.0 remote address pool l2tp-pool
# 创建L2TP地址池
ip pool l2tp-pool 192.168.100.2 192.168.100.100
# 配置L2TP组,监听所有接口或指定多个IP
l2tp-group 1
allow l2tp virtual-template 1
# 方法1:监听所有接口(推荐)
bind interface all
# 方法2:分别指定两个出口的IP
# bind source interface GigabitEthernet1/0/1 # 移动出口
# bind source interface GigabitEthernet1/0/2 # 电信出口
tunnel name L2TP-Server
mandatory-lcp
第二步:配置双出口NAT策略
# 创建ACL匹配L2TP流量(UDP 1701)
acl number 3000
rule 5 permit udp destination-port eq 1701
rule 10 permit udp destination-port eq 1701
# 配置NAT策略,允许两个出口的L2TP流量
nat-policy interzone local untrust outbound
policy 10
action source-nat
policy source 192.168.100.0 0.0.0.255
easy-ip GigabitEthernet1/0/1 # 移动出口
policy 20
action source-nat
policy source 192.168.100.0 0.0.0.255
easy-ip GigabitEthernet1/0/2 # 电信出口
第三步:配置安全策略放行双出口L2TP
# 创建安全策略允许L2TP流量
security-policy ip
rule name permit_l2tp_mobile
action pass
source-zone untrust
destination-zone local
source-ip any
destination-ip host [移动出口公网IP]
service l2tp
profile default
rule name permit_l2tp_telecom
action pass
source-zone untrust
destination-zone local
source-ip any
destination-ip host [电信出口公网IP]
service l2tp
profile default
第四步:配置策略路由(关键步骤)
由于主备线路架构,需要确保L2TP响应流量从正确的出口返回:
# 创建ACL匹配L2TP虚拟接口流量
acl number 3100
rule 5 permit ip source 192.168.100.0 0.0.0.255
# 配置策略路由
policy-based-route l2tp-route permit node 10
if-match acl 3100
apply next-hop [移动出口网关] track [移动链路检测对象]
policy-based-route l2tp-route permit node 20
if-match acl 3100
apply next-hop [电信出口网关] track [电信链路检测对象]
# 在虚拟模板接口应用策略路由
interface virtual-template 1
ip policy-based-route l2tp-route
第五步:配置链路检测和冗余
# 创建NQA检测移动链路
nqa entry admin mobile-track
type icmp-echo
destination ip [移动网关或可靠地址]
frequency 1000
reaction 1 checked-element probe-fail threshold-type consecutive 3
# 创建NQA检测电信链路
nqa entry admin telecom-track
type icmp-echo
destination ip [电信网关或可靠地址]
frequency 1000
reaction 1 checked-element probe-fail threshold-type consecutive 3
# 启动NQA检测
nqa schedule admin mobile-track start-time now lifetime forever
nqa schedule admin telecom-track start-time now lifetime forever
# 创建track对象
track 1 nqa entry admin mobile-track reaction 1
track 2 nqa entry admin telecom-track reaction 1
第六步:配置动态路由或静态路由备份
# 配置默认路由,设置不同优先级
ip route-static 0.0.0.0 0.0.0.0 [移动网关] preference 60 track 1
ip route-static 0.0.0.0 0.0.0.0 [电信网关] preference 70 track 2
# 或者使用策略路由实现负载分担
第七步:验证配置
# 检查L2TP状态
display l2tp tunnel
display l2tp session
# 检查NAT会话
display nat session source-ip 192.168.100.0
# 测试双出口连通性
# 从移动网络测试
ping -a [移动出口IP] [L2TP客户端IP]
# 从电信网络测试
ping -a [电信出口IP] [L2TP客户端IP]
高级优化配置
配置会话持久化(避免切换时断线)
# 启用会话持久化
session persistent enable
session persistent l2tp source-ip destination-ip
# 配置快速检测
link-group l2tp-backup
mode primary-backup
bind interface GigabitEthernet1/0/1 primary
bind interface GigabitEthernet1/0/2 backup
preempt enable
delay 5
DNS配置(如需要)
# 配置L2TP客户端DNS
interface virtual-template 1
ppp ipcp dns 8.8.8.8 114.114.114.114
故障排查命令
# 实时调试(谨慎使用)
debugging l2tp all
terminal monitor
terminal debugging
# 查看详细日志
display logbuffer
display l2tp statistic
# 检查路由路径
tracert 192.168.100.2
display ip routing-table 192.168.100.2
关键注意事项
防火墙策略:确保两个出口的安全策略都放行L2TP流量
NAT配置:两个出口都需要配置L2TP流量的NAT转换
路由对称:确保响应流量从接收流量的同一出口返回
会话保持:配置会话持久化避免链路切换时连接中断
按照以上步骤配置后,L2TP VPN应该能够通过移动和电信两个出口正常拨入。如果仍有问题,请检查具体的错误日志和会话状态。
不支持 bind source interface GigabitEthernet1/0/1 这个命令
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
不支持 bind source interface GigabitEthernet1/0/1 这个命令