Hello,
I searched but didn't find the response to this question:
Can built-in firewall be used with LXC CTs behind NAT?
I run a fresh PVE/4.1-1/2f9650d4 (running kernel: 4.2.6-1-pve) and have the following config:
Datacenter level:
But for my LXC containers, when I enable the firewall for the CT, I cannot anymore ping WAN hosts.
With tcpdump, I see that when the FW is enabled, ICMP requests from the CT are not translated and are sent on the WAN interface.
There's maybe a really simple trick to do but I don't find it.
Thanks you!
P.S. : I think I've found.
Cf. https://forum.proxmox.com/threads/p...l-with-nat-port-forwarding-hairpinning.24890/
I'll check and mark the thread as solved if it's OK.
P.P.S. : It seems OK, I mark the tread as solved.
I searched but didn't find the response to this question:
Can built-in firewall be used with LXC CTs behind NAT?
I run a fresh PVE/4.1-1/2f9650d4 (running kernel: 4.2.6-1-pve) and have the following config:
Code:
# cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 198.51.11.20
netmask 255.255.255.0
gateway 198.51.11.1
auto vmbr0
iface vmbr0 inet static
address 10.10.8.1
netmask 255.255.248.0
bridge_ports none
bridge_stp off
bridge_fd 0
post-up /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
post-up /sbin/iptables -t nat -A POSTROUTING -s '10.10.8.0/21' -o eth0 -j MASQUERADE
post-down /sbin/iptables -t nat -D POSTROUTING -s '10.10.8.0/21' -o eth0 -j MASQUERADE
Datacenter level:
- Enable Firewall: Yes
- Input Policy: DROP
- Output Policy: ACCEPT
- Enable Firewall: Yes
- all defaults settings
But for my LXC containers, when I enable the firewall for the CT, I cannot anymore ping WAN hosts.
With tcpdump, I see that when the FW is enabled, ICMP requests from the CT are not translated and are sent on the WAN interface.
Code:
PVE Node # tcpdump host 10.10.10.104
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
22:32:59.612224 IP 10.10.10.104 > bidule-public-dns-a.bidule.com: ICMP echo request, id 42498, seq 15, length 64
22:33:00.620198 IP 10.10.10.104 > bidule-public-dns-a.bidule.com: ICMP echo request, id 42498, seq 16, length 64
22:33:01.628221 IP 10.10.10.104 > bidule-public-dns-a.bidule.com: ICMP echo request, id 42498, seq 17, length 64
There's maybe a really simple trick to do but I don't find it.
Thanks you!
P.S. : I think I've found.
Cf. https://forum.proxmox.com/threads/p...l-with-nat-port-forwarding-hairpinning.24890/
Code:
# Allow NAT working with the built-in firewall
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
I'll check and mark the thread as solved if it's OK.
P.P.S. : It seems OK, I mark the tread as solved.
Last edited: