VTUN play

We want a "static" IP on an ADSL dynamic IP connection for routing.



Server

vtund.conf
options {
  port 5000;            # Listen on this port.

  syslog        daemon;

  # Path to various programs
  ppp           /usr/sbin/pppd;            
  ifconfig      /sbin/ifconfig;
  route         /sbin/route;
  firewall      /sbin/ipchains;
  ip            /sbin/ip;
}

default {
  compress no;          # Compression is off by default
  encrypt  no;          # Encryption
  speed 32;             # By default maximum speed, NO shaping
  keepalive yes;        # Keep connection alive
  stat yes;
}

myconnection {
  passwd  MyPassword;   # Password
  type  tun;            # IP tunnel 
  proto tcp;            # TCP protocol

  up {
        ifconfig "%% 10.3.0.2 pointopoint 10.3.0.1 mtu 1450";
  };

  down {
        ifconfig "%% down";
  }

}

This is usually started on boot of the server (daemon):
[server] # vtund -s


Client

vtund.conf
options {
  port 5000;            # Connect to this port.
  timeout 60;           # General timeout

  # Path to various programs
  ppp           /usr/sbin/pppd;            
  ifconfig      /sbin/ifconfig;
  route         /sbin/route;
  firewall      /sbin/iptables;
  ip            /sbin/ip;
}

default {
  compress no;          # Compression is off by default
  encrypt  no;          # Encryption
  speed 32;             # By default maximum speed, NO shaping
  keepalive yes;        # Keep connection alive
  stat yes;
}

myconnection {
  passwd  MyPassword;   # Password
  type  tun;            # IP tunnel
  proto tcp;            # TCP protocol

  up {
        ifconfig "%% 10.3.0.1 pointopoint 10.3.0.2 mtu 1450";
  };

  down {
        ifconfig "%% down";
  }

}

In one shell create the tunnel:
[client] $ ssh -L 5000:localhost:5000 server.somesite.com

Start up vtund to connect to the local end of the tunnel:
[client] # vtund myconnection localhost


Document History
Mon Mar 29 07:48:02 NZST 2004 c.mills Created
Clark Mills c.mills@auckland.ac.nz