It is currently Sat Dec 15, 2018 5:07 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: something wrong of LNS data flow
PostPosted: Mon Nov 28, 2011 4:11 am 

Joined: Thu Mar 24, 2011 5:08 pm
Posts: 8
I've got a lot of problems in building a LNS server. Is there any body get the same problem that: after the session was create between LAC and LNS, the pppd send LCP configure-request to the endpoint, LCP configure-request and LCP configure-ACK can't be handled by the kernel driver, but they were passed to the openl2tpd, exactly to the function l2tp_net_recv_core(). It caused that the ppp link can not be established.

I noticed that, the LAC send packet with src and dst port 1701 in both l2tp control frames and data frames, but LNS send data with source port different when tunnel created.

I used openl2tp 1.8 and pppd 2.4.5. The kernel version is 2.6.38.8 under RHEL. btw, there isn't pppol2tp.ko in the kernel any more, but l2tp_ppp.ko and l2tp_core.ko instead. And in the l2tp driver, l2tp_tunnel_create() was called normally. I added log to l2tp_core.c function l2tp_tunnel_creat() as follows:
tunnel->encap = encap;
printk(KERN_WARNING "tunnel->encap check, current encap = %d, L2TP_ENCAPTYPE_UDP = %d", encap, L2TP_ENCAPTYPE_UDP);

if (encap == L2TP_ENCAPTYPE_UDP) {
/* Mark socket as an encapsulation socket. See net/ipv4/udp.c */
printk(KERN_WARNING "tunnel->encap == L2TP_ENCAPTYPE_UDP, then register to udp protocol.");
udp_sk(sk)->encap_type = UDP_ENCAP_L2TPINUDP;
udp_sk(sk)->encap_rcv = l2tp_udp_encap_recv;
}
the log presented as follows, there is something strange, the two lines of added log are seprated by other information.

Nov 28 10:40:43 yuman ippoold[26577]: Start
Nov 28 10:40:43 yuman kernel: L2TP core driver, V2.0, /usr/src/kernels/linux-2.6.38.8/net/l2tp/l2tp_core.c : 1688
Nov 28 10:40:43 yuman kernel: L2TP netlink interface
Nov 28 10:40:43 yuman kernel: PPP generic driver version, and replaced sucessfully.2.4.2
Nov 28 10:40:43 yuman kernel: NET: Registered protocol family 24
Nov 28 10:40:43 yuman kernel: PPPoL2TP kernel driver, V2.0
Nov 28 10:40:43 yuman openl2tpd[26584]: Start, trace_flags=00000000
Nov 28 10:40:43 yuman openl2tpd[26584]: OpenL2TP V1.8, (c) Copyright 2004-2010 Katalix Systems Ltd.
Nov 28 10:40:43 yuman openl2tpd[26584]: Loading plugin /usr/lib64/openl2tp/ppp_unix.so, version V1.5
Nov 28 10:40:43 yuman openl2tpd[26584]: Using config file: /etc/openl2tpd.conf
Nov 28 10:40:56 yuman openl2tpd[26584]: FUNC: tunl 1369: allocated context using profile 'default', created by network request
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369: SCCRQ received from peer 364
Nov 28 10:40:56 yuman kernel: tunnel->encap check, current encap = 0, L2TP_ENCAPTYPE_UDP = 0
Nov 28 10:40:56 yuman openl2tpd[26584]: FSM: CCE(1369) event SCCRQ_ACCEPT in state IDLE
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369: sending SCCRP to peer 364
Nov 28 10:40:56 yuman openl2tpd[26584]: FSM: CCE(1369) state change: IDLE --> WAITCTLCONN
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369: SCCCN received from peer 364
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369: tunnel authentication succeeded
Nov 28 10:40:56 yuman openl2tpd[26584]: FSM: CCE(1369) event SCCCN_ACCEPT in state WAITCTLCONN
Nov 28 10:40:56 yuman openl2tpd[26584]: FUNC: tunl 1369 up
Nov 28 10:40:56 yuman openl2tpd[26584]: FSM: CCE(1369) state change: WAITCTLCONN --> ESTABLISHED
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369/0: ICRQ received from peer 364
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369/24447: sending ICRP to peer 364/3033
Nov 28 10:40:56 yuman openl2tpd[26584]: PROTO: tunl 1369/24447: ICCN received from peer 364
Nov 28 10:40:56 yuman pppd[26587]: Plugin ippool.so loaded.
Nov 28 10:40:56 yuman pppd[26587]: Plugin pppol2tp.so loaded.
Nov 28 10:40:56 yuman pppd[26587]: Plugin openl2tp.so loaded.
Nov 28 10:40:56 yuman pppd[26587]: pppd 2.4.5 started by root, uid 0
Nov 28 10:40:56 yuman pppd[26587]: using channel 1
Nov 28 10:40:56 yuman pppd[26587]: Starting negotiation on
Nov 28 10:40:56 yuman pppd[26587]: PPPoL2TP options: lnsmode tid 1369 sid 24447 debugmask 0
Nov 28 10:40:56 yuman pppd[26587]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MD5> <magic 0xbf3227b3>]
Nov 28 10:40:56 yuman kernel: tunnel->encap == L2TP_ENCAPTYPE_UDP, then register to udp protocol.


Top
 Profile  
 
 Post subject: Re: something wrong of LNS data flow
PostPosted: Mon Nov 28, 2011 9:38 am 

Joined: Thu Mar 24, 2011 5:08 pm
Posts: 8
I have made a stupid mistake, maybe this will help someone else.

Because the source port of our send packets are not 1701, the udp_sock don't pass packets received with source and destination port both 1701 to the l2tp driver.

All i did to solve this problem is modify tunnel profile as follows:

tunnel profile modify profile_name=xxx \
our_udp_port=1701 \
peer_udp_port=1701


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group