Article 53AZR nftables: how to self detect public/private network connection and chose appropriate chains?

nftables: how to self detect public/private network connection and chose appropriate chains?

by
hanserikbusk
from LinuxQuestions.org on (#53AZR)
I use my laptop most of the time behind a pfSense firewall; but quite often in more public places connected by wifi or ethernet.

The laptop firewall must of course have different sets of restrictions in the public and private environment, and I want the shift between the two to be automatic.

My private network at home gives the laptop a fixed ip (MAC-based) in the 192.168.*.* net by way of DHCP, that could be used as a reliable and not too unsafe indicator for connection to the private net, and somehow (by dictionaries or maps?) select the more relaxed chain for private network.
Otherwise the stricter chain should be used.

As I am still quite new with nftables, I would like to know if there is a nicer solution; I feel my idea is a bit too patchy :(latest?d=yIl2AUoC8zA latest?i=Q3Zc7ce_Zo0:Lmt7KCqL-Vw:F7zBnMy latest?i=Q3Zc7ce_Zo0:Lmt7KCqL-Vw:V_sGLiP latest?d=qj6IDK7rITs latest?i=Q3Zc7ce_Zo0:Lmt7KCqL-Vw:gIN9vFwQ3Zc7ce_Zo0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments