lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] lwip 2.0.2 l2tp init


From: odobryabov
Subject: [lwip-users] lwip 2.0.2 l2tp init
Date: Thu, 29 Jun 2017 05:24:45 -0700 (MST)

Hi everybody!

Could you help with l2tp initialisation. I got an ip from VPN-server but I
can't ping my device with lwip stack.

VPN-server settings:

ip: 192.168.15.2
inner ip: 172.16.200.1
clients ip range: 172.16.200.5-172.16.200.20
mtu\rtu: auto


Initialisation:

#define VPN_IP_ADDR0            192
#define VPN_IP_ADDR1            168
#define VPN_IP_ADDR2            15
#define VPN_IP_ADDR3            2
#define VPN_PORT                        1701    //L2TP port 1701

#define PPP_AUTH_USERNAME       "test2"
#define PPP_AUTH_PASSWORD       "test2"

extern struct netif gnetif;  //ethernet interface 192.168.15.10
        ip_addr_t vpn_ipaddr;
        u16_t vpn_port = VPN_PORT;
        const u8_t *secret = NULL;
        u8_t secret_len = 0;

        IP4_ADDR(&vpn_ipaddr, VPN_IP_ADDR0, VPN_IP_ADDR1, VPN_IP_ADDR2,
VPN_IP_ADDR3);

        ppp = pppol2tp_create(&ppp_netif, &gnetif, &vpn_ipaddr, vpn_port, 
secret,
secret_len, status_cb, NULL);

        if(ppp == NULL)
                return ERROR;

        ppp_set_default(ppp);

        ppp_set_usepeerdns(ppp, 1);

        ppp_set_auth(ppp, PPPAUTHTYPE_MSCHAP_V2, PPP_AUTH_USERNAME,
PPP_AUTH_PASSWORD);

        if(ppp_connect(ppp, 0) != ERR_OK)
                return ERROR;

        return SUCCESS;


Log from the device:

ppp phase changed[1]: phase=0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
pppol2tp: input packet, len=107, tunnel=53427, session=0, ns=0, nr=1
pppol2tp: Assigned tunnel ID 45136
pppol2tp: input packet, len=12, tunnel=53427, session=0, ns=1, nr=2
pppol2tp: input packet, len=28, tunnel=53427, session=47857, ns=1, nr=3
pppol2tp: Assigned session ID 2112
ppp_start[1]
ppp phase changed[1]: phase=6
ppp_send_config[1]
ppp_recv_config[1]
ppp: auth protocols: PAP=0 CHAP=1 CHAP_MD5=1
ppp_start[1]: finished
pppol2tp: input packet, len=12, tunnel=53427, session=0, ns=2, nr=3
pppol2tp: input packet, len=12, tunnel=53427, session=47857, ns=2, nr=4
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: timeout
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
netif_set_mtu[1]: mtu=1450
ppp_send_config[1]
ppp_recv_config[1]
ppp phase changed[1]: phase=7
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
CHAP authentication succeeded: Access granted
CHAP authentication succeeded
ppp phase changed[1]: phase=9
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
sifvjcomp[1]: VJ compress enable=0 slot=0 max slot=0
netif: netmask of interface pp set to 255.255.255.255
netif: GW address of interface pp set to 172.16.200.1
netif_set_ipaddr: netif address being changed
netif: IP address of interface pp set to 172.16.200.5
sifup[1]: err_code=0
status_cb: Connected
  our_ipaddr  = 172.16.200.5
  his_ipaddr  = 172.16.200.1
  netmask     = 255.255.255.255
  dns1        = 192.168.15.2
  dns2        = 192.168.15.2
local  IP address 172.16.200.5
remote IP address 172.16.200.1
primary   DNS address 192.168.15.2
secondary DNS address 192.168.15.2
ppp phase changed[1]: phase=10
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=20, tunnel=53427, session=0, ns=2, nr=4
pppol2tp: input packet, len=20, tunnel=53427, session=0, ns=2, nr=4
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=20, tunnel=53427, session=0, ns=2, nr=4
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=20, tunnel=53427, session=0, ns=2, nr=4
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=0, tunnel=53427, session=47857, ns=0, nr=0
pppol2tp: input packet, len=20, tunnel=53427, session=0, ns=2, nr=4
LCP terminated by peer (User request)
ppp phase changed[1]: phase=9
sifvjcomp[1]: VJ compress enable=0 slot=0 max slot=0
sifdown[1]: err_code=0
ppp phase changed[1]: phase=6
ppp_send_config[1]
ppp_recv_config[1]
pppol2tp: input packet, len=45, tunnel=53427, session=0, ns=3, nr=4
pppol2tp: input packet, len=45, tunnel=53427, session=0, ns=3, nr=4
ppp phase changed[1]: phase=12
Connection terminated.
ppp_link_terminated[1]
ppp_link_end[1]
ppp phase changed[1]: phase=0
status_cb: Connection lost


And log from VPN-server:

Jun 19 00:55:50 xl2tpd[15956]: Connection established to 192.168.15.20,
49153.  Local: 62257, Remote: 53427 (ref=0/0).  LNS session is 'default'
Jun 19 00:55:50 pppd[15959]: Plugin pppol2tp.so loaded.
Jun 19 00:55:50 pppd[15959]: pppd 2.4.7 started by Admin, uid 0
Jun 19 00:55:50 xl2tpd[15956]: Call established with 192.168.15.20, PID:
15959, Local: 23920, Remote: 47857, Serial: -1898463882
Jun 19 00:55:50 pppd[15959]: Using interface ppp10
Jun 19 00:55:50 pppd[15959]: Connect: ppp10 <--> l2tp (192.168.15.20)
Jun 19 00:55:56 pppd[15959]: local  IP address 172.16.200.1
Jun 19 00:55:56 pppd[15959]: remote IP address 172.16.200.5
Jun 19 00:55:57 vpn-server: Enable forwarding for ppp10 interface
Jun 19 00:55:57 vpn-server: Only reqested sessions allow forward back to
tunnel
Jun 19 00:55:57 vpn-server: Add masqrade for client 172.16.200.5 to WAN net
over eth2.2
Jun 19 00:55:57 vpn-server: Add masqrade for client 172.16.200.5 to LAN net
over br0
Jun 19 00:55:57 vpn-server: Dnsproxy allow from ppp10
Jun 19 00:57:21 xl2tpd[15956]: Maximum retries exceeded for tunnel 62257. 
Closing.
Jun 19 00:57:21 xl2tpd[15956]: Connection 53427 closed to 192.168.15.20,
port 49153 (Timeout)
Jun 19 00:57:21 pppd[15959]: Terminating on signal 15
Jun 19 00:57:21 pppd[15959]: Connect time 1.5 minutes.
Jun 19 00:57:21 pppd[15959]: Sent 0 bytes, received 0 bytes.
Jun 19 00:57:21 pppd[15959]: Connection terminated.
Jun 19 00:57:22 pppd[15959]: Exit.
Jun 19 00:57:27 xl2tpd[15956]: handle_avps: Bad exit status handling
attribute 1 (Result Code) on mandatory packet


Thanks in advance!



--
View this message in context: 
http://lwip.100.n7.nabble.com/lwip-2-0-2-l2tp-init-tp30012.html
Sent from the lwip-users mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]