You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I may be asking too much from this excellent firewall script that I've used for so many years! But here is what i'm doing so to see if I'm trying to push it too far!
Ubuntu server 22.04 LTS
iptables v1.8.7 (nf_tables)
Linux version 5.15.0-86-generic
Arno's Iptables Firewall(AIF) v2.1.1
I have two external connections via two different providers, the second has multiple IPs assigned:
eno1.15 - DHCP obtained public IP address 1.1.1.2, d/g/ 1.1.1.1
ens5 - static public IP address 2.2.2.2/29, d/g/ 2.2.2.1
ens5:1 - static public IP address 2.2.2.3/29
ens5:2 - static public IP address 2.2.2.4/29
I also have a LAN:
ens1 - static 192.168.1.1/24 (all clients on the lan sit behind this and have nat'd internet via the ens5 public IP so hide behind 2.2.2.2)
To facilitate the linux server being able to answer queries from both public external connections I use linux multiple routing tables with set naming (defined in /etc/iproute2/rt_tables):
1 rt1
2 rt2
So my two routing tables:
root:~# ip route show table rt1
default via 2.2.2.1 dev ens5
2.2.2.0/29 dev ens5 scope link
root:~# ip route show table rt2
default via 1.1.1.1 dev eno1.15
1.1.1.0/23 dev eno1.15 scope link
This allows me to ssh inbound to my server to either of it's public IP addresses.
Now aif configuration:
This is so that device 192.168.1.5 is always hidden behind public IP 2.2.2.3
In theory 192.168.1.133 should hide behind the other external of 1.1.1.2 but this doesn't appear to work.
multiroute.conf - I have tried this on and off to see how this changes behaviour, it does appear to work, however it seems to cause problems for the OUTBOUND_SNAT entry 192.168.1.5>2.2.2.3
multiroute.conf:
To follow this up.
I do believe it's working, however I'm not sure the weight in multiroute is being honoured correctly.
Testing multiple times, often I see my connection going out over the second interface (1.1.1.2) which should have the weight of 5 (lower than the primary of 15).
Is there a way to force this so that the second is not used?
I may be asking too much from this excellent firewall script that I've used for so many years! But here is what i'm doing so to see if I'm trying to push it too far!
I have two external connections via two different providers, the second has multiple IPs assigned:
eno1.15 - DHCP obtained public IP address 1.1.1.2, d/g/ 1.1.1.1
ens5 - static public IP address 2.2.2.2/29, d/g/ 2.2.2.1
ens5:1 - static public IP address 2.2.2.3/29
ens5:2 - static public IP address 2.2.2.4/29
I also have a LAN:
ens1 - static 192.168.1.1/24 (all clients on the lan sit behind this and have nat'd internet via the ens5 public IP so hide behind 2.2.2.2)
To facilitate the linux server being able to answer queries from both public external connections I use linux multiple routing tables with set naming (defined in /etc/iproute2/rt_tables):
1 rt1
2 rt2
So my two routing tables:
This allows me to ssh inbound to my server to either of it's public IP addresses.
Now aif configuration:
The rest is pretty much unchanged, a few host_open entries, etc, but the rest is stock.
Plugin I have enabled:
outbound-snat.conf
This is so that device 192.168.1.5 is always hidden behind public IP 2.2.2.3
In theory 192.168.1.133 should hide behind the other external of 1.1.1.2 but this doesn't appear to work.
multiroute.conf - I have tried this on and off to see how this changes behaviour, it does appear to work, however it seems to cause problems for the OUTBOUND_SNAT entry 192.168.1.5>2.2.2.3
multiroute.conf:
I also did a bit of custom routing to allow loopback for internal hosts hitting that outbound snat entry, so this is
custom-rules:
So I suspect I'm trying to get it to do too much!
Any suggestions on trying to achieve what I want here:
Thanks in advance and apologies, this isn't a bug as such!
Andy
The text was updated successfully, but these errors were encountered: