Why Linux is still a pain

December 12, 2007 on 5:31 pm | In Category-less | 1 Comment

So, I’m trying to install OpenVPN on Debian, right?

apt-get install openvpn

Well, it looks like it installs, but upon further inspection, it seems that it didn’t install the TAP/TUN adapter:

ifconfig -a

Argh!

So, I thought I’d download it and compile it from source:

wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
tar -xzvf openvpn-2.0.9.tar.gz
cd openvpn-2.0.9.tar.gz
./configure

But that gives a painful error:

checking for ifconfig... /sbin/ifconfig
checking for ip... /sbin/ip
checking for route... /sbin/route
checking build system type... i686-pc-linuxlibc1
checking host system type... i686-pc-linuxlibc1
checking target system type... i686-pc-linuxlibc1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.

Hmmm, upon inspection of config.log, I see:

/usr/bin/ld: crt1.o: No such file: No such file or directory

A google search of the above text reveals this, with a solution:

apt-get install libc6-dev

Problem solved. I’m starting to remember why I stopped using linux :-)

Update, problem not solved. It turns out I needed the LZO compression:

wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.02.tar.gz

But that needs the g++ compiler:

apt-get install g++

When does it stop?!? :-)

Update: it doesn’t stop:

configure: error: OpenSSL Crypto headers not found.

Google reveals:

apt-get install libssl-dev

Wow, all of that just for ./configure. Hopefully make exits okay…

Update: this is like the post that never dies. LOL.

So, I was able to figure out that the TAP/TUN adapter installed:

limybox:~# lsmod | grep tun
tun 10336 0

I’m not sure if it was my doing (I did run a few commands that openVPN requested I run):

(1) make device node: mknod /dev/net/tun c 10 200
(2a) add to /etc/modules.conf: alias char-major-10-200 tun
(2b) load driver: modprobe tun
(3) enable routing: echo 1 > /proc/sys/net/ipv4/ip_forward

Note that either of steps (2a) or (2b) is sufficient. While (2a)
only needs to be done once per install, (2b) needs to be done once
per reboot.

Anywho, it turns out that with a windows client, the VPN server can push gateway and IP information to the client and windows will change the route table (route print). But with Linux as a client, it ignores the messages from the VPN server, SO, you have to set the route stuff yourself either on startup of openvpn (–ifconfig 192.168.1.160 255.255.255.0), or put that in a config file, or try a script (see http://openvpn.net/howto.html#dhcp).

For those that care, here is my client side config:

remote my.ipaddress.com

port 21
dev tap
ifconfig 192.168.1.160 255.255.255.0
secret static.key
proto tcp-client
comp-lzo

route-gateway 192.168.1.1
redirect-gateway

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. [...] just updated his blog for the first time in nearly a year (a constant source of teasing in our household, since he can [...]

    Pingback by Daisy Chain » Happy Things — December 13, 2007 #

Leave a comment

You must be logged in to post a comment.

Powered by WordPress with Pool theme design by Borja Fernandez.
Entries and comments feeds. Valid XHTML and CSS. ^Top^