View Full Version : [ubuntu] Ubuntu Server LAN access only

February 2nd, 2012, 04:09 PM
I setup a Ubuntu Server with LAMP on our local work network.

Is there a way to continue to have the local network access to it, but make sure the server has no outside internet connection?

I just don't want it to communicate back to the real world. Anything i can change on the network settings on the server?

February 2nd, 2012, 05:07 PM
Simple,just don't give it a gateway.

February 2nd, 2012, 06:56 PM
Simple,just don't give it a gateway.

I remove the gateway by running this command

sudo route del default gw

This stopped communication, but when I restart the server the gateway comes back when I guess it gets the IP address from the DHCP Server.

Do I have to setup a static ip address?

February 2nd, 2012, 09:19 PM
Here is a HOWTO which I found comprehensive and invaluable for me to start learning about server requirements.
Uses Webmin to allow your browser to connect and modify your server settings.
You could also install the Desktop plus install and run the server as a virtual machine using Virtualbox and that is how I run my testing websever.

Are you using the most current version of this how-to?
Version numbers are located @ top right of this page. Latest versions are available at my homepage http://woodel.com
Under the Solutions tab
"Setting up a Linux Server, Start to Finish, using Webmin". By Kevin Elwood

And on your server..........

Logon to your server and download from your server with :
sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.570_all.deb

Install with :
sudo dpkg -i webmin_1.570_all.deb

Add extra libraries with :
sudo apt-get -f install

Uses a browser pointed to https://server_IP:10000 to edit files, create shares, startup daemons etc..


February 2nd, 2012, 10:37 PM

IMO servers should always have static IP addresses.

If you bite the bullet now and change it, its solves this problem also by not defining a gateway address.

February 3rd, 2012, 03:45 PM
Another approach would be to use IPtables.

The directive

-m iprange --src-range
limits connections to the ip range specified.

February 3rd, 2012, 04:47 PM
Another approach would be to use IPtables.

The directive

limits connections to the ip range specified.

Thanks i will check it out. going to test it on VM Virtual Box first before moving it over to a physical machine.