Router Installation and Configuration Manual/Configuring L2TP as LAC

From ImageStream Router Documentation

< Router Installation and Configuration Manual
Revision as of 17:54, 14 January 2010 by Syoder (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

While support for L2TP Access Concentrator (LAC) mode is incomplete, L2TP tunnels and PPP sessions can be manually established to remote L2TP Network Servers (LNS).

L2TP commands must be placed in the local startup script (rc.local) which can be edited from the main menu option 1 (Configuration Menu) => option 1 (Global configuration) => option 4 (Configure rc.local).

Client configuration

rc.local:

!/bin/sh
################################################################################
# rc.local file, use this to setup your boot-time configuration.               #
################################################################################

Extract l2tp
rpc.portmap
modprobe pppol2tp
openl2tpd -u 1701
l2tpconfig ppp profile modify profile_name=default default_route=yes options_file=/etc/l2tp.opts
l2tpconfig tunnel create tunnel_name=tun1 dest_ipaddr=205.159.243.1 secret=mypass persist=yes
l2tpconfig session create tunnel_name=tun1 user_name=client1 user_password=clientpass

Enter the following command from the command line (bash shell) to create the options file that allows the pppd daemon to persist after termination:

client1:/usr/local/sand# echo "persist" > /etc/l2tp.opts

To start up the tunnel and PPP session enter the following command:

client1:/usr/local/sand# /etc/rc.d/rc.local
Extracting l2tp... done
Modified ppp profile default
Created tunnel 47619
Created session 61046 on tunnel tun1

Server configuration

The server will use a standard L2TP LNS mode configuration Router Installation and Configuration Manual/Configuring L2TP as LNS. For this example we will use local authentication instead of RADIUS using the user command in wan.conf.

user client1 password clientpass
!
interface Tunnel0
 tunnel mode l2tp
 tunnel peer name default
 tunnel local name gw01
 tunnel key mypass
 tunnel virtual-template 1
!
interface Virtual-Template1
 ip address 192.168.24.13 255.255.255.248
 peer default ip pool pool1
 ppp authentication pap chap
 mtu 1500
!
ip local pool pool1 192.168.24.14 192.168.24.18

Troubleshooting

eth0      Link encap:Ethernet  HWaddr 00:0C:29:57:CC:7C
          inet addr:205.159.243.30  Bcast:205.159.243.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe57:cc7c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5790333 errors:378 dropped:25 overruns:0 frame:0
          TX packets:2838910 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1516769111 (1446.5 Mb)  TX bytes:448824887 (428.0 Mb)
          Interrupt:18 Base address:0x2000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3835775 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3835775 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:506370077 (482.9 Mb)  TX bytes:506370077 (482.9 Mb)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.24.14  P-t-P:192.168.24.13  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:134 (134.0 b)  TX bytes:30 (30.0 b)

client1:/usr/local/sand# ping 192.168.24.13
PING 192.168.24.13 (192.168.24.13) 56(84) bytes of data.
64 bytes from 192.168.24.13: icmp_seq=1 ttl=64 time=0.616 ms
64 bytes from 192.168.24.13: icmp_seq=2 ttl=64 time=0.491 ms
64 bytes from 192.168.24.13: icmp_seq=3 ttl=64 time=0.000 ms
64 bytes from 192.168.24.13: icmp_seq=4 ttl=64 time=0.000 ms

--- 192.168.24.13 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.000/0.276/0.616/0.280 ms

client1:/usr/local/sand# l2tpconfig tunnel list
   TunId             Peer            Local  PeerTId ConfigId            State
   47619    205.159.243.1   205.159.243.30     1987        1      ESTABLISHED

client1:/usr/local/sand# l2tpconfig session list tunnel_name=tun1
1 sessions on tunnel tun1:-
        61046

client1:/usr/local/sand# l2tpconfig session show tunnel_name=tun1 session_id=61046
Session 61046 on tunnel 47619:-
  type: LAC Incoming Call, state: ESTABLISHED
  created at:  Jan 13 23:03:56 2010
  created by admin: YES, peer session id: 8773
  ppp user name: client1
  ppp user password: clientpass
  ppp interface name: ppp0
  data sequencing required: OFF
  use data sequence numbers: OFF
  trace flags: NONE
  framing types: SYNC ASYNC
  bearer types: DIGITAL ANALOG
  call serial number: 1
  connect speed: 1000000
  use ppp proxy: NO

  Peer configuration data:-
    data sequencing required: OFF
    framing types:
    bearer types:
    call serial number: 1
  data rx packets: 99, rx bytes: 5346, rx errors: 0
  data tx packets: 40, tx bytes: 1387, tx errors: 0
Personal tools
Router software releases