I'm trying to set up an UFW firewall on Ubuntu like this:
- Allow all incoming and outgoing connections to IP 1.1.1.1 (all ports);
- Deny all other connections (incoming and outgoing);
For the first item, the command below seems to work just fine: sudo ufw allow from 1.1.1.1
The status of UFW after that shows:
To Action From
-- ------ ----
Anywhere ALLOW IN 1.1.1.1
-
Now, for the second item. Is it possible just to say "deny everything else" with UFW?
The UFW Default is: deny (incoming), allow (outgoing)
If i use sudo ufw default deny outgoing
, and them sudo ufw allow from/to 1.1.1.1
, will the "allow" command overrule the "deny" command? That way it would work just how i need.