

问题的描述,在配置好L2TP服务器后,通过家用路由器能连,电脑也能连接,但是通过企业路由器不能连接,主要的原因是连接服务器的客户端不能解析域名
服务器的路由版本如:
[qinxiu]dis ver //查看当前路由器的版本,和型号,
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.170 (AR160 V200R010C10SPC700) //这里显示路由器的版本和型号,
客户端路由器的版本如:
[gaoxin]dis ver
Huawei Versatile Routing Platform Software
VRP (R) software, Version 5.170 (AR160 V200R010C10SPC700)
服务器的L2TP组配置如下,
[qinxiu]dis current-configuration | begin l2tp-group //查看路由器当前配置,从l2tp-group开始
l2tp-group 1
undo tunnel authentication
allow l2tp virtual-template 1
#
服务器的虚拟模板接口配置如下,
[qinxiu]display current-configuration interface virtual-template //显示路由器配置信息中的虚拟接口部分,
[V200R010C10SPC700]
#
interface Virtual-Template1
ppp authentication-mode chap
remote address pool l2tpLns1
ip address 192.168.21.1 255.255.255.0
#
return
客户端L2TP组配置如下,
[gaoxin]display current-configuration | begin l2tp-group //查看路由器当前配置,从l2tp-group开始
l2tp-group 2
undo tunnel authentication
start l2tp host aa.8y8z.com fullusername moossy
#
客户端虚拟接口模板配置如下,
[gaoxin]display current-configuration interface virtual-template //查看路由器配置信息中的虚拟接口部分
[V200R010C10SPC700]
#
interface Virtual-Template1
ppp chap user moossy
ppp chap password cipher %^%#HlOy0FAT\Y&%j<I"M\sGQgOP+x/9g)`,B"G9C2^"%^%#
ppp pap local-user moossy password cipher %^%#uK[F$QTj&KF#LT$v'B@T<=.Y1Gs.0;lzlV2V*;85%^%#
ppp ipcp dns admit-any
ppp ipcp dns request
ip address ppp-negotiate
l2tp-auto-client enable
#
//***检查到服务器的路由是否可达?开始的连不上,主要原因在这里,路由不可达
[gaoxin]ping aa.8y8z.com
Error: Unknown host aa.8y8z.com.
//解决方法:
[gaoxin]dns resolve //命令用来使能动态域名解析功能。
[gaoxin]dns server 114.114.114.114 //添加域名解析服务器,这里只能添加一个,不能使用服务器列表,
[gaoxin]dns reso //也许还需要这句开启域名解析功能
//****注:使用动态域名解析也许需要开启dns解析
//查看L2TP会话是否成功
[gaoxin]dis l2tp session
Total session : 1
LocalSID RemoteSID LocalTID Interface LclTAddr RmtTAddr LclSAddr RmtSAddr
1 2 5 Virtual-Template1:0 113.12.174.196 220.173.37.186 192.168.21.234 192.168.21.1
//查看通道信息
[gaoxin]dis l2tp tunnel
Total tunnel : 1
LocalTID RemoteTID RemoteAddress Port Sessions RemoteName
5 14 220.173.37.186 1701 1 qinxiu