Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu and am setting up a development server for my website. I only want the IP from my workstation to be able to access the website. Is there anyway to setup a firewall rule for this?

Thanks Jason

share|improve this question
up vote 3 down vote accepted

Yes. The typical way to do this would be in the web server's config; that's where I'd recommend putting it. For Apache:

Order deny,allow
Deny from all
Allow from

But, if you're inclined toward blocking connections altogether, you can do that, too. Ubuntu provides a simplified iptables interface called UFW:

sudo ufw enable
sudo ufw allow from to any port 80/tcp
sudo ufw deny 80/tcp
share|improve this answer
I know iptables inside and out, but didn't know about ufw: learned something new today. It seems to be included in Debian Squeeze as well. – Wim Kerkhoff May 7 '11 at 18:42

Your Answer


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.