L2TP – 独立LAC测试分析

Topology

PC——[f0/0]LAC[f1/0]——ISP——[f1/0]LNS[ server]
本篇仅关注测试,独立LAC的更多说明,可以看上一篇简述《L2TP两种部署方法简述

LAC配置及相关信息

hostname R1-LAC
!—在l2tp拨号中,hostname其实没有什么作用
!
no aaa new-model
!—在独立LAC中,不用开AAA,关于PPPOE的认证方式,可能需要跟AAA配合,此处不做过多介绍
!
vpdn enable
!—开启VPDN

vpdn-group 1
request-dialin
protocol l2tp
domain cisco.com
!—PPPOE拨入成功后,下一步会跟VPDN联动,这时需要用域名来区分tunnel,因为LAC上可能有多个tunnel,所以拨号时用的用户名必须是”[email protected]
initiate-to ip 12.1.1.2
local name R1LAC
l2tp tunnel password 0 cisco
!—tunnel建立时需要认证,认证”l2tp tunnel authentication”默认开启,no掉时才显示
!
bba-group pppoe global
virtual-template 1
!—端口调用这个bba-group,里面再调用template
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
pppoe enable group global
!
interface FastEthernet1/0
ip address 12.1.1.1 255.255.255.0
!
interface Virtual-Template1
mtu 1492
ip unnumbered Loopback0
no peer default ip address
ppp authentication chap
!—这是LAC发起CHAP认证,让PC提供用户名,这样用户名带的域名就会跟VPDN里的域名匹配,如果一致就会进行tunnel的建立

R1-LAC#sh ip int br
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  up                    up      
FastEthernet1/0            12.1.1.1        YES NVRAM  up                    up      
Virtual-Access1            unassigned      YES unset  down                  down    
Virtual-Template1          1.1.1.1         YES TFTP   down                  down    
Virtual-Access2            unassigned      YES unset  up                    up      
Loopback0                  1.1.1.1         YES NVRAM  up                    up      
R1-LAC#sh l2tp session brief   

L2TP Session Information Total tunnels 1 sessions 1

LocID      TunID      Peer-address    State     Username, Intf/                 
                                      sess/cir  Vcid, Circuit                   
4          6498       12.1.1.2        est,UP    [email protected], Fa0/0         
R1-LAC#sh pppoe session all 
Total PPPoE sessions 1

session id: 3
local MAC address: ca00.198c.0000, remote MAC address: 0000.0000.5b07
virtual access interface: N/A, outgoing interface: Fa0/0
    58 packets sent, 710 received
    872 bytes sent, 64384 received

LNS配置及相关信息

hostname R2LNS
!
aaa new-model
aaa authentication ppp default local
!—AAA在LNS上是认证PC发出的用户名和密码
!
vpdn enable
!
vpdn-group 1
accept-dialin
protocol l2tp
virtual-template 1
terminate-from hostname R1LAC
local name R2LNS
lcp renegotiation on-mismatch
!—这个必须配置,如果不配置,lcp会建立不起来
l2tp tunnel password 0 cisco
!
username [email protected] password 0 111111
!
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet1/0
ip address 12.1.1.2 255.255.255.0
!
interface Virtual-Template1
ip unnumbered Loopback0
peer default ip address pool l2tp
!—给客户端分配地址,地址池是l2tp
ppp authentication chap
!
ip local pool l2tp 33.33.33.1 33.33.33.254
ip route 0.0.0.0 0.0.0.0 12.1.1.1

R2LNS#sh l2tp session brief 

L2TP Session Information Total tunnels 1 sessions 1

LocID      TunID      Peer-address    State     Username, Intf/                 
                                      sess/cir  Vcid, Circuit                   
4          17866      12.1.1.1        est,UP    [email protected], Vi2.1  

R2LNS#sh ip int br
Interface                  IP-Address      OK? Method Status                Protocol   
FastEthernet1/0            12.1.1.2        YES NVRAM  up                    up         
Virtual-Access1            unassigned      YES unset  down                  down    
Virtual-Template1          2.2.2.2         YES TFTP   down                  down    
Virtual-Access2            unassigned      YES unset  up                    up      
Virtual-Access2.1          2.2.2.2         YES TFTP   up                    up      
Loopback0                  2.2.2.2         YES NVRAM  up                    up

PC相关信息

C:\Windows\system32>ipconfig
Windows IP 配置
PPP 适配器 宽带连接:
   连接特定的 DNS 后缀 . . . . . . . :
   IPv4 地址 . . . . . . . . . . . . : 33.33.33.1
   子网掩码  . . . . . . . . . . . . : 255.255.255.255
   默认网关. . . . . . . . . . . . . : 0.0.0.0

以太网适配器 以太网:

   连接特定的 DNS 后缀 . . . . . . . :
   本地链接 IPv6 地址. . . . . . . . : 
   IPv4 地址 . . . . . . . . . . . . : 192.168.1.2
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   默认网关. . . . . . . . . . . . . : 192.168.1.1

C:\Windows\system32>route print
===========================================================================
接口列表
 41...........................宽带连接
 12...00 00 00 00 5b 07 ......Intel(R) 82574L 千兆网络连接
===========================================================================
IPv4 路由表
===========================================================================
活动路由:
网络目标        网络掩码          网关       接口   跃点数
          0.0.0.0          0.0.0.0      192.168.1.1      192.168.1.2   4245
          0.0.0.0          0.0.0.0            在链路上        33.33.33.1     21
       33.33.33.1  255.255.255.255            在链路上        33.33.33.1    276

L2TP/IPSEC

为了保证tunnel的安全性,可以对l2tp开启ipsec功能,PC拨号属性不用改变,lac和lns需要如何配置呢?下面是需要添加的配置(ipsec不是很熟,直接引用同事之前的配置作为参考):
LAC/LNS:
crypto ipsec transform-set CCNP esp-3des esp-md5-hmac
mode transport
!
crypto isakmp policy 10
encr 3des
hash md5
authentication pre-share
!
crypto map vpn 10 ipsec-isakmp profile CCIE
set transform-set CCNP
!
crypto isakmp key cisco address 12.1.1.2(LAC)/12.1.1.1(LNS)
!
vpdn-group 1
l2tp security crypto-profile CCIE
!
interface FastEthernet1/0
crypto map vpn

相关文章:

L2TP Tunnel Setup and Teardown – tunnel建立全过程及流程详解,没有配置
用Dynamips模拟CISCO L2TP隧道实验 – 里面的图画不错
How to Configure Layer 2 Tunnel Protocol Authentication with TACACS+ – 老配置,用异步口拨号,LAC和LNS都分配地址,不明白,有认证的详细过程
PPPoE Server实验 – 关于PPPOE及NAT的配置(PC跟dynamips用以太连接)
Dynamips ADSL实验之一pppoeoa(工大瑞普修正版) – 文章中的环境是router–modem–atm–isp router,涉及ATM的桥接模式,没有介绍路由模式,在目前来看,router和modem已经可以继承在一个设备里了

本文出自 Frank's Blog

版权声明:


本文链接:L2TP – 独立LAC测试分析
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接
你可以留言,或者trackback 从你的网站

留言哦

blonde teen swallows load.xxx videos