NAT and Firewall together

yuzu

New Member
Jan 25, 2023
1
0
1
Hello, i'm trying to make my VPS be able to connect to itself. I'm using a NAT Setup with Port Forwarding. I set up NAT Reflection using those IPtables Rules:
Code:
iptables -t nat -A PREROUTING -d X -p tcp --dport X -j DNAT --to 192.168.2.2

iptables -A FORWARD -p tcp --dport X -d 192.168.2.2 -j ACCEPT

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -p tcp --dport X -d 192.168.2.2 -j MASQUERADE

This is working great. I tried activating the Firewall in Proxmox again, the VPS didn't have any Internet. Checked the Proxmox wiki, and applied the conntracks as stated in a NAT Setup in the Wiki. After this the VPS can't connect to sites hosted on itself anymore and just loads infinitely if done via curl. How would i fix this?

Full interfaces File: https://hastebin.com/nuhorekako.yaml

Thanks for reading if you've made it this far ;)