Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Employ 'not' syntax for 'real-interface' parameter in 'interface' command? #450

Open
johnnyutahh opened this issue Jan 26, 2021 · 0 comments

Comments

@johnnyutahh
Copy link

johnnyutahh commented Jan 26, 2021

Is there some way to replace the interface e+ statement below with some sort of interface not "[devices...]" syntax, maybe in a future FireHOL version if it's not supported today?

The interface not "[devices...]" syntax (second stanza below) breaks my firehol-based firewall; maybe it "works" but it does not work the desired way for my team (which is represented by the interface e+ exposed directive in the first stanza). The not directive would theoretically be more elegant (to catch "all devices that are not in the list") than matching against a more-hard-coded device wildcard (e+), and would (again, theoretically) make our /etc/firehol.conf much more portable.

eg: imagine a Linux system that has a regular ethernet device whose name does not begin with e. Seems quite within the realm of feasibility.

#
# TODO: find a more-elegant way of specifying
#       non-wireguard, non-local network devices
#       other than 'e+', which accounts for:
#           eth[x]
#           ens[x]
#           enp[x]
#           eno[x]
#       ...per:
#       https://en.wikipedia.org/wiki/Consistent_Network_Device_Naming#Device_naming_rules
#
interface e+ exposed
    protection strong
    server custom wireguard_udp udp/12345 default accept
    server custom wireguard_udp udp/12346 default accept
    client all accept

...with something like this (note the not "[devices...]", which breaks on our system for both of the not "wg0 wg1 lo" and "not wg0 wg1 lo" variants):

interface not "wg0 wg1 lo" exposed
    protection strong
    server custom wireguard_udp udp/12345 default accept
    server custom wireguard_udp udp/12346 default accept
    client all accept

References:

  1. https://en.wikipedia.org/wiki/Consistent_Network_Device_Naming#Device_naming_rules
  2. https://www.reddit.com/r/linuxadmin/comments/ixeky1/ubuntu_kvm_vps_iptables_ctstate/g67khpc/?utm_source=reddit&utm_medium=web2x&context=3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant