PIROVANO
1 Alix Slackware
1.2 Internet-Access
If you have more than one RJ-45 LAN-connection on your alix or PC-Router in general, it's nice to connect one of them to your Internet-Gateway/DSL-Router/Cable-Modem directly/exclusively.
The Gateway way
Using DHCP:
vi /etc/rc.d/rc.inet1.conf
For the appropriate Interface eth0..eth1...etc. the entry should look like this:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
Using static IP:
You may leave the current IP-Address, modify or setup an additional Interface if present.
vi /etc/rc.d/rc.inet1.conf
# Config information for eth0:
IPADDR[0]="192.168.0.1"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]=""
DHCP_HOSTNAME[0]=""
# Default gateway IP address:
GATEWAY="192.168.0.2"
vi /etc/resolv.conf
nameserver 192.168.0.2 # Gateway is able to resolve DNS, otherwise
nameserver xxx.xxx.xxx.xxx # IP of your prefered DNS-Server or your ISP's.
nameserver xxx.xxx.xxx.xxx # More than one nameserver possible.
By the way, starting/stoping an interface:
/etc/rc.d/rc.inet1 eth0_start
/etc/rc.d/rc.inet1 eth0_stop
/etc/rc.d/rc.inet1 eth0_restart
Caution handling with an interface you are connected with over ssh.
Using pppoe for having a public IP on your alix/PC
Altough it's possible having your pppoe-device (DSL-Router) and other Computers connected togheter with a switch/hub, you really should get a separate Interface for this.
Put your DSL-Router into Bridge-Mode first by connecting with Telnet or http.
Example-Image DSL-Router doing pppoe itself.
Example-Image DSL-Router in Bridge-Mode allowing other device logging into your ISP.
Ensure no Gateway-Address is present in /etc/rc.d/rc.inet1.conf.
Type pppoe-setup and follow instructions. When it comes to DNS Information, type server.
Caution!!! FIREWALLING: If you let pppoe setup Firewall in it's basic configuration, you WILL lose connection to your alix
and a power-cycle will be needed! (In case you did a miss-configuration which is
beeing loaded at boot/startup und won't give you access to your router at all,
boot your slackware-image with WMware, mount the CF and edit/correct the very
file/entry).
This won't matter if you do this setup on a PC with Screen and Keyboard having access.
We might have access to alix over serial-connection as well, but i've never tried that.
(ttyXX has to be started (edit some .conf files) during kernel-boot.
Successfully tested with OpenBSD only).
Let's say NONE to Firewalling and we'll setup a little firewall script later on.
pppoe-start now establishes an internet connection and creates ppp0 interface with public IP.
If you want it run at system-startup put pppoe-start into /etc/rc.d/rc.local.
Let's block any incoming Internet traffic, but still letting us surf the web
vi /etc/rc.d/rc.firewall
iptables -F
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i ppp0 -j DROP #In case you have eth0 etc. with public IP (i.e. Cable-Modem), you may want to put -i eth0 -j DROP as well.
:write :quit
chmod 755 /etc/rc.d/rc.firewall
/etc/rc.d/rc.firewall
Copyright 2009 pirovano.ch. Last modified 2009-08-07 2340 CEST.
E-Mail: pirovano(at)[this-very-domain]