Integration Points

ProL2TP offers several mechanisms to assist with integrating L2TP functions in a system.

Hook scripts

prol2tpd can execute optional user-provided scripts or applications on specific events.

The script filenames are:

  • /etc/prol2tp/tunnel-created : executed when an L2TP tunnel instance is created
  • /etc/prol2tp/tunnel-up : executed when an L2TP tunnel instance comes up
  • /etc/prol2tp/tunnel-down : executed when an L2TP tunnel instance goes down
  • /etc/prol2tp/tunnel-deleted : executed when an L2TP tunnel instance is deleted
  • /etc/prol2tp/session-created : executed when an L2TP session instance is created
  • /etc/prol2tp/session-up : executed when an L2TP session instance comes up
  • /etc/prol2tp/session-down : executed when an L2TP session instance goes down
  • /etc/prol2tp/session-deleted : executed when an L2TP session instance is deleted

Scripts are run by a prol2tp-scriptd helper process. In busy systems, event scripts might be started in rapid succession. Scripts are serialised for each instance. Scripts are also scheduled to limit the maximum number running at a given time.

See the prol2tpd man page for details.

Event watching

In active systems, it can be useful to quickly monitor activity to see when L2TP and PPP instances come and go. Command line utilities are provided to watch events from prol2tpd and propppd and print events to the terminal.

L2TP events

The prol2tpwatch utility listens for events from prol2tpd.

ubuntu@lns:~$ sudo prol2tpwatch
SESSION CREATED: handle=3 tid=2871686446 sid=2447900232 name='' profile='spp0' pw_profile='pp0'
SESSION UP: handle=3 tid=2871686446 sid=2447900232 peer_tid=65483 peer_sid=1487060649
SESSION DOWN: handle=3 tid=2871686446 sid=2447900232 peer_tid=65483 peer_sid=1487060649 result=3 error=0 message=''
SESSION DELETED: handle=3 tid=2871686446 sid=2447900232

See the prol2tpwatch man page for details.

PPP events

The propppwatch utility listens for events from propppd.

ubuntu@lns:~$ sudo propppwatch
PPP_CREATED_IND: handle=0x193c9c800000000 name='session-4'
PPP_UP_IND: handle=0x193c9c800000000 name='session-4' ifname='ppp0' user='lns' local=10.90.0.10 peer=10.90.0.11 unit=0 linktype=pppoltp local_id=0x8bf5b556 peer_id=0x3dc74aa7
PPP_DOWN_IND: handle=0x193c9c800000000 name='session-4' ifname='ppp0' user='lns' unit=0 linktype=pppoltp reason='User request' reason_code=0 local_id=0x8bf5b556 peer_id=0x3dc74aa7 bytes_in/out=0/0 packets_in/out=0/0 connect_time=3s
PPP_DESTROYED_IND: handle=0x193c9c800000000 name='session-4'

See the propppwatch man page for details.

Extensions

Since L2TP is an extensible protocol, we designed ProL2TP from the ground up so that the core L2TP protocol could be extended or tuned by plugins. If log_level is info or higher, you may see debug messages about these when prol2tpd starts up. There are several extension types:

AVP extensions
these add, remove or modify AVPs in outbound or inbound L2TP messages, or implement vendor-specific AVPs. AVP extensions can be selectively enabled per tunnel using the avp_extensions parameter. For RFC-compliant peers, no avp_extensions should be needed.
Pseudowire extensions
these implement the interface to the dataplane for each pseudowire type. ProL2TP is distributed with pseudowire extensions for ppp, ethernet and vlan pseudowire types using the Linux kernel.
Socket extensions
these implement interfaces to external components, e.g. Linux kernel.

In future versions, an SDK will be available with which third parties can develop extensions. If you are interested in this, please contact your sales representative.

You are reading the manual of ProL2TP: enterprise class L2TP software for Linux systems

Learn more about ProL2TP and register for a free trial

Go