Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Pardon me if I'm asking the wrong question. But I am a newbie in networking and I'm not sure what direction to go on this.

I have just setup an Ubuntu Desktop. I am planning to convert it to a network server without losing the GUI interface (again, I'm a newbie) and use it to manage and monitor user access to a network with a small number of network terminals all running on Windows. My purpose is to use the new server to filter sites accessed by each terminals, monitor sites being visited by employees and grant access to both group and user-specific folders based on their IP address.

Is this possible?

  1. What server software do I need to install?
  2. How do I structure the hardware? (I have a router, a hub, the Ubuntu server and the network terminals)
  3. How do I assign privileges to users and monitor them at the same time?

Thank you in advance for your replies.

share|improve this question

migrated from stackoverflow.com Jun 17 '11 at 18:05

This question came from our site for professional and enthusiast programmers.

    
Are you wanting to do IPv4 only or both IPv4 and IPv6? Do you want your users accessing folders using a browser, Windows file sharing, or a (s)FTP client? –  Azendale Jun 18 '11 at 23:54
    
What model of router do you have? I ask because we'll need to set up a static route and make the DHCP server not give out an address (which we'll manually give to the ubuntu server). –  Azendale Jun 25 '11 at 16:02

2 Answers 2

Short answer: yes.

The main difference between Ubuntu Desktop and Ubuntu Server is the packages that are installed by default. So, thus, you can install "servery" packages on Ubuntu Desktop, and you can install "desktoppy" packages on Ubuntu Server.

The kernel installed by default is different too, but for what you're trying to do, the "generic" kernel (as used by the desktop distribution) will work just fine.

share|improve this answer

Yes, it is very possible. I have a desktop of mine set up as a home router, firewall, webserver, email server, ssh server, ... (I think you get the idea). You will not lose your GUI by installing any of that.

To filter the web sites, you could set up dansgaurdian/tinproxy using Set up web content filtering in 4 steps with Ubuntu, put your server between the internet and the terminals and then use IPtables to drop any website access that doesn't come from your server. This may seem counter intuitive at first until you realize that traffic going through the proxy comes from the server the proxy is on.

You would need two network cards. One would be connected to your hub with all your terminals connected to the hub. Assuming what you call your router is what connects you to the internet (IE it's a DSL/Cable modem or something like that), you would connect the other port on your server to your router. That way, the only physical way for the traffic to get to the internet is through that server.

To allow your machine to forward traffic, run gksudo /etc/sysctl.conf and either add or uncomment the following lines:

net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1

save the file. Then run sudo sysctl -p to apply the changes.

So, we are going to give the computers behind the Ubuntu server the addresses in the 192.168.2.X range (also known as 192.168.2.0/24).

Install the dhcp3-server and resolvconf packages.

Go to your router's configuration page by putting http://192.168.1.1/ in a browser. Look for a settings page for a DHCP server. Change the range from starting at 192.168.1.2 to starting at 192.168.1.3. (The router uses 192.168.1.1. Making the DHCP server which gives out addresses start at 192.168.1.3 leaves 192.168.1.2 untouched so that we can manually give your server the address 192.168.1.2).
Now, look for a routing page. You want to put in 192.168.2.0 for network, 255.255.255.0 for netmask, and 192.168.1.2 for gateway. This will tell the router that any traffic destined for the 192.168.2.X network should be sent to the computer with the address 192.168.1.2.

So, now we need to manually give your Ubuntu server that address. On your Ubuntu server, there should be two network interfaces, eth0 and eth1. Make sure eth0 is plugged into your router. In a terminal, run

sudo nano /etc/network/interfaces /etc/resolvconf/resolv.conf.d/head /etc/default/dhcp3-server /etc/dhcp3/dhcpd.conf

and add to the end of the file:

auto eth0
iface eth0 inet static
       address 192.168.1.2
       netmask 255.255.255.0
       gateway 192.168.1.1

auto eth1
iface eth0 inet static
       address 192.168.2.1
       netmask 255.255.255.0

That will set a static address for both interfaces. Press Ctrl X to close and then save the first file. You will be switched to the second file. Put in (at the end of the file):

nameserver 202.83.95.227
nameserver 119.31.230.42 

That will set the DNS servers now that you don't automatically get them when you request an address using DHCP. Press Ctrl X to close, then save the second file. In the third file, change INTERFACES="" to INTERFACES="eth1" That will tell the DHCP server we are setting up to run on the eth1 interface. Press Ctrl X to close & save the third file. In the fourth file, change the lines

  subnet 192.168.0.0 netmask 255.255.255.0 {
  range 192.168.0.244 192.168.0.254;
  option routers 192.168.0.241;
}

to subnet 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.17 192.168.0.254; option routers 192.168.2.1; option domain-name-servers 202.83.95.227, 119.31.230.42; }

That will tell the DHCP server what addresses to give out. Press Ctrl X to close, then save the fourth file. You can restart to apply these settings (you can do it w/o restarting, but that's extra steps). You should be able to plug your hub into eth1 and connect to the internet with one of the windows clients connected to the hub once you restart.

Tell me how it goes.

share|improve this answer
    
+1 That's very enlightening. Can you explain to me how I can "put the machine physically between the computers and the internet"? What are the hardware and software requirements? How do I configure the services to accomplish my goal? –  Jhourlad Estrella Jun 18 '11 at 15:46
    
Does that mean I have to have a public IP for this? Is it possible to have complete admin control over the network while setting it up as transparent proxy? –  Jhourlad Estrella Jun 19 '11 at 1:44
    
@Jhourlad Estrella You just need an internet connection, which at some point uses a public IP, but you don't need to have the public IP assigned to just you. The static IP that we would set would probably be private IPs, which anyone is allowed to use (usallly behind NAT, which is probably done at your DSL/Cable modem). What do you mean by complete admin control over a network? Could you run ipconfig on one of the workstations? –  Azendale Jun 21 '11 at 18:59
    
Wireless LAN adapter Wireless Network Connection: Connection-specific DNS Suffix . : Link-local IPv6 Address . . . . . : fe80::10b1:451e:d49:c1fe%17 IPv4 Address. . . . . . . . . . . : 192.168.1.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.1.1 –  Jhourlad Estrella Jun 21 '11 at 23:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.