Sections
|
 |
 |
 |
Configuring ADSL
Nota bene
In The Netherlands there are now, as far as I know, two different ways in which
ADSL users have to configure their machines. One is without hassles (good!) and
one is with hassles (bad!).
The without-hassle method below is valid for people connecting to Demon in
The Netherlands. Please inform me of other ISPs implementing this method.
The with-hassle method below is valid for Alcatel ADSL modems as provided by the
Dutch ISP Planet Internet.
People with an ADSL connection from the Austrian ISP Inode
should encounter no problems, but they may not be (entirely) correct for Other ISP's, in
The Netherlands or abroad.
ADSL without hassles
Say you have an external interface called rl0. While installing
OpenBSD, configure the interface rl0 by typing "dhcp" when asked for
an IP address. If you've already a running install, you can edit /etc/hostname.rl0.
That file should exist of only one line reading "dhcp".
This is pretty much it. If you're editing /etc/hostname.rl0 after you
installed OpenBSD, you should either reboot or run route flush && sh -x /etc/netstart.
OpenBSD asks via the DHCP protocol your ISP to provide your machine with an IP
address, gateway, DNS servers, etc. You might not like everything you receive
from the remote DHCP daemon, so you might have to edit /etc/dhclient.conf
in order to override some of the options the DHCP daemon whispers in your DHCP client's ear:
supersede host-name "aurora";
supersede domain-name "intranet.hezeldrama.net";
prepend domain-name-servers 127.0.0.1;
Above three lines tell the DHCP client to use "aurora" as the hostname of
the machine, "intranet.hezeldrama.net" as its domain name and to setup
/etc/resolv.conf in such a way that the first nameserver
line reads "127.0.0.1". The last option is required only if you'd like
to run your own caching DNS server on the localhost (= 127.0.0.1).
ADSL with hassles
- Reconfigure and recompile your kernel if you run the GENERIC OpenBSD kernel or a custom one, built with GRE
(Generic Route Encapsulation) support. GRE eats the packets that are actually meant for the PPTP daemon software
we're about to use, resulting in a not working ADSL connection and the following error:
LCP: timeout sending Config-Requests.
So search for the line pseudo-device gre 1 in your kernel configuration file and disable it by putting
a hash-sign (#) in front of that line. See the section updating for more information on recompiling
your kernel.
Doing sysctl -w net.inet.gre.allow=0 does not work. Reconfigure & Recompile(tm).
- Now you configure the network interface connected to your modem. Create or edit for this
/etc/hostname.<if>, where if is the devicename of the interface:
inet 10.0.0.150 255.0.0.0 NONE
- Download PPTP software from packetst0rm
(PureBSD mirror).
Extract the source, run
make and copy pptp and pptp_callmgr to /usr/sbin.
- Edit
/etc/ppp/options to read the following:
name "LOGINNAME"
noauth
noipdefault
defaultroute
debug
Replace LOGINNAME with the loginname/username/user-id that you
need to dial-in to your ISP.
- Edit
/etc/ppp/pap-secrets to read the following:
LOGINNAME 10.0.0.138 PASSWORD
Replace LOGINNAME with the loginname/username/user-id that you
need to dial-in to your ISP. The same goes for PASSWORD.
- If you do not run your own (caching) nameserver, you may like to edit
/etc/resolv.conf
to use the nameservers of your ISP:
search speed.planet.nl
nameserver 195.121.1.34
nameserver 195.121.1.66
- Run
pptp 10.0.0.138 to login to your ISP. The ADSL internet link
should now be up.
- Credits:
Michael Kummer for his OpenBSD ADSL howto
Lukas Ertl for his FreeBSD ADSL howto
ADSL with hassles: Afterwards
- For OpenBSD versions below 3.0:
If you'd like to use NAT over your ADSL connection, disable the ipnat in your
/etc/rc.conf, since ppp0 is not a valid configured interface at the time
when /etc/netstart is run. Though ipfilter should be enabled.
ipfilter=YES
ipnat=NO
Only when your ADSL connection is running and ppp0 is configured you should run:
/sbin/ipnat -CF -f /etc/ipnat.conf
For OpenBSD versions above 2.9:
You're probably running PF and not IPFilter. I'm not sure if you need to do
special things in order to have NAT work automatically when connected to
the internet via de ADSL line. I'll ask around.
- You could optionally download this ADSL reconnect script
from packetst0rm and run it from crontab to reestablish a broken connection.
But that's not a usable script.
Don't panic! I wrote one myself. Though it is very brutal, it does reconnect in all possible situations
as far as I know. Packetst0rm's script didn't.
- View adsl_reconnect.sh
- Download adsl_reconnect.sh (gzipped)
The only thing you should configure is the REMOTE_IP variable, which is the IP address of the remote end of
your PPTP tunnel. This IP can be found easily when ADSL is running:
$ ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
inet 62.131.xx.yyy --> 195.190.aaa.bbb netmask 0xff000000
Here, the "195.190.aaa.bbb" is the value you should assign to the REMOTE_IP
variable.
Note: some ISPs drop/block ping packets directed to the remote end of the PPTP tunnel or most if not all of
their other servers. So it is advised to check if the IP you'd like to use is returning ping packets before using
it in the reconnect script.
To have that reconnection script executed every five minutes you could edit root's crontab
and insert the following somewhere:
# Check ADSL connection
*/5 * * * * /root/bin/adsl_reconnect.sh > /dev/null
|