1

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?

  • 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
3
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

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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