×××-l2tp(H3C)_L2TP
RT1
[Quidway]sysname LAC
[LAC]local-user vpdnuser
[LAC-luser-vpdnuser]password simple hello //设置用户名和口令
[LAC-luser-vpdnuser]service-type ppp //配置为PPP用户验证类型
[LAC]domain huawei.com //配置huawei.com域
[LAC-isp-huawei.com]scheme local //用户采用本地验证
[LAC]interface serial 1/0
[LAC-serial 1/0]ip add 202.38.160.1 255.255.255.0
[LAC-serial 1/0]undo shutdown
[LAC]l2tp enable //启用l2tp
[LAC]l2tp-group 1 //创建l2tp组
[LAC-l2tp1]tunnel name LAC //设置本端名
[LAC-l2tp1]start l2tp ip 202.38.160.2 domain huawei.com //根据用户域名来发起建立隧道的连接
[LAC-l2tp1]tunnel authentication //启用tunnel验证
[LAC-l2tp1]tunnel password simple quidway //设置密码
[LAC-l2tp1]tunnel avp-hidden //配置tunnel采用隐藏方式传输AVP数据,默认采用明文方式.
 
[LAC]interface Virtual-Template 0 //创建虚拟接口模板
[LAC-Virtual-Template0]ppp authentication-mode pap|chap
[LAC]interface Ethernet 0/0
[LAC-Ethernet 0/0]pppoe-server bind virtual-template 0//接口上启用pppoe server
 
 
RT2
[Quidway]sysname LNS
[LNS]local-user vpdnuser
[LNS-luser-vpdnuser]password simple hello
[LNS-luser-vpdnuser]service-type ppp //要和LAC一样
[LNS]interface serial 1/0
[LNS-Serial 1/0]ip add 202.38.160.2 255.255.255.0
[LNS]domain huawei.com
[LNS-isp-huawei.com]scheme local
[LNS-isp-huawei.com]ip pool 1 192.168.0.2 192.168.0.100 //创建地址,为×××用户分配地址
[LNS]interface Virtual-Template 1
[LNS-virtual-template 1]ip add 192.168.0.1 255.255.255.0
[LNS-virtual-template 1]ppp authentication-mode pap|chap domain huawei.com
[LNS-virtual-template 1]remote address pool 1//指明对端地下址从pool 1中选
[LNS]l2tp enable
[LNS]l2tp-group 1
[LNS-l2tp1]tunnel name LNS
[LNS-l2tp]allow l2tp virtual-template 1 remote LAC//设置接收呼叫的虚拟接口模板通道对端名称和域名
[LNS-l2tp1]tunnle authentication
[LNS-l2tp1]tunnel password simple quidway
[LNS-l2tp1]tunnel avp-hidden
 
 
[LNS-l2tp1]mandatory-chap//强制本端CHAP认证,当PPP类型为CHAP时才行
[LNS-l2tp1]mandatory-lcp//强制LCP重新协商