VM bridge not getting DHCP address for new install.

imam toufique

New Member
Aug 8, 2017
4
0
1
53
Hi All,

I am using version 5.0-23 and have a question on proxmox bridge setup. I added a new network card to setup a new bridge. the card shows up fine in 'lspci' output:

02:00.0 Ethernet controller: Broadcom Limited NetXtreme II BCM5708 Gigabit Ethernet (rev 12)

'lsmod' shows that card is using the 'bnx2' driver, and below is the 'ip link' output:
root@proxmox-ve-1:/etc/network# ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master vmbr1 state UP mode DEFAULT group default qlen 1000
link/ether 00:10:18:48:8d:b4 brd ff:ff:ff:ff:ff:ff

3: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr0 state UP mode DEFAULT group default qlen 1000
link/ether 00:24:e8:36:ad:95 brd ff:ff:ff:ff:ff:ff
4: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:24:e8:36:ad:95 brd ff:ff:ff:ff:ff:ff
5: vmbr1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
link/ether 00:10:18:48:8d:b4 brd ff:ff:ff:ff:ff:ff
10: tap100i0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master vmbr1 state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 92:b0:50:c8:34:29 brd ff:ff:ff:ff:ff:ff

I added a VM bridge called 'vmbr1' , did not assign any IP addresses to it, see the config below for 'vmbr1':

auto lo
iface lo inet loopback
iface enp0s25 inet manual
iface enp2s0 inet manual

auto vmbr0
iface vmbr0 inet static
address 128.xx.xx.xx
netmask 255.255.255.0
gateway 128.xx.xx.1
broadcast 128.xx.xx.255
bridge_ports enp0s25
bridge_stp on
bridge_fd 0

auto vmbr1
iface vmbr1 inet manual
bridge_ports enp2s0
bridge_stp off
bridge_fd 0
#Broadcom NIC

My management interface is 'vmbr0', which is separate, I am not using that for VM connections at all.
This is a new NIC, which is attached to a separate port, works with a laptop for getting DHCP address on the laptop. But when I kick off a VM build (centOS 7, in this case), my build does not get a DHCP address from this 'vmbr1' connection.


Below is the VM config file :
root@proxmox-ve-1:/etc/pve/qemu-server# cat 100.conf

balloon: 256
bootdisk: scsi0
cores: 1
ide2: local:iso/CentOS-6.9-x86_64-netinstall.iso,media=cdrom,size=230M
memory: 512
name: test-1
net0: e1000=D6:01:77:69:43:64,bridge=vmbr1
numa: 0
ostype: l26
scsi0: local-lvm:vm-100-disk-1,size=4G
scsihw: virtio-scsi-pci
smbios1: uuid=917cff14-856d-472d-a7eb-deb28a20b443
sockets:


I have tried 'virtIO' , 'vmxnet' -- both drivers, no luck. I need this part working before I can move on, as I have image systems over PXE.
any help is very much appreciated! Thanks!








 
Just to be clear on how I understand your setup:
  • enp0s25 is meant to connect you to the host and only to the host
  • enp2s0 is meant to connect the VMs to the internet
  • Those NICs are connected to separate networks
  • A laptop connected to network for VMs will get an IP via DHCP, but the VM will not
First off, you should be able to directly configure enp0s25 with the address
Code:
iface enp0s25 inet static
address 128.xx.xx.xx
netmask 255.255.255.0
gateway 128.xx.xx.1
broadcast 128.xx.xx.255
Then you can use vmbr0 for enp2s0
Code:
iface enp2s0 inet manual
auto vmbr0
iface vmbr0 inet manual
bridge_ports enp2s0
bridge_stp on
bridge_fd 0
The VirtIO model should be fine for recent Linux guests. In a quick test I had to manually enable the network device in Anaconda. I'm sure that can be done via command line too, if so desired. But it seems even the netinstall image doesn't activate the network by default.
 
Hi Phillip,

Yes, the netinstall image does not seem to activate network (to grab a DHCP address ) by default. I was wondering if there is a way to do that(?) . I have not tested this setup with a PXE boot , not sure what the outcome might be.

Activating the NIC for DHCP address should be the default, isn't it? ;-)

thanks
 
You should be able to roll your own image, which has DHCP enabled by default. CentOS' standpoint on this is that they can't possibly guess a sane default for any and all network environments, so they just don't. You're the admin, you have the information to enable the NIC with correct config.
But the whole point to PXE is that you don't need a insert an image (via CD, USB or just mounting in a VM) for every machine. The PXE server delivers the image via network. This image can be a finished installation of the OS. There's no need to go through an installer.
 
Yes, the netinstall image does not seem to activate network (to grab a DHCP address ) by default. I was wondering if there is a way to do that(?) . I have not tested this setup with a PXE boot , not sure what the outcome might be.
dhcp is not something you enable/disable on a nic, but this is the operating systems choice.

centos seems to not configure the network at all, and there is nothing from our side that we can change

pxe boot works, you only have to set the boot order to use 'network' first, then the seabios pxe implemenation does the usual pxe thing (dhcp, tftp, etc. )
 

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!