next up previous
Next: About this document Up: PPP and IP tunneling Previous: The sk_tunnel Kernel Framework

User space Utilities

A user space utility x25tnl is provided for performing standard administration and connection control tasks.

Raw IP Tunneling

For raw IP tunnels, a tunnel network interface must be created first. This can be done by

x25tnl -m 1

This will create a network device named sktn0001. It needs to be set up as usual by ifconfig up and by creating appropriate routes which use that interface.

Finally, establishing an X.25 connection to a peer and using that connection for tunneling IP traffic (to be routed through or received from the tunnel network interface sktn0001) can be done by

x25tnl -c 1234567890 -d 1 &

This tries to establish an X.25 connection to the remote X.25 peer with the X.25 address 1234567890 by means of the connect() system call. If the peer accepts the connection, the connection will be attached to the tunnel network interface sktn0001. After that, full IP connectivity to the peer is available.

It is also possible to wait passively for incoming connections (server mode). If the X.25 address of our local host is 9876543210, this will be done by

x25tnl -b 9876543210 -d 1

This will wait for an incoming connection to X.25 address 9876543210. The connection will be accepted, and if it appears to be an IP-over-X.25 tunnel, it is attached to the tunnel network interface sktn0001. (IP-over-X.25 tunnels are recognized by means of a special X.25 Call User Data [CUD] field in the connect request. This CUD value is used to distinguish between different services - comparable to a well known port number in TCP/IP).

PPP Tunneling

In contrast to raw-IP tunnels above, this needs assistance from pppd after the connection is up. The current implementation supports this by establishing the X.25 connection. After that, the socket connection is redirected to stdin and then pppd is executed from the x25tnl utility. This is similar to using pppd with stdin attached to tty device. (Current pppd needs a little patch in order to bypass tty related checks and set up). Outgoing PPP tunnels can be created by, e.g.,

x25tnl -c 1234567890 -p -e 'pppd default-asyncmap noaccomp'

The difference to the raw-IP version above is: instead of the '-d 1' option (which means 'attach to device sktn0001') there is the '-p' option (which means 'attach to ppp_generic'). And then there is the '-e' option which takes a string argument. This string is interpreted as a shell command. When the '-e' option is present, then, after the connection is successfully established, the socket file descriptor is redirected to stdin and the command in the option's argument is executed.


next up previous
Next: About this document Up: PPP and IP tunneling Previous: The sk_tunnel Kernel Framework

Henner Eisen
Tue Sep 26 22:25:35 MEST 2000