fbtunnel © Rick Payne rickp@rossfell.co.uk $Id: config.html,v 1.12 2003/08/08 20:33:51 rickp Exp $ |
Please see the Route and Tunnel links above to see how I configure my FireBrick®
$ sudo mkdir /dev/netIf you don't use 'sudo' - then just su to root first. Invoke fbtunnel as root giving it the remote tunnel-id (the tunnel number on the firebrick), the secret you configured, your local IP address and the IP address of the FireBrick®. For example
$ sudo mknod /dev/net/tun c 10 200
$ sudo chmod 0700 /dev/net/tun
$ sudo fbtunnel 2 mysecret 10.1.1.1 192.168.1.1The tunnel is up, using tun0 and the interface is up - things are good! Once the tunnel is up I usually then edit the routing table like this:
Tunnel is using tun0
Tunnel pid is 8877
$
$ ifconfig tun0
tun0 Link encap:Point-to-Point Protocol
inet addr:10.1.1.1 P-t-P:10.1.1.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
$ sudo ip route add 192.168.1.1/32 via my-gateway-ipAll traffic should now be flowing over the tunnel interface. Whether you do that or not is up to you. Once you've finished, you can bring the tunnel down:
$ sudo ip route replace default dev tun0
$ sudo kill -2 8877
$ ifconfig tun0
tun0: error fetching interface information: Device not found
$ sudo fbtunnel 2 mysecret 10.1.1.1 192.168.1.1The code to configure the tun interface is missing at the moment (see the bug list). So for now, configure the tun interface manually. You need to supply a tunnel destination address, so just use '1.1.1.1':
Can't set ip on tun0 just yet, please do it manually
Tunnel is using tun0
Tunnel pid is 5178
$ Can't mark tun0 as up just yet, please do it manually
$
$ ifconfig tun0
tun0: flags=10<POINTOPOINT> mtu 1500
$ sudo ifconfig tun0 10.1.1.1 1.1.1.1 upThen modify the routing table using the route command:
$ ifconfig tun0
tun0: flags=51<UP,POINTOPOINT,RUNNING> mtu 1500
inet 81.2.69.128 --> 1.1.1.1 netmask 0xff000000
$ sudo route add -host 192.168.1.1 my-gateway-ip
$ sudo route delete -net 0.0.0.0
$ sudo route add -net 0.0.0.0 -link tun0