ovh ip failover and bridge

mtzdb

New Member
May 9, 2023
10
0
1
Hello,

I have installed both Lubuntu Desktop and Ubuntu Server on Proxmox VMs. However, I don't have internet access on either of them.

I followed this tutorial, but I still don't have internet access: https://help.ovhcloud.com/csm/en-de...?id=kb_article_view&sysparm_article=KB0043731

Currently, I have found a temporary fix, but I must redo it after every reboot:
Code:
ip link set NETWORK_INTERFACE_HERE up
ip addr add FO_IP_HERE dev NETWORK_INTERFACE_HERE
ip route add GW_IP_HERE dev NETWORK_INTERFACE_HERE
ip route add default via GW_IP_HERE dev NETWORK_INTERFACE_HERE


Then, I edit /etc/resolv.conf and add "nameserver 8.8.8.8".

How can I set the IP permanently?

Additionally:

a) I also want to add multiple IPs from one block, like:

1xx.xx.xx.1xx/30
-- 1xxxx.xx.xx8
-- 1xxxx.xx.xx9
-- 1xxxx.xx.xx0
-- 1xxxx.xx.xx1

How can I add several IPs? I see that I can add one virtual MAC, but each IP has a separate virtual MAC.

b) How can I add 8 blocks to one machine (256 IPs in total)?
 
Hello,

I have installed both Lubuntu Desktop and Ubuntu Server on Proxmox VMs. However, I don't have internet access on either of them.

I followed this tutorial, but I still don't have internet access: https://help.ovhcloud.com/csm/en-de...?id=kb_article_view&sysparm_article=KB0043731

Currently, I have found a temporary fix, but I must redo it after every reboot:
Code:
ip link set NETWORK_INTERFACE_HERE up
ip addr add FO_IP_HERE dev NETWORK_INTERFACE_HERE
ip route add GW_IP_HERE dev NETWORK_INTERFACE_HERE
ip route add default via GW_IP_HERE dev NETWORK_INTERFACE_HERE


Then, I edit /etc/resolv.conf and add "nameserver 8.8.8.8".

How can I set the IP permanently?

Additionally:

a) I also want to add multiple IPs from one block, like:

1xx.xx.xx.1xx/30
-- 1xxxx.xx.xx8
-- 1xxxx.xx.xx9
-- 1xxxx.xx.xx0
-- 1xxxx.xx.xx1

How can I add several IPs? I see that I can add one virtual MAC, but each IP has a separate virtual MAC.

b) How can I add 8 blocks to one machine (256 IPs in total)?
Hi,
how is your current network configuration on the PVE host? Please post cat /etc/network/interfaces. Depending on wether your host is part of the subnet or not you will have to use a routed or bridged network configuration, see [0].

I assume you execute the ip commands from within the respective VMs? Not that you will have to use the VMs OS provided tooling for a permanent network configuration (netplan for Ubuntu AFAIK).
If you wish to add multiple IPs with multiple MAC addresses, one option would be to create an additional virtual network interface for each of the IPs and assign them respectively.

In order to forward traffic for a given network range, you will have to setup the corresponding routes on the pve host, by adding them to the network configuration e.g.
Code:
up ip route add 10.0.0.0/8 via IPADDR dev IFACE

[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_network_configuration
 
Thanks for response!
cat /etc/network/interfaces

Code:
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
  address 1xx.xx.xx.x8/24
  gateway 1xx.xx.xx.254
  bridge-ports eno1
  bridge-stp off
  bridge-fd 0
  hwaddress Ax:xx:xx:xx:xx:xF

My IP failover is:
1xx.xx.xx.1xx/30
-- 1xxxx.xx.xx8
-- 1xxxx.xx.xx9
-- 1xxxx.xx.xx0
-- 1xxxx.xx.xx1

What I should do?
 
@Chris, thank you for your response!

I am trying, but it is not working.

My `/etc/network/interfaces` is:
```
auto lo
iface lo inet loopback

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
address 1xx.xx.xx.x8/24
gateway 1xx.xx.xx.254
bridge-ports eno1
bridge-stp off
bridge-fd 0
hwaddress Ax:xx:xx:xx:xx:xF
```

My IP failover is:

1xx.xx.xx.1xx/30
-- 1xxxx.xx.xx8
-- 1xxxx.xx.xx9
-- 1xxxx.xx.xx0
-- 1xxxx.xx.xx1

How can I add this failover block to the VM? At the moment, only my method from the first post is working. I have also found that this works:

`sudo nmcli con add con-name "static-ip" ifname INTERFACE type ethernet ip4 x.x.x.x/x gw4 x.x.x.x`

`nmcli con mod "static-ip" ipv4.dns "8.8.8.8,8.8.4.4"`

What are the best practices for adding these IPs for the VM machine? The documentation is not clear to me.
 
`sudo nmcli con add con-name "static-ip" ifname INTERFACE type ethernet ip4 x.x.x.x/x gw4 x.x.x.x`

`nmcli con mod "static-ip" ipv4.dns "8.8.8.8,8.8.4.4"`
Where are you executing these commands? Inside the Ubuntu VM i assume? If you want to bring up a network connection using network manager inside the VM, run nmcli con up <name-of-connection>, where <name-of-connection> for your case is static-ip. If you want to bring the connection up at boot, you will have to set the connection.autoconnect property.

It probably is easier to configure your connections with nmtui instead of nmcli, as this gives you an interactive console.

Regarding multiple MAC addresses for the multiple IPs, as stated, you will have to create a new network adaper in the PVE WebUI under VM > Hardware > Add > Network Device, to which you can assign a mac address, then assign the IP to the new network interface inside the VM.
 
@Chris
Thank you for your response. Here is what I do:
1683734112207.png
1 - On the VM, I ran this command and added an interface.

2 /3 - I created a new interface, but it does not have a static IP. Why is that?

4 - I can see the interface, but I don't have a connection to the internet.

P.S. When I want to block 128 IPs using failover, do I need to add 128 virtual MACs?
 
Last edited:
@Chris
Thank you for your response. Here is what I do:
View attachment 50233
1 - On the VM, I ran this command and added an interface.

2 /3 - I created a new interface, but it does not have a static IP. Why is that?

4 - I can see the interface, but I don't have a connection to the internet.

P.S. When I want to block 128 IPs using failover, do I need to add 128 virtual MACs?
Your interface ist still down, you will have to bring the connection up with nmcli con up <connection-name>. Since you have the GUI available and you are not so familiar with nmcli, I suggest you configure your network via that instead of nmcli?

P.S. When I want to block 128 IPs using failover, do I need to add 128 virtual MACs?
No, you can add multiple IPs to a single inteface... I thought the virtual MACs needed per IP are a limitation by your service provider?

What are you trying to accomplish here?
 
  • Like
Reactions: mtzdb
@Chris

Thank you for taking the time for me once again!

OK, I'm done with GUI configuration on Ubuntu and also CLI. For Ubuntu server on the second virtual machine, should I set it up in the same way?

I have a question:

- I have two networks on my virtual machine, how do I set it up so that, for example, Docker container 1/Firefox uses ens18 and Docker container 2/Chrome app uses ens19? Is it better to use netns or iproute like this:

```
# create a pair of "veth" interfaces
ip link add veth0 type veth peer name veth1

# add one end to the Docker network
docker network connect --ip 192.168.1.2 network1 veth0

# add the other end to the physical network
ip link set veth1 netns ens18
```

# Context of my case:

Generally, my case for this server is:
- I have a Proxmox server with 256 IPs and I want several VMs to have 16-32 IPs and some 1-4.

At the moment, I see that I have to add a network interface for each IP, so for 32 IPs I should have 32 network interfaces?
 
- I have two networks on my virtual machine, how do I set it up so that, for example, Docker container 1/Firefox uses ens18 and Docker container 2/Chrome app uses ens19? Is it better to use netns or iproute like this:

```
# create a pair of "veth" interfaces
ip link add veth0 type veth peer name veth1

# add one end to the Docker network
docker network connect --ip 192.168.1.2 network1 veth0

# add the other end to the physical network
ip link set veth1 netns ens18
```
So, since I don't know how docker exactly handles your network, I can only speculate here: but yes, you can attach the virtual network adapters to the corresponding docker networks each.

Generally, my case for this server is:
- I have a Proxmox server with 256 IPs and I want several VMs to have 16-32 IPs and some 1-4.

At the moment, I see that I have to add a network interface for each IP, so for 32 IPs I should have 32 network interfaces?
It is not necessary to add a virtual network interface for each IP, it is possible to add multiple IPs to the same network interface. The question remains why you would like to add multiple IPs to your interface? Do you want the same interface to be part of different subnets?
 
So, since I don't know how docker exactly handles your network, I can only speculate here: but yes, you can attach the virtual network adapters to the corresponding docker networks each.


It is not necessary to add a virtual network interface for each IP, it is possible to add multiple IPs to the same network interface. The question remains why you would like to add multiple IPs to your interface? Do you want the same interface to be part of different subnets?

@Chris, I need 32 IPs for my VM, because I need these IPs for a proxy.

How can I add multiple IPs from one VM without a network interface? I need to add IPs to the host and then to the VM using a command. Could you please share with me which direction I should be thinking?
 
@Chris
Can you respond? I am very grateful that you have helped me a lot!
As already stated, you have two options here:
  1. add multiple IPs to the same interface within the VM (how to achieve that you will find plenty of tutorials online)
  2. add multiple virtual interfaces and assign an IP to each of them again from within the VM
If you actually don't want the IPs to be attached to the VM interface itself, but rather to a container running inside the VM, you will have to assign the IP there.

Hope this helps!
 
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!