jadedeane / natanator

Unifi OS persistent network modification service
26 stars 5 forks source link

improved nat-rule identify and removal #3

Closed jens-maus closed 10 months ago

jens-maus commented 10 months ago

This change modifies identification and removal of the acqual global NAT WAN rules for a UniFiOS environment. In fact, instead of completely flushing the whole POSTROUTING chain to get rid of NAT, this change modifies natanator.sh to just remove the actual MASQUERADE jump targets under the UBIOS_POSTROUTING_USER_HOOK chain where UniFiOS actually places the global NAT WAN rules. In addition, this change makes also sure that user defined NAT rules will stay effective, thus just the global anywhere/anywhere NAT rules with reference to UBIOS_ADDRv4_eth8 and UBIOS_ADDRv4_eth9 will be removed. Thus, user defined NAT rules will still continue to work while only NAT WAN rules will be removed to make sure no double NAT will be effective if a dedicated router is doing the NAT and e.g. a UDMpro should only work as a plain network client and refrain from doing NAT itself.

jadedeane commented 10 months ago

@jens-maus thanks for your contribution.