3

I connect my notebook via ethernet at home and outside. I want to open some ports for services like samba only at home and not somewhere else.

How can i let firewalld automatically detect where i am, so the correct zone will be set?

  • 1
    Not a complete answer, but hopefully a clue: Firewalld gets its connection information from NetworkManager, so it's really NetworkManager that you want to have make the distinction. – mattdm Apr 22 '15 at 20:09

1 Answers1

0
  1. Go to System Settings (GNOME Settings): Network.
  2. Click History to see your known WiFi networks
  3. Configure one of your networks and click Security

From here you can assign a firewall zone. The default drop zone should be fine on untrusted networks while the trusted zone … you get the idea.

When you open services add it to the trusted zone (append --zone="trusted" to your commands) instead of the default zone.

Daniel
  • 797
  • 1
  • 6
  • 25
  • I believe this answer only applies to WiFi connections, but the question was, I think, about wired ethernet connections (which appear as a single connection in Networkmanager, regardless of where you are connected). – Matthijs Kooijman May 06 '23 at 11:27