The configuration files for vTun are a bit different for the client(mia) and
Server(zidler). Below I list these files.
The explanations for various options are explained within the file (so one should read the comments).
If in doubt,make full use of man vtund.conf.
The below configuration will set up an IP tunnel. If you would like to use PPP to set up the tunnel, take a look at
this document
shashank@zidler:~> cat /etc/vtund.conf
options {
# type stand; # stand(default), inet (used only at server)
port 5000; # Server will listen on this port for incoming requests.
syslog daemon; # Syslog facility
# Path to various programs
ppp /usr/sbin/pppd; #Path to the pppd. Use "which pppd" to find this.
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/iptables;
ip /sbin/ip;
}
# Default session options
default {
# type tun; #tun, ether, tty(default), pipe (Used only at Server)
# proto tcp; #udp, tcp(default) (Used only at server)
# device tun0;
compress no; # no, yes, zlib:(1-9), lzo:(1-9); e.g. zlib:1 (default) (Used only at server)
encrypt yes; #yes, no (used only at server)
stat yes; #yes, no: check /var/log/vtund/SessionName_X
speed 0; #By default maximum speed, NO shaping (Used only at server)
# keepalive yes; #Used to keep alive the connection. (Used only at server)
}
# TUN example. Session 'cobra'.
IP-Tunnel {
passwd abcd1234; # Password
type tun; # IP tunnel
proto tcp; # UDP protocol
compress lzo:9; # LZO compression level 9
encrypt yes; # Encryption
keepalive yes; # Keep connection alive
stat yes; #yes, no
up {
# Connection is Up
# 10.3.0.1 - local, 10.3.0.2 - remote
ifconfig "%% 192.168.254.201 pointopoint 192.168.254.200 mtu 1450";
route "add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.254.200";
};
down {
# Connection is down
# 10.3.0.1 - local, 10.3.0.2 - remote
ifconfig "%% down";
route "del -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.254.200";
};
}
---------------------------------------------------------
shashank@mia:~> cat /etc/vtund.conf
options {
port 5000; # Listen on this port.
syslog 7; # Syslog facility
# Path to various programs
ppp /usr/sbin/pppd;
ifconfig /sbin/ifconfig;
route /sbin/route;
firewall /sbin/tables;
ip /sbin/ip;
}
# Default session options
default {
# type tun; #tun, ether, tty, pipe
# proto tcp; #udp, tcp
compress no; # no, yes, zlib, lzo
encrypt yes; #yes, no
stat yes; #yes, no
speed 0; # By default maximum speed, NO shaping
}
# TUN example. Session 'cobra'.
IP-Tunnel {
passwd abcd1234; # Password
type tun; # IP tunnel
proto udp; # UDP protocol
compress lzo:9; # LZO compression level 9
encrypt yes; # Encryption
keepalive yes; # Keep connection alive
# persist yes;
up {
# Connection is Up
ifconfig "%% 192.168.254.200 pointopoint 192.168.254.201 mtu 1450";
route "add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.254.201";
};
down {
# Connection is down
ifconfig "%% down";
route "del -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.254.201";
};
}
Note how I have added/deleted routes in the two files.