Ubuntu: Can gufw profiles be switched automatically?


In gufw, you can set up different profiles (home, office, ...) with different rules.

This is cool, but: Is there a way to automatically select a profile, depending on the presence of a wifi access point for example ?

I couldn't find any information on that in the docs (in fact the possibility to have different profiles is barely mentioned, except for the screenshots...)


No, I don't believe so, however it appears that NetworkManager supports Fedora's FirewallD, which allows configuration of a firewall zone for each network connection (such as Wifi SSIDs). It is available in Ubuntu 15.10, but the graphical configuration utility, firewall-config, apparently is not, which means configuring it is left to the cli firewall-cmd application.


It's not possible with gufw. gufw is a GUI for ufw (and ufw configures iptables). ufw doesn't know anything about the gufw profiles. You have to use ufw to enable/disable rules which are defined in your gufw profiles, E.g.

ufw allow in http   ufw reject out smtp  

For more examples and the usage of ufw use man ufw in your terminal.

Your next question on Ask Ubuntu should be: "How can I change my firewall settings in dependency of my network environment?"

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »