Friday, December 16, 2005

mixing libstdc++5 and 6 causes problems

My favourite IM module SCIM started crashing applications after a "apt-get upgrade", i found that scim in debian etch is linked with libstdc++5, so it works fine with any applications that link with the same version of libstdc++, as scim gtk im module is loaded as a shared library, if it attaches to any libstdc++6 process, it'll be a mix of v5 and v6, segmentation fault... there are quite a few apps even firefox 1.0.7 links with libstdc++6, which breaks ABI compatibility with v5. Checked my fedora core 4 box at work, all apps are using v6, so scim works flawlessly. I guess debian is still in a transition from libstdc++5 to libstdc++6.

Sunday, December 11, 2005

Connecting to Windows VPN from Debian

Tired of using the PPTP Client GUI? Here's how I did it without the GUI. I really don't like the old GTK 1.x based GUI, and the way how resolv.conf is handled by the GUI.

# install packages
apt-get install ppp pptp-linux resolvconf

# create options.pptp
echo "lock noauth nobsdcomp nodeflate usepeerdns" > /etc/ppp/options.pptp

# create chap-secrets
echo "DOMAIN\\USERNAME PPTP PASSWORD *" > /etc/ppp/chap-secrets
chmod o-rw /etc/ppp/chap-secrets

# create /etc/ppp/peers/TUNNEL-NAME with the following content
pty "pptp SERVERIP --nolaunchpppd"
name DOMAIN\\USERNAME
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam TUNNEL-NAME

# activate the tunnel
pon TUNNEL-NAME

# deactivate the tunnel
poff TUNNEL-NAME

# debug the tunnel with:
pon TUNNEL-NAME debug dump logfd 2 nodetach

# add the tunnel to /etc/network/interfaces with the following content
iface vpn inet ppp
provider TUNNEL-NAME

# create /etc/ppp/ip-up.d/TUNNEL-NAME as follows
#!/bin/sh
if [ "${PPP_IPPARAM}" = "TUNNEL-NAME" ]; then
route add -net 192.168.0.0/24 dev ${IFNAME}
fi

# after you've installed resolvconf, the name servers are managed by
# the resolvconf program based on the status of the interfaces, so
# if you have a static interface, make sure you add your default name
# server to your interface config in /etc/network/interfaces, e.g.
iface eth0 inet static
...
dns-nameservers YOUR_NAME_SERVER


Now you can connect to the VPN server by:

ifup vpn

And disconnect from the VPN server by:

ifdown vpn

And if you want, add this line to /etc/network/interfaces, so that the system will bring the interface up automatically.

auto vpn