tc-bmobile_l2tp-20041028-KuntzR.txt Setup L2TP and b-mobile on Debian GNU/Linux v1.1 - Last updated 2005-02-17 ----------------------------------- Romain Kuntz kuntz(at)sfc.wide.ad.jp In order to enjoy IPv6 connectivity with b-mobile or AirH cards on Linux, you can use for exemple L2TP, as explained below. 1. Kernel configuration ----------------------- You need 2 modules, n_hdlc and ppp_synctty. Verify you have them with the modinfo command, otherwise you need to compile them. bender:/home/kuntz# modinfo n_hdlc filename: /lib/modules/2.4.25-1-686/kernel/drivers/char/n_hdlc.o description: author: license: "GPL" parm: debuglevel int parm: maxframe int bender:/home/kuntz# modinfo ppp_synctty filename: /lib/modules/2.4.25-1-686/kernel/drivers/net/ppp_synctty.o description: author: license: "GPL" Load these modules: bender:/home/kuntz# modprobe n_hdlc bender:/home/kuntz# modprobe ppp_synctty 2. Softwares ------------ You need pppd included in the ppp package. Install it if you do not have it yet. Here is some informations about the package I used for these tests: bender:/home/kuntz# dpkg -l ppp ||/ Name Version Description +++-===================-===================-======================================== ii ppp 2.4.2+20040428-2 Point-to-Point Protocol (PPP) daemon You also need L2TP. Get "rp-l2tp" from sourceforge: http://sourceforge.net/projects/rp-l2tp/ Compile it: kuntz@bender:~/dump/rp-l2tp-0.4$ ./configure && make Install it (as root): bender:/home/kuntz/dump/rp-l2tp-0.4# make install 3. Configurations ----------------- * L2TP configuration: Go to the /etc/l2tp directory. Edit the l2tp-secrets file as here: #### BEGIN #### # Secrets for authenticating l2tp tunnels # for hosts refusing to authenticate themselves "" * "" * #### END OF FILE #### Edit the l2tp.conf file as here: #### BEGIN #### # Global section (by default, we start in global mode) global # Load handlers load-handler "sync-pppd.so" load-handler "cmd.so" # Bind address listen-port 1701 # Sync-pppd handler configuration section sync-pppd lac-pppd-opts "call l2tp" # Peer section for our lns (replace with you l2tp server) # Change the port if needed section peer peer port 1701 lac-handler sync-pppd lns-handler sync-pppd hide-avps no # Configure the cmd handler. You MUST have a "section cmd" line # even if you don't set any options. section cmd #### END OF FILE #### * PPP configuration: Go to the /etc/ppp directory. Edit the options file as here: #### BEGIN #### auth lock dump #### END OF FILE #### Edit the peers/wvdial as here: #### BEGIN #### noauth name wvdial usepeerdns noipx lcp-echo-interval 30 lcp-echo-failure 4 hide-password modem proxyarp asyncmap 0 crtscts #### END OF FILE #### Edit the peers/l2tp file as here: #### BEGIN #### noauth unit 1 +ipv6 ipv6cp-accept-local 1 noip #very important:preventing l2tp recursion ipparam "l2tp" # Terminate the connection if the lower link is dead lcp-echo-interval 60 lcp-echo-failure 4 debug kdebug 1 #### END OF FILE #### 4. Connection ------------- Configure b-mobile or AirH for Linux (see tc-bmobile_setup-20041015-KuntzR.txt). Start bmobile (as root): bender:/home/kuntz# wvdial Start l2tpd (-f is for foreground) bender:/home/kuntz/dump/rp-l2tp-0.4# l2tpd -f Start the session ( is the address of your l2tp server) bender:/home/kuntz# l2tp-control "start-session " OK 45907 46519 You can get informations about current sessions, in order to check that everything is OK: bender:/home/kuntz# l2tp-control "dump-sessions" OK NumL2TPTunnels 1 Tunnel MyID 45907 AssignedID 41769 NumSessions 1 PeerIP State established Session LAC MyID 46519 AssignedID 48786 State established You should get a new ppp1 interface with an IPv6 address, you can now enjoy IPv6 with b-mobile ! kuntz@bender:~$ ping6 www.kame.net PING www.kame.net(orange.kame.net) 56 data bytes 64 bytes from orange.kame.net: icmp_seq=1 ttl=62 time=279 ms 64 bytes from orange.kame.net: icmp_seq=2 ttl=62 time=271 ms 64 bytes from orange.kame.net: icmp_seq=3 ttl=62 time=300 ms 5. Deconnection --------------- To close one tunnel (tid is tunnel ID, sid is session ID), use: bender:/etc/l2tp# l2tp-control "stop-session tid sid" From the exemple above, we can close it with: bender:/home/kuntz# l2tp-control "stop-session 45907 46519" OK Session stopped To close all tunnels and exit l2tpd, use: bender:/etc/l2tp# l2tp-control "exit" You can close wvdial with ctrl+c -- Any questions? Please mail me: kuntz(at)sfc.wide.ad.jp