Home arrow Latest Tutorials arrow Configure a Linux Router with Debian
Configure a Linux Router with Debian  
Digg Reddit Ma.gnolia Stumble Upon Facebook Twitter Google Yahoo! MyWeb Furl" BlinkList Technorati Mixx Bookmark

This tutorial is about configuring a Router with Debian Linux.


Step 1.  Install Debian Linux
--------------------------------------

 Download, burn and install CD1 of Debian Linux. Instalation should be minimal because we will add needed packages later.


Step 2. Configure network interfaces
---------------------------------------------------

In our example we will have:

WAN interface: eth0
LAN interface: eth1
WAN IP: 80.80.80.80
WAN subnet: 255.255.255.0
LAN IP: 10.0.0.1
LAN subnet: 255.255.255.0
Gateway: 80.80.80.79


Edit /etc/network/interfaces and add the following lines.

# ---------------------------- /etc/network/interfaces --------------------
auto lo
iface lo inet loopback

# device: eth0
auto eth0
iface eth0 inet static
  address 80.80.80.80
  broadcast 80.80.80.255
  netmask 255.255.255.0
  gateway 80.80.80.79

# device: eth1 auto eth1
iface eth1 inet static
  address 10.0.0.1
  broadcast 10.0.0.255
  netmask 255.255.255.0
# ----------------------------- end --------------------------------------------

Then, save file and restart network services:

/etc/init.d/networking restart


Activate routing between network interfaces by editing /etc/sysctl.conf and adding:

net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1

Also to change options without rebooting you could:

echo 1 > /proc/sys/net/ipv4/ip_forward
for f in /proc/sys/net/ipv4/conf/*/rp_filter ; do echo 1 > $f ; done



 
< Prev   Next >

Misc

Linux Tips

Polls

What is your favorite Linux Distribution ?