Multiple WANs for multiple public IPV4 addresses
First of all, I apologize for my bad English, and my bad explaining, I do not have a lot of knowledge about networking yet. Don't hesitate to ask me if you need further details.
I have a dedicated server running Proxmox. On this server I two additional IPv4 addresses: one address routed to my pfSense VM, and one other address that I also want to use in pfSense, for virtual machines that require this particular address.
My hosting provider provides a MAC with each additionnal IP, so it would automatically obtain the correct public IP via DHCP.
So, I thought of creating a second WAN interface with the MAC of the other IP, make a VLAN for the virtual machine(s) that need to make use of the other IP,
and create an outbound NAT rule for the LAN that would use the primary WAN and the VLAN, that would use the secondary WAN.
I only got this solution to work partially. The LAN and the VLAN gets the correct IPs as expected, but I can't get both WANs to work at the same time. Only the most recently upped WAN interface will work.
For some reason, both additionnal IPs use different gateway addresses, and I noticed after futher looking that the two gateways just can't be active at the same time.
I wanted to know if anybody here was familiar with this kind of setups and if, by any chance know a way around that?
Thanks in advance!
I finally got this sorted out. Here's how I have done, in case anybody in that situation happens to find this thread. This method does not require creating NAT outbound rules.
Assign the WAN2 interface with DHCP or static. This is the WAN of my additionnal public IP
Create a VLAN and assign it (I'll call it LAN2 for clarity). VMs using the additionnal IP will be connected to this VLAN.
Go to LAN firewall rules, edit the default IPv4 allow rule, and set the gateway to your WAN gateway.
Go to LAN2 firewall rules, edit the default IPv4 allow rule, and set the gateway to your WAN2 gateway.