本文档提供一个配置示例,其中为ISDN和模拟拨入呼叫配置虚拟专用拨号网络(VPDN)第2层隧道协议(L2TP)。此设置中不涉及身份验证、授权和记帐(AAA)服务器。
L2TP是Internet工程任务组(IETF)标准,它结合了两种现有隧道协议的最佳功能:
思科第2层转发(L2F)
Microsoft点对点隧道协议(PPTP)
在此设置中,我们通过添加命令协议L2TP来使用L2TP。L2F是默认值。
Cisco建议您使用Cisco IOS®软件版本12.0(1)T中引入的vpdn-group命令来定义L2TP接入集中器(LAC)和L2TP网络服务器(LNS)中的VPDN参数。 但是,如果要使用命令vpdn incoming和vpdn outgoing,请参阅配置虚拟专用拨号网络。
此设置的主要特征如下:
LAC:
根据身份验证(此设置中的质询握手身份验证协议[CHAP])响应中收到的域名标识VPDN客户端。
使用其本地VPDN参数启动隧道和与LNS的会话。
LNS:
使用其本地VPDN参数接受来自LAC的VPDN隧道和会话。
对远程用户进行本地身份验证。
将IP地址从其本地池分配给客户端。
此配置使用下面软件和硬件版本开发并且被测试。
Cisco IOS软件版本12.2主行。VPDN需要IP+功能。
带E1卡和Mica卡的Cisco AS5300(LAC)。它可以接受ISDN和模拟呼叫。
本文档中的信息都是基于特定实验室环境中的设备创建的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您是在真实网络上操作,请确保您在使用任何命令前已经了解其潜在影响。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
本部分提供有关如何配置本文档所述功能的信息。
注意:使用命令查找工具(仅限注册客户)可查找有关本文档中使用的命令的详细信息。
本文档使用以下网络设置:
LAC |
---|
version 12.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname LAC ! spe 2/0 2/9 firmware location system:/ucode/mica_port_firmware ! ! modem country mica belgium ! vpdn enable ! -- Enables VPDN. ! vpdn search-order domain ! -- VPDN tunnel authorization is based on the domain name ! -- (the default is DNIS). ! vpdn-group GroupCisco request-dialin protocol l2tp ! -- L2TP is used instead of the default (L2F). domain cisco.com ! -- The domain name cisco.com is used to identify a VPDN user when ! -- receiving the CHAP response from the user. initiate-to ip 10.48.74.35 ! -- The tunnel and session are initialized to the ethernet ip address of the ! -- LNS 10.48.74.35. l2tp tunnel password cisco ! -- for tunnel authentication ! isdn switch-type primary-net5 ! controller E1 0 clock source line primary pri-group timeslots 1-31 ! interface Ethernet0 ip address 10.48.75.7 255.255.254.0 ! interface Serial0:15 no ip address encapsulation ppp dialer rotary-group 1 isdn switch-type primary-net5 isdn incoming-voice modem ! interface Group-Async1 no ip address encapsulation ppp async mode dedicated ppp authentication chap pap group-range 1 120 ! interface Dialer1 no ip address encapsulation ppp ppp authentication chap pap ! ip classless ip route 0.0.0.0 0.0.0.0 10.48.74.1 ! line con 0 exec-timeout 0 0 line 1 120 modem InOut transport input all line aux 0 line vty 0 4 exec-timeout 0 0 password cisco login ! |
LNS |
---|
version 12.2 service timestamps debug datetime msec service timestamps log datetime msec ! hostname LNS ! username UserISDN@cisco.com password 0 cisco username UserAnalog@cisco.com password 0 cisco ! -- The LNS authenticates the remote users locally. ! vpdn enable ! -- Enables VPDN. ! vpdn-group VPDN accept-dialin ! -- Enables the LNS to accept VPDN request. protocol l2tp !-- L2TP is used instead of the L2F (default). virtual-template 1 ! -- For each user, the virtual-template 1 is used to terminate the PPP session. terminate-from hostname LAC ! -- The LNS accepts VPDN request from router LAC. l2tp tunnel password cisco ! -- for tunnel authentication ! ! ! ! interface Loopback1 ip address 12.12.12.1 255.255.255.255 no ip route-cache no ip mroute-cache ! interface Ethernet0 ip address 10.48.74.35 255.255.254.0 no ip route-cache no ip mroute-cache no cdp enable ! interface Virtual-Template1 ! -- The PPP session is terminated in the virtual-access cloned from this ! -- virtual-template ip unnumbered Loopback1 peer default ip address pool GroupCisco ppp authentication chap pap ! ip local pool GroupCisco 12.12.12.2 12.12.12.50 ! -- The LNS assigns an ip address to the remote user ip classless ip route 0.0.0.0 0.0.0.0 10.48.74.1 |
注意:在上述配置中,我们已使用最小点对点协议(PPP)选项配置了拨号器1和组异步1接口。
要允许PPP级别的更多功能(ppp multilink、compression等),您需要在这些接口和LNS的virtual-template 1上添加这些功能。
重要信息:规则是,您在拨号器1和组异步1接口中定义的所有PPP选项都必须在LNS的virtual-template 1中配置。
virtual-template 1接收LAC和客户端之间协商的LCP选项的“副本”。如果LAC和客户端之间协商的选项未在virtual-template 1中配置,则LNS将清除VPDN会话。但是,要允许LNS与客户端重新协商LCP,请在VPDN组中设置命令lcp renegotiation always或lcp renegotiation on-mismatch。
注意:默认情况下,LAC和LNS在L2TP交换数据包中使用其主机名。要修改此行为,请在vpdn-group中定义命令本地名称。让我们看一个LNS配置示例:
vpdn-group VPDN accept-dialin protocol l2tp virtual-template 1 terminate-from hostname LAC local name LNS-cental
本部分所提供的信息可用于确认您的配置是否正常工作。
命令输出解释程序(仅限注册用户)(OIT) 支持某些 show 命令。使用 OIT 可查看对 show 命令输出的分析。
show vpdn tunnel — 以摘要样式格式显示有关所有活动L2F和L2TP隧道的信息。
show caller ip - 显示您提供的 IP 地址的呼叫方信息概要。
本部分提供的信息可用于对配置进行故障排除。
注意:使用 debug 命令之前,请参阅有关 Debug 命令的重要信息。
在LAC上:
debug vpdn event — 显示L2TP错误和事件,这些错误和事件是VPDN正常隧道建立或关闭的一部分。
debug vpdn l2x-event — 显示有关12x正常隧道建立或关闭过程中的事件的消息。
debug vpdn l2x-error — 显示阻止建立l2x或阻止其正常操作的l2x协议错误。
debug ppp negotiation — 使debug ppp命令显示在PPP启动期间传输的PPP数据包,在此启动期间协商PPP选项。
debug isdn q931 — 显示有关本地路由器(用户端)和网络之间ISDN网络连接(第3层)的呼叫建立和拆卸的信息。
debug modem - 显示接入服务器上的调制解调器线路活动情况。
在LNS上:
debug vpdn event
debug vpdn l2x-event
debug vpdn l2x-error
debug vtemplate - 显示从虚拟模板克隆虚拟访问接口时到虚拟访问接口因呼叫结束而关闭时虚拟访问接口的克隆信息。
debug ppp negotiation
以下是来自客户端UserISDN@cisco.com的ISDN呼叫。
调试 LAC上的命令
LAC从号码8101接收ISDN呼叫。
LAC# *Feb 1 14:45:09.684: ISDN Se0:15: RX <- SETUP pd = 8 callref = 0x3D03 *Feb 1 14:45:09.688: Sending Complete *Feb 1 14:45:09.688: Bearer Capability i = 0x8890 *Feb 1 14:45:09.688: Channel ID i = 0xA18387 *Feb 1 14:45:09.688: Calling Party Number i = 0xA1, '8101', Plan:ISDN, Type:National *Feb 1 14:45:09.688: Called Party Number i = 0x81, '214', Plan:ISDN, Type:Unknown *Feb 1 14:45:09.692: %LINK-3-UPDOWN: Interface Serial0:6, changed state to up *Feb 1 14:45:09.692: Se0:6 PPP: Treating connection as a callin *Feb 1 14:45:09.692: Se0:6 PPP: Phase is ESTABLISHING, Passive Open [0 sess, 0 load] *Feb 1 14:45:09.692: Se0:6 LCP: State is Listen *Feb 1 14:45:09.696: ISDN Se0:15: TX -> CALL_PROC pd = 8 callref = 0xBD03 *Feb 1 14:45:09.696: Channel ID i = 0xA98387 *Feb 1 14:45:09.696: ISDN Se0:15: TX -> CONNECT pd = 8 callref = 0xBD03 *Feb 1 14:45:09.696: Channel ID i = 0xA98387 ! -- The ISDN phase is finished and the B channel is up ! -- as soon as the LAC receives RX <- CONNECT_ACK. *Feb 1 14:45:09.752: ISDN Se0:15: RX <- CONNECT_ACK pd = 8 callref = 0x3D03 *Feb 1 14:45:09.752: ISDN Se0:15: CALL_PROGRESS: CALL_CONNECTED call id 0x90, bchan 6, dsl 0 ! -- PPP starts with LCP phase : authentication protocol and other LCP ! -- options (compression, multilink, and so on) are negotiated. ! -- In the debug below, only chap is negotiated. *Feb 1 14:45:09.844: Se0:6 LCP: I CONFREQ [Listen] id 179 len 10 *Feb 1 14:45:09.844: Se0:6 LCP: MagicNumber 0x5B90B785 (0x05065B90B785) *Feb 1 14:45:09.844: Se0:6 LCP: O CONFREQ [Listen] id 1 len 15 *Feb 1 14:45:09.844: Se0:6 LCP: AuthProto CHAP (0x0305C22305) *Feb 1 14:45:09.844: Se0:6 LCP: MagicNumber 0x1A9DC8A5 (0x05061A9DC8A5) *Feb 1 14:45:09.844: Se0:6 LCP: O CONFACK [Listen] id 179 len 10 *Feb 1 14:45:09.844: Se0:6 LCP: MagicNumber 0x5B90B785 (0x05065B90B785) *Feb 1 14:45:09.876: Se0:6 LCP: I CONFACK [ACKsent] id 1 len 15 *Feb 1 14:45:09.876: Se0:6 LCP: AuthProto CHAP (0x0305C22305) *Feb 1 14:45:09.876: Se0:6 LCP: MagicNumber 0x1A9DC8A5 (0x05061A9DC8A5) *Feb 1 14:45:09.876: Se0:6 LCP: State is Open *Feb 1 14:45:09.876: Se0:6 PPP: Phase is AUTHENTICATING, by this end [0 sess, 0 load] ! -- The LAC sends the client a CHAP challenge. *Feb 1 14:45:09.876: Se0:6 CHAP: O CHALLENGE id 1 len 24 from "LAC". ! -- The LAC receives the CHAP response from the client with username ! -- UserISDN@cisco.com. *Feb 1 14:45:09.924: Se0:6 CHAP: I RESPONSE id 1 len 39 from "UserISDN@cisco.com" ! -- The LAC checks out if UserISDN@cisco.com is a VPDN client or not. ! -- Because the domain cisco.com is configured in the vpdn-group ! -- GroupCisco, UserISDN@cisco.com is a VPDN client. The LAC takes ! -- the VPDN parameters in the vpdn-group where the domain name ! -- cisco.com is located. *Feb 1 14:45:09.924: Se0:6 PPP: Phase is FORWARDING [0 sess, 0 load] *Feb 1 14:45:09.924: Se0:6 VPDN: Got DNIS string 214 *Feb 1 14:45:09.924: Se0:6 VPDN: Looking for tunnel -- cisco.com -- *Feb 1 14:45:09.928: Se0:6 VPDN/RPMS/GroupCisco: Got tunnel info for cisco.com *Feb 1 14:45:09.928: Se0:6 VPDN/RPMS/GroupCisco: LAC *Feb 1 14:45:09.928: Se0:6 VPDN/RPMS/GroupCisco: l2tp-busy-disconnect yes *Feb 1 14:45:09.928: Se0:6 VPDN/RPMS/GroupCisco: IP 10.48.74.35 *Feb 1 14:45:09.928: Se0:6 VPDN/GroupCisco: curlvl 1 Address 0: 10.48.74.35, priority 1 *Feb 1 14:45:09.928: Se0:6 VPDN/GroupCisco: Select non-active address 10.48.74.35, priority 1 *Feb 1 14:45:09.928: Se0:6 VPDN: Find LNS process created *Feb 1 14:45:09.928: Tnl 2027 L2TP: SM State idle ! -- In order to bring up the tunnel, the LAC sends SCCRQ (Start Control ! -- Connection Request) to the LNS. ! -- A CHAP challenge is included in the packet. *Feb 1 14:45:09.928: Tnl 2027 L2TP: O SCCRQ *Feb 1 14:45:09.928: Tnl 2027 L2TP: Tunnel state change from idle to wait-ctl-reply *Feb 1 14:45:09.928: Tnl 2027 L2TP: SM State wait-ctl-reply *Feb 1 14:45:09.928: Se0:6 VPDN: Forward to address 10.48.74.35 *Feb 1 14:45:09.928: Se0:6 VPDN: Pending *Feb 1 14:45:09.932: Se0:6 VPDN: Process created ! -- The LAC receives from the LNS SCCRP (Start Control Connection Reply). ! -- The response to its own chalenge and another chap chalenge from the LNS ! -- are included in the packet. *Feb 1 14:45:09.956: Tnl 2027 L2TP: I SCCRP from LNS *Feb 1 14:45:09.956: Tnl 2027 L2TP: Got a challenge from remote peer, LNS *Feb 1 14:45:09.956: Tnl 2027 L2TP: Got a response from remote peer, LNS *Feb 1 14:45:09.956: Tnl 2027 L2TP: Tunnel Authentication success *Feb 1 14:45:09.956: Tnl 2027 L2TP: Tunnel state change from wait-ctl-reply to established ! -- The LAC sends to the LNS SCCCN (Start Control Connection Connected). ! -- The response to LNS's challenge is included in the packet. *Feb 1 14:45:09.956: Tnl 2027 L2TP: O SCCCN to LNS tnlid 11514 *Feb 1 14:45:09.956: Tnl 2027 L2TP: SM State established *Feb 1 14:45:09.956: Se0:6 VPDN: Forwarding... *Feb 1 14:45:09.956: Se0:6 VPDN: Bind interface direction=1 *Feb 1 14:45:09.956: Tnl/Cl 2027/18 L2TP: Session FS enabled *Feb 1 14:45:09.956: Tnl/Cl 2027/18 L2TP: Session state change from idle to wait-for-tunnel *Feb 1 14:45:09.960: Se0:6 Tnl/Cl 2027/18 L2TP: Create session *Feb 1 14:45:09.960: Tnl 2027 L2TP: SM State established ! -- The Tunnel is up. The LAC brings up the session for the user ! -- UserISDN@cisco.com. For that, it sends ICRQ (Incoming Call ReQuest). *Feb 1 14:45:09.960: Se0:6 Tnl/Cl 2027/18 L2TP: O ICRQ to LNS 11514/0 *Feb 1 14:45:09.960: Se0:6 Tnl/Cl 2027/18 L2TP: Session state change from wait-for-tunnel to wait-reply *Feb 1 14:45:09.960: Se0:6 VPDN: UserISDN@cisco.com is forwarded ! -- After receiving ICRP (Incoming Call Reply, we don't see it in the debug) ! -- the LAC sends ICCN Incoming Call Connected. The VPDN session is up . ! -- Then the LAC forwards to the LNS what it has negotiated with the client ! -- (LCP options) along with the username and chap password of the client. *Feb 1 14:45:10.008: Se0:6 Tnl/Cl 2027/18 L2TP: O ICCN to LNS 11514/6 *Feb 1 14:45:10.008: Se0:6 Tnl/Cl 2027/18 L2TP: Session state change from wait-reply to established *Feb 1 14:45:10.960: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0:6, changed state to up *Feb 1 14:45:15.692: %ISDN-6-CONNECT: Interface Serial0:6 is now connected to 8101 UserISDN@cisco.com LAC#
调试 LNS上的命令
LNS从LAC接收SCCRQ。
LNS# *Mar 1 02:13:06.499: L2TP: I SCCRQ from LAC tnl 2027 *Mar 1 02:13:06.507: Tnl 11514 L2TP: Got a challenge in SCCRQ, LAC *Mar 1 02:13:06.511: Tnl 11514 L2TP: New tunnel created for remote LAC, address 10.48.75.7 ! -- The LNS replies with SCCRP which includes the CHAP response to LAC's ! -- challenge and a CHAP challenge. *Mar 1 02:13:06.515: Tnl 11514 L2TP: O SCCRP to LAC tnlid 2027 *Mar 1 02:13:06.523: Tnl 11514 L2TP: Tunnel state change from idle to wait-ctl-reply ! -- The LNS receives SCCCN. *Mar 1 02:13:06.535: Tnl 11514 L2TP: I SCCCN from LAC tnl 2027 *Mar 1 02:13:06.539: Tnl 11514 L2TP: Got a Challenge Response in SCCCN from LAC *Mar 1 02:13:06.543: Tnl 11514 L2TP: Tunnel Authentication success *Mar 1 02:13:06.543: Tnl 11514 L2TP: Tunnel state change from wait-ctl-reply to established *Mar 1 02:13:06.547: Tnl 11514 L2TP: SM State established ! -- The tunnel is up. The LNS receives ICRQ to bring up the session. *Mar 1 02:13:06.555: Tnl 11514 L2TP: I ICRQ from LAC tnl 2027 *Mar 1 02:13:06.559: Tnl/Cl 11514/6 L2TP: Session FS enabled *Mar 1 02:13:06.563: Tnl/Cl 11514/6 L2TP: Session state change from idle to wait-connect *Mar 1 02:13:06.567: Tnl/Cl 11514/6 L2TP: New session created ! -- The LNS replies with ICRP (Incoming Call Reply). *Mar 1 02:13:06.567: Tnl/Cl 11514/6 L2TP: O ICRP to LAC 2027/18 ! -- The LNS receives ICCN (Incoming Call coNnected). The VPDN sesion is up, ! -- then the LNS receives the LCP layer along with the username ! -- and chap password of the client. ! -- A virtual-access is cloned from the virtual-template 1. *Mar 1 02:13:06.583: Tnl/Cl 11514/6 L2TP: I ICCN from LAC tnl 2027, cl 18 *Mar 1 02:13:06.591: Tnl/Cl 11514/6 L2TP: Session state change from wait-connect to established *Mar 1 02:13:06.591: Vt1 VTEMPLATE: Unable to create and clone vaccess *Mar 1 02:13:06.595: Vi1 VTEMPLATE: Reuse Vi1, recycle queue size 1 *Mar 1 02:13:06.595: Vi1 VTEMPLATE: Hardware address 0000.0c4a.4314 *Mar 1 02:13:06.599: Vi1 VPDN: Virtual interface created for UserISDN@cisco.com *Mar 1 02:13:06.603: Vi1 PPP: Phase is DOWN, Setup [0 sess, 0 load] *Mar 1 02:13:06.603: Vi1 VPDN: Clone from Vtemplate 1 filterPPP=0 blocking *Mar 1 02:13:06.607: Vi1 VTEMPLATE: Has a new cloneblk vtemplate, now it has vtemplate *Mar 1 02:13:06.611: Vi1 VTEMPLATE: ************* CLONE VACCESS1 ***************** *Mar 1 02:13:06.615: Vi1 VTEMPLATE: Clone from Virtual-Template1 interface Virtual-Access1 default ip address no ip address encap ppp ip unnumbered Loopback1 end *Mar 1 02:13:07.095: %LINK-3-UPDOWN: Interface Virtual-Access1, changed state to up *Mar 1 02:13:07.099: Vi1 PPP: Using set call direction *Mar 1 02:13:07.103: Vi1 PPP: Treating connection as a callin *Mar 1 02:13:07.103: Vi1 PPP: Phase is ESTABLISHING, Passive Open [0 sess, 0 load] *Mar 1 02:13:07.107: Vi1 LCP: State is Listen *Mar 1 02:13:07.111: Vi1 VPDN: Bind interface direction=2 *Mar 1 02:13:07.111: Vi1 LCP: I FORCED CONFREQ len 11 *Mar 1 02:13:07.115: Vi1 LCP: AuthProto CHAP (0x0305C22305) *Mar 1 02:13:07.119: Vi1 LCP: MagicNumber 0x1A9DC8A5 (0x05061A9DC8A5) *Mar 1 02:13:07.119: Vi1 VPDN: PPP LCP accepted rcv CONFACK *Mar 1 02:13:07.123: Vi1 LCP: I FORCED CONFACK len 6 *Mar 1 02:13:07.127: Vi1 LCP: MagicNumber 0x5B90B785 (0x05065B90B785) *Mar 1 02:13:07.131: Vi1 VPDN: PPP LCP accepted sent CONFACK ! -- The LNS authenticates the user. It doesn't send a new CHAP challenge ! -- (the debug may be confusing) since it has received the CHAP challenge ! -- and response from the LAC. *Mar 1 02:13:07.131: Vi1 PPP: Phase is AUTHENTICATING, by this end [0 sess, 0 load] *Mar 1 02:13:07.135: Vi1 CHAP: O CHALLENGE id 2 len 24 from "LNS" *Mar 1 02:13:07.143: Vi1 CHAP: I RESPONSE id 1 len 39 from "UserISDN@cisco.com" *Mar 1 02:13:07.151: Vi1 CHAP: O SUCCESS id 1 len 4 *Mar 1 02:13:07.155: Vi1 PPP: Phase is UP [0 sess, 0 load] ! -- The IPCP phase starts. ! -- The IP address 12.12.12.2 is assigned to the client. *Mar 1 02:13:07.159: Vi1 IPCP: O CONFREQ [Closed] id 1 len 10 *Mar 1 02:13:07.163: Vi1 IPCP: Address 12.12.12.1 (0x03060C0C0C01) *Mar 1 02:13:07.215: Vi1 IPCP: I CONFREQ [REQsent] id 34 len 10 *Mar 1 02:13:07.219: Vi1 IPCP: Address 0.0.0.0 (0x030600000000) *Mar 1 02:13:07.223: Vi1 IPCP: Pool returned 12.12.12.2 *Mar 1 02:13:07.227: Vi1 IPCP: O CONFNAK [REQsent] id 34 len 10 *Mar 1 02:13:07.231: Vi1 IPCP: Address 12.12.12.2 (0x03060C0C0C02) *Mar 1 02:13:07.235: Vi1 IPCP: I CONFACK [REQsent] id 1 len 10 *Mar 1 02:13:07.239: Vi1 IPCP: Address 12.12.12.1 (0x03060C0C0C01) *Mar 1 02:13:07.271: Vi1 IPCP: I CONFREQ [ACKrcvd] id 35 len 10 *Mar 1 02:13:07.275: Vi1 IPCP: Address 12.12.12.2 (0x03060C0C0C02) *Mar 1 02:13:07.279: Vi1 IPCP: O CONFACK [ACKrcvd] id 35 len 10 *Mar 1 02:13:07.283: Vi1 IPCP: Address 12.12.12.2 (0x03060C0C0C02) *Mar 1 02:13:07.287: Vi1 IPCP: State is Open *Mar 1 02:13:07.295: Vi1 IPCP: Install route to 12.12.12.2 ! -- The virtual-access is up. *Mar 1 02:13:08.159: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access1, changed state to up LNS#
show 命令
LAC#show vpdn tunnel L2TP Tunnel Information Total tunnels 1 sessions 1 LocID RemID Remote Name State Remote Address Port Sessions 36556 45655 LNS est 10.48.74.35 1701 1 %No active L2F tunnels %No active PPTP tunnels %No active PPPoE tunnels LAC#
LNS#show vpdn tunnel L2TP Tunnel Information Total tunnels 1 sessions 1 LocID RemID Remote Name State Remote Address Port Sessions 45655 36556 LAC est 10.48.75.7 1701 1 %No active L2F tunnels %No active PPTP tunnels %No active
LNS#show caller ip Line User IP Address Local Number Remote Number <-> Vi1 UserISDN@cisco.com \ 12.12.12.2 214 8101 in LNS#
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
09-Sep-2005 |
初始版本 |