Additional IPs on Different Subnet to Host VPS Not Working

ProxmoxUser

New Member
Oct 29, 2008
8
0
1
Hello,

We have two IP ranges on the same VLAN from our transit supplier. These have different netmasks/gateway IPs, I understand the host machine is the gateway and connections are bridged through this.

All the IPs on the same range/subnet as the host machine are fine, however the second range we have do not work, presumably this is because the second range uses a different netmask etc.

On a "normal" install we have no problems with this and simply setting up an additional interface with a different netmask/broadcast/subnet for the different range of IPs works fine, though I am not sure how we can achieve this with Proxmox??

FYI I can ping the host machine from the VPS and changing the IP of the host machine to be on the same range as the VPS results in the other range/subnet of IPs working!
 
Just add a new route manually, try something like:

route add -net 10.5.0.0 netmask 255.255.255.0 dev vmbr0

you can delete that route with:

route del -net 10.5.0.0 netmask 255.255.255.0 dev vmbr0

If that work, you can automate that by modifying /etc/network/interfaces:

Code:
auto vmbr0
iface vmbr0 inet static
   ...
   bridge_fd 0
   up route add -net 10.5.0.0 netmask 255.255.255.0 dev vmbr0
   down route del -net 10.5.0.0 netmask 255.255.255.0 dev vmbr0
...
 
Do you need to restart the network interface after running the routing command you suggested above? How do you make it effective in the server?
 
Do you need to restart the network interface after running the routing command you suggested above? How do you make it effective in the server?

route command effects are immediately. you dont need to restart anything. But the command is not permanent (get lost after reboot)

If you want it permanent across reboots, edit your interfaces file according to dietmar post.

Regards,
chopeta
 
Thanks for the clarifications.

I was given another range of IPs for my proxmox server with a different netmask and I tried this command but it did not work for me.

(running proxmox 1.1) Then I tried to add it as vmbr0:1 (since the initial range I was given was configured on vmbr0:0) in /etc/network/interfaces

but after restarting the vmbr0 interface I lost connectivity to everything and had to use KVM to reboot the server.

Can any help understand how I could possibly effectively add another range of IPs with a 255.255.255.128 netmask on an already running proxmox server with minimal downtime?
Thanks.
 
Got it to work finally with vmbr0:1

I had to remove the gateway entries and just use the IP and networks.
 
Depending on you network config, you will need to edit /etc/vz/vz.conf from

Code:
NEIGHBOUR_DEVS=detect

to
Code:
NEIGHBOUR_DEVS=all

I found it searching using google. I'm surprised this edit has never been mentioned here on proxmox forums.

After you edit it, just reboot the VMs. No need to restart the server.

Note: you may see it when you start your VM using vzctl, over SSH:

arpsend: can't get iface 'eth0' address : Cannot assign requested address
vps-net_add WARNING: arpsend -c 1 -w 1 -D -e 212.167.XXX.XXX eth0 FAILED
arpsend: can't get iface 'eth0' address : Cannot assign requested address
vps-net_add WARNING: arpsend -c 1 -w 1 -U -i 212.167.XXX.XXX -e 212.167.XXX.XXX eth0 FAILED
I replaced the VM IP

None of the dozen forums I found this tip mention this. However, it doesn't look to affect the server functionality in any manner and the default ARP entries - which is added before the line editing - are still being added on new VM startups.
 
Last edited:
Hi RenatoMN,
I made the change as per your suggestion.
NEIGHBOUR_DEVS=all
But does not work.
First of all I dont have VLAN setup. I however have two local subnets.
The main subnet is 192.168.1.0 (gateway 192.168.1.1 --> T1 line) where all the servers and desktops are connected through the main switch.
Then I have another subnet 192.168.45.0 (Gateway 192.168.45.1 -->DSL line) for testing etc, which is connected to the same main switch so that the subnet 192.168.45.0 can be accessed from any where in the building. As they are both different subnets, they cannot ping one another. However, If you have both IP addresses added in your network configuration on your windows desktop, (192.168.1.x and 192.168.45.x) you can access both the networks internally. Ofcourse, to go out on the internet, once has to choose the gateway, 192.168.1.1 (for T1) or 192.168.45.1 (For DSL)
I have setup proxmox (only one physical NIC) on the 192.168.45.0 subnet. I have all my test VMs running on the 192.168.45.0 subnet. Everything is working fine.
Now, I want to use the proxmox server and create VM on it with 192.168.1.0 subnet, so that it can be used in the production environment.
The problem is when I use
route add -net 192.168.1.0 netmask 255.255.255.0 dev vmbr0
The VM crated with 192.168.1.x IP works great on the internal network (192.168.1.0). But since it does not reach the gateway (192.168.1.1) it can not go out on the internet. So I can not do anything from the web, like yum, apt-get, wget etc from inside the VM.
so in the command:
Code:
route add -net 192.168.1.0 netmask 255.255.255.0 dev vmbr0
How do I add gateway 192.168.1.1 ?
How to solve this problem?
Many thanks in advance.
 
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!