Ubuntu LAN Router

Ubuntu LAN Router

Ubuntu LAN Router

In this article you will learn to setup your very own ubuntu router web gateway. The ubuntu router / gateway will act precisely like any other router that you may purchase on the store, except your linux box will have more performance and extra security. What you will need to build your Ubuntu Router Internet Gateway:

* Extra pc
* (2) Ethernet cards
* Switch
* Ubuntu 8.04 LTS Server Version
* Putty

This text will explain the right way to setup a fresh set up of Ubuntu 10.04 server version, configuring a dhcp server for a local network,whereas a together with a firewall from the nasty internet. The first thing that you will do is a contemporary set up of the Ubuntu server edition, however selecting only Open SSH server during the software set up section of the Ubuntu install. After the installation completes and your computer reboots, you are then going to need to set a root password (su).

sudo passwd root

After you have a set a root password, login into root by typing the following command:

su

After you are in tremendous consumer mode (root) we are then going to wish to update our Ubuntu Bistro. Kind the next commands to replace the os and different programs.

apt-get update

apt-get upgrade

After your pc updates, restart it.

reboot

Setup Network Cards

vi /etc/network/interfaces

Within the example below my eth0 represents the network interface that connects to the web and the eth1 interface hooksto the switch. The change then connects to all your other networked devices, reminiscent of your gaming system and other networked devices. I added the following code into the /etc/network/interfaces file:

Vi /etc/network/interfaces

auto eth1

iface eth1 inet static

address 192.168.10.1

netmask 255.255.255.0

network 192.168.10.0

broadcast 192.168.10.255

/etc/init.d/networking restart

The next following step shouldnt be required, but I prefer to set a hostname for my gateway, all its important to do is install apache and you possibly can have your own private intranet or net server.

vi /etc/hosts

echo homeserver.gateway.2wire.net > /etc/hostname

/etc/init.d/hostname.sh start

hostname

hostname -f

Ubuntu Hostname

After getting accomplished the following above, you need to use putty to access your linux machine from your windows based mostly pc. This will allow you to copy and paste the following code, to speed up the process of making your linux router. The first thing that its essential to do to make use of putty to configure your Ubuntu gateway, is ready a static ip in your windows machine, since we do not have a dhcp server installed yet. Set a static ip address for Microsoft Vista.For those who dont wish to use putty you may simply type out the rest of the code, putty just makes it easier. Upon getting chosen your terminal program that your are going to use, once more login under root. Its now time to install some software program, that we might want to setup the gateway.

apt-get install dhcp3-server bind9 vim perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl
Enable packet forwarding

vi /etc/sysctl.conf

Uncomment the next line to enable packet forwarding for IPv4

net.ipv4.ip_forward=1

echo 1 > /proc/sys/net/ipv4/ip_forward
Install Webmin

Webmin is anther good program to make use of to configure you ubuntu router and different server applications that you just would possibly use. Should you use webmin, it is possible for you to to simply configure you server, utilizing any web browser you choose.

cd /opt

mkdir webmin

cd /opt/webmin

wget http://prdownloads.sourceforge.net/webadmin/webmin-1.430.tar.gz

tar xzvf webmin-1.430.tar.gz

cd webmin-1.430/

./setup.sh

Throughout installation you can be asked a number of questions, just press enter a number of times. The one thing that you simply wish to change is the port quantity, person identify and password and likewise say yes to SSL.

Ubuntu Webmin
Configure dhcp

Network address - 192.168.10.0

Netmask - 255.255.255.0

Address ranges -192.168.10.100 - 192.168.10.200

After youve entered the the above click on on the create button. It is best to now see a icon that reads 192.168.10.0, click on this new icon and then click on on the Edit Consumer Choices button.

Subnet mask - 255.255.255.0

Default routers - 192.168.10.1

Broadcast address - 192.168.10.255

DNS servers - 192.168.10.1

After youve got the above into the client choices home windows click the save button twice, which should return you to the main Dhcp server window. Inside the dhcp server display screen, you see a button known as Edit Network Interface, click on this button and choose eth1 then click save. Now click on on the Start Sever button, in the event you see no errors, youre good.
Configure firewall

Input:

Accept if input interface is lo

Accept if input interface is eth0 and state of connection is ESTABLISHED,RELATED

Accept if input interface is eth1

Forward:

Accept if input interface is eth0 and output interface is eth1 and state of connection is ESTABLISHED,RELATED

Accept if input interface is eth1 and output interface is eth0

Now that concludes how to build your own Ubuntu Router Internet Gateway.