Skip to main content

Building OpenWRT with OpenL2TP

This is just a quick dump of the process of building current git of OpenWRT for OpenL2TP. Complete blog post about OpenL2TP on OpenWRT 2.4 will be available later.


Patched pppol2tp.c, removed NULL assignment to nonexistent iptables structure.

After reflash:

root@OpenWrt:/lib/modules/ insmod pppol2tp
insmod: unresolved symbol udp_prot

udp_prot is exported only when

#if defined (CONFIG_IPV6_MODULE)
  || defined (CONFIG_KHTTPD)
  || defined (CONFIG_IP_SCTP_MODULE)


IPV6 Module is not installed then, but symbol is exported.

root@OpenWrt:/etc/init.d# openl2tpd -R -f -D
Start, trace_flags=00000000 (debug enabled)
OpenL2TP V1.6, (c) Copyright 2004,2005,2006,2007,2008 Katalix Systems Ltd.
Loading plugin /usr/lib/openl2tp/, version V1.5
no entry for l2tp in /etc/services and -u not used
Cleaning up before exiting
Unloading plugin /usr/lib/openl2tp/

So, either /etc/services need to be tweaked (HEY, they are empty)! or -u 1701 must be given.

Disable httpd service:

/etc/init.d/httpd disable

Debugging OpenL2TP:

l2tp> tunnel create dest_ipaddr= tunnel_name=vpn2
l2tp> session create tunnel_name=vpn2 user_password=yyy

pppd 2.4.4 started as

pppd debug kdebug 7 noipdefault sync nodetach user \
password yyy local noauth noaccomp nopcomp nobsdcomp \
nodeflate nopredictor1 novj novjccomp noendpoint nomp noproxyarp \
plugin plugin pppol2tp 18 pppol2tp_tunnel_id 57957 \
pppol2tp_session_id 9843 pppol2tp_debug_mask 15

dies with

: unrecognized option 'nomp'

Reason: openwrt/package/ppp/patches/200-makefile.patch sets HAVE_MULTILINK disabled despite:

# Linux distributions: Please leave multilink ENABLED in your builds

noendpoint is supported, so we remove nomp thing

: Plugin is for pppd version 2.4.5, this is 2.4.4

Reason: INCLUDE_DIR is set in OpenL2TP and it points to system include dir

Changing the Makefile to override INCLUDE DIR as well in openwrt/feeds/packages/net/openl2tp/Makefile


Plugin loaded.
Plugin loaded.
PPPoL2TP kernel driver not installed

Reason: incorrect #define for 2.4 kernel

Session is now OK

See also: