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 ;)
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!