Board logo

subject: Ubuntu Gateway Router [print this page]


On this article you'll learn how to setup your very own ubuntu router internet router. The ubuntu router / router will act exactly like any other router that you would be able to purchase at the store, besides your linux field will have extra performance and further security. What you have to to construct your ubuntu router:

* Extra computer

* (2) Ethernet cards

* Switch

* Ubuntu 8.04 LTS Server Edition

* Putty

This text will explain the right way to setup a recent set up of Ubuntu 10.04 server version, configuring a dhcp server for an area community,while a together with a firewall from the nasty internet. The first thing that you are going to do is a contemporary set up of the Ubuntu server version, but selecting only Open SSH server through the software program installation part of the Ubuntu install. After the set up completes and your pc reboots, you might be then going to want 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're in super person mode (root) we're then going to need to replace our Ubuntu Bistro. Sort the next instructions to update the os and other programs.

apt-get update

apt-get improve

After your pc updates, restart it.

reboot

Setup Network Cards

vi /etc/network/interfaces

In the instance below my eth0 represents the community interface that connects to the web and the eth1 interface hooksto the switch. The change then connects to your entire different networked units, akin to your gaming system and other networked devices. I added the following code into the /etc/network/interfaces file:

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

Vi Etc Network Interfaces

/etc/init.d/networking restart

The following following step shouldn't be required, but I like to set a hostname for my router, all you need to do is set up apache and you can have your own private intranet or internet server.

vi /etc/hosts

Vi Etc Hosts

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

/etc/init.d/hostname.sh start

hostname

hostname -f

Ubuntu Hostname

Upon getting accomplished the following above, you should use putty to entry your linux machine from your windows based pc. This will help you copy and paste the next code, to hurry up the process of creating your linux router. The first thing that you will need to do to make use of putty to configure your Ubuntu router, is about a static ip on your windows machine, since we don't have a dhcp server put in yet. Set a static ip handle for Microsoft Vista.For those who don't need to use putty you may simply sort out the rest of the code, putty just makes it easier. Upon getting chosen your terminal program that your are going to use, again login underneath root. It is now time to put in some software program, that we will need 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

Allow packet forwarding

vi /etc/sysctl.conf

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 applications that you may use. When you use webmin, you will be able to simply configure you server, using any net browser you choose.

cd /opt

mkdir webmin

cd /opt/webmin

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

tar xzvf webmin-1.430.tar.gz

cd webmin-1.430/

./setup.sh

Throughout set up you may be requested a couple of questions, just press enter a couple of times. The only factor that you simply wish to change is the port quantity, person identify and password and in addition 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've entered the the above click on the create button. It's 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 Options 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 will have the above into the consumer choices home windows click on the save button twice, which ought to return you to the main Dhcp server window. Inside the dhcp server display screen, you see a button called Edit Network Interface, click this button and choose eth1 then click save. Now click on on the Begin Sever button, if you happen to see no errors, you're 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

by: timtdvqzin




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0