Necessary configuration on the operating system level for NetBSD includes availability of the "tun" pseudo device in the kernel, which is the default in the GENERIC kernel. In the Linux kernel, it can be enabled as "Universal tun/tap Device Driver" under "Network Device Support".
Another thing to note is that with vpnc version 0.2 and later, IPSEC support should not be included in the kernel, as vpnc does all the processing in userland. For NetBSD, the "IPSEC" and "IPSEC_ESP" options should be removed from the kernel config file. Again, this is already the case in the NetBSD's GENERIC kernel, so no change is needed. Aparently this problem does not arise in Linux, and IPSEC can stay in your kernel.
On Linux, /dev/net/tun has to exist, which should be the case if the tun device is loaded or enabled in the kernel and devfsd is used. Under NetBSD, the corresponding device is already included in the default installation, so no special steps are necessary. On both systems, the "Interface name" is "tun0".
The example vpnc configuration file for both NetBSD and Linux assumes the Novell/NDS-based account names of the University of Regensburg. Instead of the account name "abc12345.5.stud" (not including any NDS context like "uni-regensburg.de" or "fh-regensburg.de") use your own login. Use your own password instead of SECRET. The "IPSec secret" acts as sort of a group password, it can be retrieved from your VPN administrator. For the University of Regensburg, it can be learned by telephone (+49 941 943 4848) from Karl Wuerfl, or by looking at the (access restricted!) online documentation of the VPN setup at https://www-soft.uni-regensburg.de/dist/cisco/vpn/client/. Last, before firing up your VPN, you may want to make sure you have decent internet connectivity, either through via some ethernet or wavelan. In the latter case, you may want to set your wireless LAN network ID first, and grab an IP number from your DHCP server. To do that on NetBSD for the University of Regensburg's WaveLAN, run
# ifconfig wi0 ssid unifunk1 # dhclientto do the same on Linux, try:
# iwconfig eth1 essid unifunk1 # dhcpcd -D eth1Exact parameters may depend on your network configuration and Linux distribution, the above example goes for Gentoo Linux.
Interface name tun0 IKE DH Group dh2 Perfect Forward Secrecy nopfs IPSec gateway vpngate-internet.uni-regensburg.de IPSec ID internet IPSec secret PhoneKarlWuerflAt4848 Xauth username abc12345.5.stud Xauth password SECRET
Interface name tun0 IKE DH Group dh2 Perfect Forward Secrecy nopfs IPSec gateway vpngate-wlan.uni-regensburg.de IPSec ID wlan IPSec secret PhoneKarlWuerflAt4848 Xauth username abc12345.5.stud Xauth password SECRET
# vpnc VPNC started in background (pid: 16196)...The following command can be used to determine the IP-number which is used to access the VPN:
# ifconfig tun0 tun0: flags=51The IP-number here is 132.199.212.1 - this can change for every new start of of the vpnc client, and will most likely be very different for your site's VPN setup.mtu 1412 inet 132.199.212.1 -> 132.199.212.1 netmask 0xffffffff
route add -net 132.199.0.0 -interface 132.199.212.1On Linux, you use:
route add -net 132.199.0.0 netmask 255.255.0.0 dev tun0That way, machines at the university can be reached using the "short" way via the VPN. 132.199.0.0 is the network of the University of Regensburg, 132.199.212.1 is the IP number assigned to the tun0 interface by vpnc. Adjust as necessary!
route delete -net 132.199.0.0 echo "pass out on ppp0 to tun0 from 132.199.212.1 to any" | ipf -fAgain, 132.199.212.1 is the IP-number assigned to the local tun0 interface by vpnc, and ppp0 is the outgoing local network interface (may be wi0 for wireless LAN).
route add -net default -interface 132.199.212.1On Linux, use:
route add -net default dev tun0As before, 132.199.212.1 is the IP-number assigned to the tun0 interface by vpnc, please adjust as necessary.
Interface name tun0 IKE DH Group dh2 Perfect Forward Secrecy nopfs IPSec gateway vpngate-wlan.uni-regensburg.de IPSec ID pda IPSec secret PhoneKarlWuerflAt4848 Xauth username abc12345.5 Xauth password SECRET
network={ ssid="802.11i" key_mgmt=WPA-EAP eap=TTLS identity="abc12345" password="MyNovellNDSPassword" phase2="auth=PAP" }For this to work, the network card must be registered once. This can be done online by joining the "unifunk1" WLAN and accessing a random site.
After starting wpa_supplicant(8) with the above config file and some waiting (check ifconfig output!), running dhclient(8) gives an IP number etc. No additional software needed, tested with NetBSD 4.0_BETA2/i386.