Interfaces configuration for adding a second /24 subnet

gbalague

New Member
May 18, 2021
2
0
1
39
Hello

Firstly thanks for taking the time to read this! Any help is much appreciated. I am by no means an expert but I had a former colleague help set things up but sadly he has left.

Our dedicated main server has the IP x.x.x.x and Proxmox installed. Our server provider originally provided us with the subnet y.y.y.y/24 which our former colleague successfully attached to our Proxmox server (x.x.x.x).

We have 8 VMs installed on proxmox all running Ubuntu 16.04. All VMs were able to access the y.y.y.y/24 subnet.

What I need to do now is add an EXTRA subnet z.z.z.z/24 in addition to the current y.y.y.y/24 which I am struggling to do.

Our existing set up on Proxmox is:

auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet static
address x.x.x.x
netmask 255.255.255.248
gateway x.x.x.49

auto vmbr0
iface vmbr0 inet static
address y.y.y.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0


****

And then VM1 has:

source /etc/network/interfaces.d/*


auto lo
iface lo inet loopback
auto ens18
iface ens18 inet static
address y.y.y.3
netmask 255.255.255.0
gateway y.y.y.1
dns-nameservers 8.8.8.8




To try and add z.z.z.z/24 to Proxmox, I added a section at the end for vmbr10 (see below) however I made no alterations to the interfaces file in the VMs and so I am unable ping the VMs (likely because I am missing something in the VMs).

Any help much appreciated on how to add a second subnet, if it is even possible?

Thanks



auto lo
iface lo inet loopback

auto enp1s0f0
iface enp1s0f0 inet static
address x.x.x.x
netmask 255.255.255.248
gateway x.x.x.49

auto vmbr0
iface vmbr0 inet static
address y.y.y.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0

auto vmbr10
iface vmbr10 inet static
address z.z.z.1
netmask 255.255.255.0
bridge-ports none
bridge-stp off
bridge-fd 0
 
This looks not too far of :)

Now you have to add to each VM which needs this new subnet a new NIC (tab "Hardware" on each VM) with vmbr10. Don't forget to configure the ip addresses for this new network in the VMs.

Hint: It would have been possibly easier to add the new vmbr10 via the GUI than to mess with config files. Nevertheless, results should be the same ;)

Note, that without any further (IPv4) forwarding configured, the new subnet will only be reachable on the hypervisor and the VMs with the according NICs.
 
Hi Lorenz

Thanks SO much for the reply. I will apologize in advance for the basic nature of my reply....

Firstly I see your point about the GUI and have added the extra network card to the VM (pic attached).

The default config file for the VM is as follows

auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
address y.y.y.3
netmask 255.255.255.0
gateway y.y.y.1
dns-nameservers 8.8.8.8


I have then tried a range of new combinations to add the extra subnet (see below for what I have tried) but I am unable to ping any of them from our external computer.

auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
address y.y.y.3
netmask 255.255.255.0
gateway y.y.y.1
dns-nameservers 8.8.8.8

auto ens18:1
iface ens18:1 inet static
address z.z.z.3
netmask 255.255.255.255
broadcast z.z.z.3


OR


auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
address y.y.y.3
netmask 255.255.255.0
gateway y.y.y.1
dns-nameservers 8.8.8.8

auto ens19
iface ens19 inet static
address z.z.z.3
netmask 255.255.255.255
broadcast z.z.z.3



Any help much appreciated on the correct settings for the VM

Thank you!
 

Attachments

  • Screenshot 2021-05-19 at 14.42.36.png
    Screenshot 2021-05-19 at 14.42.36.png
    60.8 KB · Views: 3
I think, you mixed up your net0/net1 config:
Currently net0 is attached to vmbr10 and would correspond to ens18 (which should be vmbr0, I think?)

To get the names of the interfaces use ip a (short for ip address)
Furthermore, there are plenty of tutorials online for configuring IP addresses in Ubuntu/Debian - Google is your friend.

Why do you specify broadcast in ens19? and why is the netmask /32? This way you will not be able to ping any other device...

Simplest way would be (assuming the interface name is ens19):
Code:
auto ens19
iface ens19 inet static
address z.z.z.3
netmask 24

This configures an address in a /24 subnet without any gateway information.
 

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!