subject: Debian Based Router [print this page] In this article you'll learn how to setup your very own ubuntu router web gateway. The ubuntu router / gateway will act precisely like some other router that you may buy at the store, except your linux field may have more performance and additional security. What you will have 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 best way to setup a contemporary install of Ubuntu 10.04 server edition, configuring a dhcp server for an area network,whereas a including a firewall from the nasty internet. The very first thing that you are going to do is a contemporary install of the Ubuntu server version, however deciding on only Open SSH server in the course of the software installation section of the Ubuntu install. After the set up completes and your computer reboots, you might be then going to wish to set a root password (su).
sudo passwd root
After you will have a set a root password, login into root by typing the following command:
su
After you are in super person mode (root) we're then going to wish to replace our Ubuntu Bistro. Sort the next commands to update 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 instance below my eth0 represents the network interface that connects to the web and the eth1 interface hooksto the switch. The switch then connects to all of your different networked units, akin to your gaming system and different 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 following following step is just not required, however I prefer to set a hostname for my router, all you must do is set up apache and you would 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
Once you have completed the following above, you can use putty to access your linux machine out of your home windows based pc. This can allow you to copy and paste the next code, to hurry up the method of making your linux router. The first thing that it's essential to do to make use of putty to configure your Ubuntu gateway, is ready a static ip on your home windows machine, since we do not have a dhcp server put in yet. Set a static ip deal with for Microsoft Vista.Should you don't need to use putty you'll be able to just kind out the remainder of the code, putty just makes it easier. Once you have chosen your terminal program that your are going to use, once more login beneath root. It is now time to install some software, that we might want to setup the gateway.
Uncomment the next line to allow 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 gateway and different server packages that you may use. In case you use webmin, you will be able to easily configure you server, using any net browser you choose.
During set up you may be asked just a few questions, just press enter a few times. The one thing that you just need to change is the port number, 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 you could have entered the the above click on on the create button. It's best to now see a icon that reads 192.168.10.0, click on on this new icon after which click on on the Edit Shopper 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 you've got the above into the consumer options windows click on the save button twice, which should return you to the primary Dhcp server window. Contained in the dhcp server display screen, you see a button known as Edit Community Interface, click this button and select eth1 then click save. Now click on on the Start Sever button, should you see no errors, you might be 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.