Board logo

subject: Ubuntu Web Gateway [print this page]


Ubuntu Web Gateway
Ubuntu Web Gateway

In this article you'll learn how to setup your very personal ubuntu router web router. The ubuntu router / router will act exactly like another router which you can buy at the store, besides your linux box may have extra performance and extra security. What you'll need to build your Ubuntu Router Internet Gateway:

* Extra pc

* (2) Ethernet cards

* Switch

* Ubuntu 8.04 LTS Server Edition

* Putty

This article will clarify tips on how to setup a contemporary set up of Ubuntu 10.04 server edition, configuring a dhcp server for a neighborhood community,while a including a firewall from the nasty internet. The very first thing that you will do is a fresh install of the Ubuntu server edition, however choosing only Open SSH server through the software installation part of the Ubuntu install. After the installation completes and your computer reboots, you are 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 tremendous person mode (root) we're then going to need to update our Ubuntu Bistro. Type the next instructions to replace the os and different programs.

apt-get replace

apt-get improve

After your computer updates, restart it.

reboot

Setup Network Cards

vi /etc/network/interfaces

In the instance below my eth0 represents the network interface that connects to the web and the eth1 interface connectsto the switch. The change then connects to your whole different networked gadgets, resembling 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 next following step isn't required, but I wish to set a hostname for my router, all it's important to do is install apache and you could possibly 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 you have completed the next above, you can use putty to entry your linux machine out of your home windows based mostly pc. It will assist you to copy and paste the following code, to speed up the method of creating your linux gateway. The very first thing that you will need to do to use putty to configure your Ubuntu router, is set a static ip in your windows machine, since we don't have a dhcp server installed yet. Set a static ip deal with for Microsoft Vista.In the event you don't wish to use putty you may simply sort out the rest of the code, putty simply makes it easier. Once you have chosen your terminal program that your are going to use, once more 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 following 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 programs that you simply may use. In case you use webmin, it is possible for you to to simply configure you server, using 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

During installation you can be requested a number of questions, simply press enter a few times. The one factor that you simply want to change is the port quantity, user name 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 will have entered the the above click on on the create button. You need to now see a icon that reads 192.168.10.zero, click on this new icon and then click 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 you have the above into the consumer options windows click on the save button twice, which should return you to the primary Dhcp server window. Inside the dhcp server display, you see a button called Edit Network Interface, click on this button and select eth1 then click save. Now click on the Begin Sever button, should you 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

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




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