学生按照神码的配置手册和实验项目手册做l2tp,结果又么有成。还是信任自己,不信任神码手册,继续总结。。
一、什么是l2tp
l2tp(Layer 2 Tunneling Protocol第二层隧道协议)
L2TP是一种虚拟专用网络协议,已成为IETF有关二层隧道协议的工业标准。L2TP将PPP(Point-to-Point Protocol)帧封装后,L2TP使用的是UDP封装,端口号1701,可通过IP,X.25,帧中继或ATM等网络进行传送。该协议是一种工业标准的Internet隧道协议,功能大致和PPTP协议类似,比如同样可以对网络数据流进行加密。不过也有不同之处,比如PPTP要求网络为IP网络,L2TP要求面向数据包的点对点连接;PPTP使用单一隧道,L2TP使用多隧道;L2TP提供包头压缩、隧道验证,而PPTP不支持。
二、l2tp的一些名词解释
三、具体实验
实验环境中,有两台路由器,R1模拟LAC,R2模拟LNS,目的是为了分支机构和总部之间进行l2tp的通信。192.168.0.0网段为分支机构内网,192.168.1.0网段模拟internet,192.168.2.0模拟总部内网。172.16.1.0网段为l2tp隧道利用。
实验完成后R1的配置文件。
R1_config#
!version 1.3.3H
service timestamps log date
service timestamps debug date
no service password-encryption
!
hostname R1
!
gbsc group default
!
aaa authentication ppp default local ;
!
username 123 password 0 123
!
interface Virtual-tunnel0 ;
ip address 172.16.1.2 255.255.255.0
no ip directed-broadcast
ppp chap hostname 123
ppp chap password 0 123
peer default ip address 172.16.1.1 ;
!
interface FastEthernet0/0
ip address 192.168.0.1 255.255.255.0
no ip directed-broadcast
ip nat inside
!
interface FastEthernet0/3
ip address 192.168.1.1 255.255.255.0
no ip directed-broadcast
ip nat outside
!
interface Serial0/1
no ip address
no ip directed-broadcast
!
interface Serial0/2
no ip address
no ip directed-broadcast
!
interface Async0/0
no ip address
no ip directed-broadcast
!
ip route 192.168.2.0 255.255.255.0 Virtual-tunnel0 ;
!
ip access-list standard 999
permit any
!
vpdn enable
!
vpdn-group 0
request-dialin ;
no domain
protocol l2tp ;
local-name R1 ;
initiate-to ip 192.168.1.2 priority 1 ;
!
!
ip nat inside source list 999 interface FastEthernet0/3 ;
!
实验完成后R2的配置文件。
R2_config#show running-config
正在收集配置...
当前配置:
!
!version 1.3.3H
service timestamps log date
service timestamps debug date
no service password-encryption
!
hostname R2
!
gbsc group default
!
ip local pool 000 172.16.1.50 50 ;
!
aaa authentication ppp default local ;
username 123 password 0 123
!
interface Virtual-template0
ip address 172.16.1.1 255.255.255.0
no ip directed-broadcast
ppp authentication chap ;
ppp chap hostname 123
ppp chap password 0 123
peer default ip address 172.16.1.2 ;
!
interface FastEthernet0/0
ip address 192.168.2.1 255.255.255.0
no ip directed-broadcast
ip nat inside
!
interface FastEthernet0/3
ip address 192.168.1.2 255.255.255.0
no ip directed-broadcast
ip nat outside
!
interface Serial0/1
no ip address
no ip directed-broadcast
!
interface Serial0/2
no ip address
no ip directed-broadcast
!
interface Async0/0
no ip address
no ip directed-broadcast
!
ip route 192.168.0.0 255.255.255.0 Virtual-access0 ;
!
!
ip access-list standard 999
permit any
!
!
!
vpdn enable
!
vpdn-group 0
accept-dialin ;
port Virtual-template0 ;
protocol l2tp ;
local-name default ;
terminate-from R1 ;
!
ip nat inside source list 999 interface FastEthernet0/3 ;
!
R1:显示虚拟接口
R1_config#show interface virtual-tunnel 0
Virtual-tunnel0 is up, line protocol is up ;
Hardware is Unknown device
MTU 1500 bytes, BW 100000 kbit, DLY 10000 usec
Interface address is 172.16.1.2/24
Encapsulation PPP, loopback not set
Keepalive set(10 sec)
LCP Opened
CHAP Opened, Message: ‘ Welcome to Digital China Router‘
IPCP Opened
local IP address: 172.16.1.2 remote IP address: 172.16.1.1 ;
显示路由表项
R1_config#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - BEIGRP, DEX - external BEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type, L1 - IS-IS level-1, L2 - IS-IS level-2
VRF ID: 0
C 172.16.1.0/24 is directly connected, Virtual-tunnel0 ;
C 172.16.1.1/32 is directly connected, Virtual-tunnel0
C 192.168.0.0/24 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet0/3
S 192.168.2.0/24 is directly connected, Virtual-tunnel0 ;
R2:
R2_config# show interface virtual-access 0
Virtual-access0 is up, line protocol is up ;
Hardware is Virtual access interface
MTU 1500 bytes, BW 100000 kbit, DLY 10000 usec
Interface address is 172.16.1.1/24
Encapsulation PPP, loopback not set
Keepalive set(10 sec)
LCP Opened
CHAP Opened, Message: ‘Request timeout‘
IPCP Opened
local IP address: 172.16.1.1 remote IP address: 172.16.1.2 ;
R2_config#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - BEIGRP, DEX - external BEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type, L1 - IS-IS level-1, L2 - IS-IS level-2
VRF ID: 0
C 172.16.1.0/24 is directly connected, Virtual-access0 ;
C 172.16.1.2/32 is directly connected, Virtual-access0
S 192.168.0.0/24 is directly connected, Virtual-access0 ;
C 192.168.1.0/24 is directly connected, FastEthernet0/3
C 192.168.2.0/24 is directly connected, FastEthernet0/0
未完待续。。。。。。。。。。。
本文出自 “crazy_qiao” 博客,请务必保留此出处http://25167.blog.51cto.com/15167/1389129
神州数码路由器上的l2tp实验。,布布扣,bubuko.com
原文:http://25167.blog.51cto.com/15167/1389129