I've setup a simple zone with automatic DHCP, a vnet and 10.0.0.0/24 subnet with SNAT enabled.
On the host I have 2 bridges configured:
- vmbr0 with public IP 1.1.1.1
- vmbr1 with public IP 1.1.1.2
(Those aren't the real IP addresses, just substituted by me).
When creating the subnet and enabling the SNAT option, it automatically chooses vmbr0. I couldn't find documentation on how to change this to another interface/IP so I manually edited /etc/network/interfaces.d/sdn like so:
But upon `reloadnetworkall` the POSTROUTING rules get overwritten back to `-o vmbr0` and `--to-source 1.1.1.1`.
What's the recommended method to get my desired outcome?
On the host I have 2 bridges configured:
- vmbr0 with public IP 1.1.1.1
- vmbr1 with public IP 1.1.1.2
(Those aren't the real IP addresses, just substituted by me).
When creating the subnet and enabling the SNAT option, it automatically chooses vmbr0. I couldn't find documentation on how to change this to another interface/IP so I manually edited /etc/network/interfaces.d/sdn like so:
Code:
#version:15
auto vnet0
iface vnet0
address 10.0.0.1/24
post-up iptables -t nat -A POSTROUTING -s '10.0.0.0/24' -o vmbr1 -j SNAT --to-source 1.1.1.2
post-down iptables -t nat -D POSTROUTING -s '10.0.0.0/24' -o vmbr1 -j SNAT --to-source 1.1.1.2
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
But upon `reloadnetworkall` the POSTROUTING rules get overwritten back to `-o vmbr0` and `--to-source 1.1.1.1`.
What's the recommended method to get my desired outcome?