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.

At home, I have Ubuntu server with the UFW firewall. What command do I type to turn on local intranet access to my web server, but keep the outside world out from my DSL modem?

share|improve this question
1  
Is the DSL modem a NATing router? If so, and if you haven't forwarded any ports to the server, then leaving the firewall wide open is fine--nothing's getting past the router. –  maco Aug 24 '10 at 23:51
    
This is a just-in-case kind of thing. You never know when some thief finds a router exploit and can play with MAC addresses to get through. –  Volomike Aug 25 '10 at 13:40

1 Answer 1

up vote 3 down vote accepted
sudo ufw default deny
sudo ufw allow from 192.168.1.0/24 to any port 80

Assuming the web server is on port 80 and 192.168.1.x is your home subnet. If you explicitly want exclude your router, then assuming it's 192.168.1.1, it would be:

sudo ufw deny from 192.168.1.1 to any port 80
share|improve this answer

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.