2 Additional IPs on a Hetzner Proxmox Server

RandomRoastbeef

New Member
Apr 2, 2025
5
0
1
I'm using a Hetzner Server with Proxmox installed. Currently I've got one additional IP-Adress, with seperate MAC.

Using the following proxmox host interfaces config, i was able to assign that additional IP Adress to a VM, running pfSense ,while keeping the primary ip assigned to the proxmox host.


Code:
source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

iface lo inet6 loopback

auto enp0s31f6
iface enp0s31f6 inet manual
#       up route add -net 167.235.178.128 netmask 255.255.255.192 gw 167.235.178.129 dev enp0s31f6 route 167.235.178.128/26 via 167.235.178.129

auto vmbr0
iface vmbr0 inet static
        address 167.235.178.172/26
        gateway 167.235.178.129
        bridge-ports enp0s31f6
        bridge-stp off
        bridge-fd 0

auto vmbr1
iface vmbr1 inet static
        address 192.168.1.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0

Now i want to add another aditional IP, also routed onto the pfSense VM, ideally as second WAN Adress.

So far, i added a second network interface connected to vmbr0 to said VM, and configured the respective MAC.
But whatever I try, the IP does not show up in ifconfig of vnet2, and pfSense refuses to add the IP, as it is on the sam /26 Subnet than the already existing additional IP.

Thanks,
Alexander
 
Hey,

are those separate physical interfaces, or do those three come over the same one(this it what it look like based on your [I]/etc/network/interfaces[/I])? If they are on different interfaces, you can just pass through the whole interface to the VM. If they are not(and they are on the same subnet), attach the bridge to the VM and set the static IP in the VM. The PVE host does not need an IP on that bridge, in case you don't want it reachable through a public IP.
 
All 3 IPs are on the same subnet and all 3 are coming over the same interface on the host.

Removing the IP from tha host is something i consider for the futer, curernty I tried to attach the bridge to the VM, which works fine for one IP. The second i want to have to IPs on that VM, i connect two network interfaces of that VM to the bridge, but I can'T get the IP assignd to said second interface.

In the End, i'd like to have both those IPs as WAN-Adresses of a pfSense, but whenever i try to add a second Interface, I get an error, becaus both IPs are on the same subnet and use the same Ggateway, while trying to use a virtual IP in pfsense just seems to drop the traffic, the second itreaches the vm.
 
Ohh, you can only have one as gateway. Generally it is not a problem a VM has multiple IPs on the same interface, as long as they are on the same subnet. This isn't something that should need any sort of configuration on the PVE host.
 
well, MACs are associated with interfaces, not IPs. As I said, having two IPs on the same interface is possible, a basic interfaces file for that would look something like this
Code:
iface enp6s18 inet manual

auto enp6s18:0
iface enp6s18:0 inet static
    address 192.168.55.12/24
    gateway 192.168.55.1
   
auto enp6s18:1
iface enp6s18:1 inet static
    address 192.168.55.77/24
note that only one has a gateway

I am not sure how this would look like in pfSense, but I am pretty sure it is possible.

Set two MACs? Where, and for what? In pfSense? If in pfSense, just add two interfaces to the VM that are both on vmbr0, they should have their own MAC in the VM, but I think you did that, no?
 
As far as i know,Hetzner requires me to use a corresponding mac for every additional IP. so both Additional Ips would have a seperate MAC, which was why i opted for two interfaces on the pfsense vm
 
I see, then having two interfaces on vmbr0 attached to the VM will give you two different MACs. What exactly is the problem? pfSense not letting you save the configuration?
 
Exactly, because pfSense refuses to accept a WAN-Interface and an OPT1 interface, with IP-adresses both on the same /26 subnet, and the dame gateway.
I'm currently looking for a way, to get around that.