Changing -o interface for SDN SNAT

dodobrow

New Member
Jun 21, 2024
1
0
1
Hi,

As visible below, when setting SNAT for a simple network type:

iface cu1vn
address 10.1.1.1/24
post-up iptables -t nat -A POSTROUTING -s '10.1.1.0/24' -o enp43s0.709 -j SNAT --to-source PUBLIC_IP
post-down iptables -t nat -D POSTROUTING -s '10.1.1.0/24' -o enp43s0.709 -j SNAT --to-source PUBLIC_IP
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
bridge_ports none
bridge_stp off
bridge_fd 0
ip-forward on


-o interface is set automatically.


/etc/network/interfaces.d/sdn is populated automatically each time network daemon is reloaded


Is it possible to set it to a loopback interface?



Kind Regards,
Dominik
 
Last edited:
This is currently not possible, since it uses the default route for picking the interface for SNAT. You would have to create those rules manually instead with your desired interface.
 

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!