Additional IP on the Proxmox host - again

ixproxmox

Renowned Member
Nov 25, 2015
77
5
73
It has been asked many times and I have tried so many different solutions. The most common answer from Proxmox-members or staff seems to be like this (in this quote, a fw thing- but still):

"You would configure the IP for proxmox in the bridge instead of the NIC, then pass the bridge through to the pfSense VM and configure the second public IP there in the pfSense VM."

For my usage - I have for instance public proxmox running on public static IP on vmbr - and one or more local IP for connecting to proxmox backup and other fun maintenance stuff (monitoring/storage etc) on local network.

This console command works perfectly for my use - it works nice inside vms in those few cases I need it inside vms also (only problem is that it gets lost on reboots) and shows up nicely in the GUI:

ip addr add 192.168.0.5/24 dev vmbr0

But how to make this IP stay permanent on the host/debian? I know how to do it on all Centos/Rocky/RHEL-editions, but on the proxmox host, I have no clue. I could of course add it into a startup-script and try to hack it that way, but would love to know if there is something super easy I miss (to get it to stick permanently).

I have tried manual editing the networks file also and use vmbr0:1 and even vmbr2.. but all of them ends up destroying the GUI on the network tab (it either shows the last ip - or it shows on the next line like something is wrong).

Adding another vmbr2 and then tell it to use vmbr-interface gives duplicate-error.

Having the 2nd IP inside a vm seems bit weird solution, as the 2nd IP is needed outside, not inside the vm?

So the IP addr manual method works consistently best and I have used it for months, but it is so boring to have to do it over and over again. There must be a better way. Google haven't given me a good solution so far, I bet it is an easy fix.
 
Last edited:
The reason why there are many different solutions is that there are many different scenarios and the requirements/security/basic networking rules demand it to make it a certain way.

You can always add your ip addr add command to be executed on if-up:
Code:
up ip addr add 192.168.0.5/24 dev vmbr0

But it would help if you gave us the contents of your /etc/interfaces file.

Kind regards,
Benedikt
 
Yes, of course there are different needs, but in most threads I found it seemed to match what I was looking for (except the one I quoted of course):confused: But it might just be me misunderstanding the questions in those cases.

How do I add that command, is it as simple as create a new file in /etc/network/if-up.d/ and call it maybe "vmbr0"?

Anyhow - here is example of one server. I only use one 10 Gbps port connected to network, ens2f0. I have for anonymity used a Googles IP instead of my own:

cat /etc/network/interfaces

Code:
auto lo
iface lo inet loopback
iface eth0 inet manual
auto eth1
iface eth1 inet manual

#BackupNormal
iface eth2 inet manual
iface eth3 inet manual

auto ens2f0
iface ens2f0 inet manual

#MainFiber
iface ens2f1 inet manual

auto vmbr0
iface vmbr0 inet static
        address 216.58.206.206/26
        gateway 216.58.206.201
        bridge-ports ens2f0
        bridge-stp off
        bridge-fd 0
 

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!