I have an LXC with Nginx Proxy Forward set-up to manager traffic coming from ports 80, 57, 443, 8096, etc to different IP's pointing to other LXC's.
This works well when I edit the PVE host etc/network/interfaces and include this per port.
Is there a version of the above that can port forward everything? I wouldn't want to keep adding these lines every time I need to add a port forward.
I currently don't have ufw or any firewall installed.
Notes:
PVE Host: 192.168.1.x
PVE LXCs: 192.168.5.x
This works well when I edit the PVE host etc/network/interfaces and include this per port.
Bash:
post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport PORT -j DNAT --to 192.168.5.x:PORT
post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport PORT -j DNAT --to 192.168.5.x:PORT
Is there a version of the above that can port forward everything? I wouldn't want to keep adding these lines every time I need to add a port forward.
I currently don't have ufw or any firewall installed.
Notes:
PVE Host: 192.168.1.x
PVE LXCs: 192.168.5.x
Bash:
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet static
address 192.168.1.20/24
gateway 192.168.1.1
auto vmbr1
iface vmbr1 inet static
address 192.168.5.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.5.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.5.0/24' -o eno1 -j MASQUERADE
post-up iptables -t nat -A PREROUTING -i eno1 -p tcp --dport PORT -j DNAT --to 192.168.5.x:PORT
post-down iptables -t nat -D PREROUTING -i eno1 -p tcp --dport PORT -j DNAT --to 192.168.5.x:PORT
# + more port forwards like the above