Making Your Own Gateway Server Using eBox-Platform in Ubuntu 10.04

June 25, 2010 Leave a comment

This few weeks, I have been involving with my new job as an Internet cafe owner and also its system administration. As usual the problem faced by this kind of  business is always funds, hiring a  good sysadmin is not a good option when your are only beginning this field, the best choice is do it all on your own. Because of that I use Ubuntu Server to serve my 10 client pc’s,  and this little how to will demonstrate how I build it.

first thing first is gather all the resource that now in my hand, and all i have is an iso of my downloded ubuntu desktop 10.04 (that’s right i use an ubuntu desktop not the server) , i use the desktop because i need the DE (desktop environment) to install my netcafe billing system ( i use gbilling, unfortunately it is still in Bahasa indonesia you can modify it to your own language by downloading the git version and compile it your self though). ok ! lets do the jobs.

  • Preparing the box

As you all know the kernel used by the destop version of ubuntu is different with the server version, to solve this all we have to do is install the new kernel using the server version this is how i do it in terminal:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install linux-image-server

to change my default kernel upon booting i use startupmanager

$ sudo apt-get install startupmanager

on your gnome just press alt + f2 and type gksu startupmanager

kernel changer

startupmanager

just change your default kernel to generic-pae in default operating system tab

as you can see i dont use gnome either, i use fluxbox its a memory friendly windows manager but sometimes i also use gnome to do things when the work hours of my cafe passed. Ok, back to our installation, now all we have to do is install common application for server, we can achieve this using tasksel, tasksel is an installation system that is an integral part of the Debian installer (it is also included in Ubuntu). Tasksel groups software packages by tasks and offers an easy way to install all the packages needed for that task. It provides the same functionality as using conventional meta-packages. In other words tasksel will install a group of applications for a related job. you can do this by typing on your terminal:

$ sudo tasksel
tasksel

tasksel

here, i choose basic ubuntu server (ubuntu server common applications), dns server (for local dns caching), and LAMP (apache and php used by ebox, its an abbreviation of linux, apache, mysql and php).

After the tasksel installation have been done, now we can continue to our eBox-Platform installation, eBox Platform is a web-based GUI open source small business server, that can act as a Gateway, Infrastructure Manager, Unified Threat Manager, Office Server, Unified Communication Server or a combination of them. These functionalities are tightly integrated, automating most tasks, avoiding mistakes and saving time for system administrators, ebox is webmin alternative for ubuntu or other debian base OSes as now webmin is not supported anymore because it is not compatible with the way that Ubuntu packages handle configuration files, and caused unexpected issues with people’s systems. See https://answers.edge.launchpad.net/ubuntu/+question/2873 for more background. Note that the Debian (and Ubuntu) policy and requirements for how packages deal with configuration files is stricter than other distributions, which makes package installs and upgrades more robust. See Configuration files in the Debian Policy Manual for more information. To install ebox in ubuntu 10.04 lucid lynx you had to add this following line to your repository list.

deb http://ppa.launchpad.net/ebox/1.5/ubuntu lucid main

in synaptic packet manager or adding it manually to your

/etc/apt/sources.list

Manually :

by doing alt + f2:
gksu gedit /etc/apt/source.list and add the url above

or through synaptic package manager
with synaptic:
Synaptic: System > Administration > Synaptic >> Settings >> Repositories >> Other Software

synaptic

synaptic

but i prefer the first one.

after that we should update our new repository by doing

$ sudo apt-get update

then do the installation for the gateway and files sharing type:

 $ sudo apt-get install ebox ebox-gateway ebox-ftp

you will be asked about configuring ldap just choose yes as it recommended and then entering the port that will be use by ebox , i use port 444 instead of 443 as i rather think it will cause more problem in the future as port 443 is also used by https which i will alow to go to public as the transparent proxy by squid is not yet supported (as far i know, please correct me if i am wrong ), and then give the password for managing ebox, and thats it we all done.

  • Configuring Ebox

After the installation process is finished, now the time is to configure our eBox-platform, open your firefox web browser and type in the url-bar:

 https://localhost:444/ebox
or if you use port 443 in the instalation type:
https://localhost/ebox
eBox Platform_login

eBox Platform_login

enter the password that you give in your installation process, after this you will find yourself in the dashboard of eBox-platform

eBox - Dashboard

eBox - Dashboard

as you can see there a lot informations there, the left frame is the list of modules that currently installed in your ebox and the middle frame is the informations and options for the module, ok lets start configuring, the first thing to configure is our network interface and the state it will handle, just click on the Network module, there will be sub modules related to the networks, and the first sub module will be interfaces lets start with the first interface as our wan (conected to internet) interface.

eBox - Network Interfaces_et0

eBox - Network Interfaces_eth0

just click the image to have better view, as you can see my eth0 interface will serve my connection to my adsl router so i check-listed the External (WAN) option and named it eth0 and gave an ip address of  192.168.1.2 with netmask 255.255.255.0 with static method and clicking change after that. You will notice the save changes dialog (its on top right) will become red, just click it to save the changes, you have to remember to do this each time you make changes to your eBox, i use ip address 192.168.1.2 because my adsl modem use 192.168.1.1 as its ip, so to get connected to the modem i have to use 192.168.1.x you should see the manual of your modem and see what ip used by your modem and set it up accordingly.  And for my second interface which is eth1

eBox - Network Interfaces_eth1

eBox - Network Interfaces_eth1

i dint checklist the External (WAN) because from this interface i will serve my client to Internet, if you have more than 1 lines of internet connection you can also add it and checklist it here, but remember to activate the load balancing module in balance traffic module; but we are not going to discuss it here may be some other time, the process much the same with eth0 the different is in the name and ip (i use 10.0.0.1, you can also use it if you like it) not to mention the wan state, just click the image to have a better view.

After that we are going to configure the dns resolving, click on sub module dns, do you remember, we have installed a dns server in our server right, it is in section “installing with tasksel”. This is why we installed dns server we are going to make our own local dns caching server, it is used to fasten our internet connection as we no need to cache dns name from another server just use our own dns cache.

eBox -_dns

eBox -_dns

To have our dns cache locally we need to add our loopback interface ip (127.0.0.1) as our main dns nameserver, so we have to put it on the top list. Just use the add new option and enter it; and don’t forget to also give your ISP dns server too on the list or it won’t forwards the dns name to your server, you can modify the list by clicking the up and down arrow button (the blue one), just click the image to have better view (this is the last time i mention it). If you have a dyndns.com acount you also can automatically update your current public ip right from you eBox (it is on dyndns submodule). This is how it’s look

eBox -_dyndns

eBox -_dyndns

just check list the Enable Dynamic DNS option choose your dyndns server and enter your username, password and the hostname there, and click the change the button and save your configuration as I mentioned earlier.

Now we are going to configure the gateway submodule, the gateway ip in my case is my adsl modem router’s ip address which is 192.168.1.1, this is the screen-shot:

eBox -_gateway

eBox -_gateway

just checklist the enable button, here i named it default, in IP address tab type your modem ip, in interface choose our wan interface which is eth0 in my case, because for me this is the default gateway i check-listed the default option. After you have finish adding click the add button, the gateway list will be on your screen just like mine in the bottom and don’t forget to save it. Actvate your network and firewall module by check-listing the network and firewall module in Module Status, dont forget to save the changes.

eBox - Module Status Configuration

eBox - Module Status Configuration

By now you already can serve your client to the internet just set up your client ip using a static ip, give it in the same subnet to your eth1 ip which is in my case 10.0.0.1 so i setup my client to have 10.0.0.2 – 10.0.0.11 with netmasks 255.255.255.0 gateway 10.0.0.1 dns server1 10.0.0.1 and dns server2 202.134.0.61

To configure the Proxy server,  traffic shaping, and the firewall, you can point your browser to my other post here

Advertisements
Categories: Ubuntu Server