Add new ip set to proxmox and use in VM

Nader Jafari

New Member
Jun 28, 2019
1
0
1
35
We have a debian server that installed Porxmox on that with IP 138.XXX.YYY.209 . We create a VM on this with a Bridge Interface and set 138.XXX.YYY.210 and everything is OK.

We buy a new IP set :

Subnet: 148.251.XXX.192 Netmask: 255.255.255.248 Broadcast: 148.251.XXX.199

Usable IP addresses:

148.251.XXX.193 to 148.251.XXX.198

How can i set 148.251.XXX.198 in a New VM? I Want a Step-By-Step answer because I'm newbie in networking.
 
It depends assuming this new network range comes in in the same physical nic as your other range and that physical mic is connected to a bridge like vmb0 then the vnic on your VM will work as long as inside your VW you configure the network interface t use it.

If it also has a vlan and make sure the bridge is set vlan aware then on the hardware config of the vnic set the vlan I'd and inside the VM configure as normal

Last option is the new range is on a different physical interface create a new bridge in proxmox connected to that nic and in your VM use that bridge on your vnic
 
EDIT: After typing this entire post, and reading many more similar posts, something stood out. The fact that one can't have two default gateways on a server stood out. So what I did was assign the new IP address, including the default gateway, to the guest VM. I did nothing on the host. And it just worked! So I am guessing my second range of IP addresses, especially the router, is aliased by the ISP to the primary router.

ORIGINAL POST:

@Nader Jafari how did you get this going?

I have a similar setup. The proxmox server has two physical interfaces in the DC, eno1 and eno2

I received on /29 when I signed up for the physical host, and now I need to add a new /29. The new /29 has a new gateway.

From what I can see under the "Active" column only eno1 is online.

So from reading a few posts like:
https://forum.proxmox.com/threads/how-to-add-additional-ip-to-proxmox-itself.69390/
https://forum.proxmox.com/threads/how-can-i-add-additional-ips-to-proxmox-network-interface.51631/

I thought let's add a Bridge interface. But trying to do this via the GUI is problematic. Here are some errors:

Action: Create new Linux Bridge / vmbr0
Result: "iface: interface already exists"

Action I try to create vmbr1 and use new gateway:
Resuit: Default gateway already exists on interface 'vmbr0'

Action: I create vmbr1 and leave out gateway. This feels all wrong but hec I'm trying stuff, right?
Result (after pressing Apply): you need ifupdown2 to reload network configuration (500)

Action: From terminal I try ifupdown2
Result: -bash: ifupdown2: command not found

I give up on GUI and move to terminal.

From the terminal I try:

Action: add new section to /etc/network/interfaces

iface vmbr0 inet static
address x.x.x.x/29
gateway y.y.y.y

I reboot. New section is gone, and new IP address is not listening. Thankfully old IP address still works.

Now I'm stuck. What I have learnt from the other posts:

1. Apparently no need to use :1 syntax, just duplicate bridge. But does a bridge work on different subnet with different gateway?
2. You can't do ifconfig down vmbr0:1 (if you ignored using that syntax) and have to do `ip a del`

Seems like many people are asking the same question and referral to Unix networking guides are given, but none seems Proxmox specific to me, and also I am not really a network specialist at this level. The guides that didn't help me, all in the other posts:

https://wiki.debian.org/NetworkConfiguration
https://wiki.debian.org/NetworkConfiguration#Multiple_IP_addresses_on_one_Interface

The title multiple IP addresses on one interface seems perfect except I have a different gateway?

The member @oguz mentions "you can utilize the 'interfaces.d' directory and source the contents in 'interfaces'"

What does it mean, "source the contents of interfaces"?

Please assist. I would have though adding a new subnet with a new gateway is fairly common networking but I can't figure it out.
 
Last edited:

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!