Virtualizing a two NIC server

Michael McNamara

New Member
Nov 24, 2023
2
0
1
We have a physical machine, call it 'web' which had two nics, and we had one on the internal network, and the other on our public IP:

Code:
network:
    version: 2
    renderer: networkd
    ethernets:
        enp3s0:
            dhcp4: no
            addresses:
              - public_ip_address/29     # www, mail, smtp
            gateway4: public_ip_gw
            nameservers:
                addresses: [10.1.10.3, 8.8.8.8, 1.1.1.1]
                search:
                - ourdomain.com
        enp2s0:
            dhcp4: true
We want to virtualize this into VM on a Dell R630 with four NICs, connecting one to the internal network, and the other to the public
network.

How o we replicate this in PXE 8.1.3?

It is simple to connect to the internal network (10.1.10.0/24) , using the default bridge; but how to set up for the public network?

I have vmbr0 set up on the internal network as eno1 10.1.10.40/24
I set up vmbr1 on the public_ip_address/29, but then what do I set the vm's interface to?

[Answer as if I am five years old :) ]

Code:
---
network:
    version: 2
    renderer: networkd
    ethernets:
        ens19:
            dhcp4: false
            addresses:
                - public_ip_address/29     # www, mail, smtp
            routes:
                - to: default
                  via: public_ip_gw
            link-local: [ipv4]
            nameservers:
                addresses: [10.1.10.3, 8.8.8.8, 1.1.1.1]
                search:
                    - adapt-ip.com
        ens18:
            dhcp4: false
            addresses:
                - 10.1.10.9/24
            link-local: [ipv4]
            nameservers:
                addresses: [10.1.10.3]

and the internal network is functional, but can't connect to the external interface from out side...
 
Last edited:
OK, found my issue:

I had:

YAML:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

iface eno3 inet manual

iface eno4 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.1.10.40/24
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
#internal office

auto vmbr1
iface vmbr1 inet manual
        address public_ip_address/29
        bridge-ports eno2
        bridge-stp off
        bridge-fd 0
# public.com

It is a bug to include an address in the second vmbr; so I changed it to:

YAML:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

iface eno3 inet manual

iface eno4 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.1.10.40/24
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
# internal office

auto vmbr1
iface vmbr1 inet manual
        bridge-ports eno2
        bridge-stp off
        bridge-fd 0
#public.com
 
Last edited:
OK, found my issue:

I had:

YAML:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

iface eno3 inet manual

iface eno4 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.1.10.40/24
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
#internal office

auto vmbr1
iface vmbr1 inet manual
        address public_ip_address/29
        bridge-ports eno2
        bridge-stp off
        bridge-fd 0
# public.com

It is a bug to include an address in the second vmbr; so I changed it to:

YAML:
# network interface settings; autogenerated
# Please do NOT modify this file directly, unless you know what
# you're doing.
#
# If you want to manage parts of the network configuration manually,
# please utilize the 'source' or 'source-directory' directives to do
# so.
# PVE will preserve these directives, but will NOT read its network
# configuration from sourced files, so do not attempt to move any of
# the PVE managed interfaces into external files!

auto lo
iface lo inet loopback

iface eno1 inet manual

iface eno2 inet manual

iface eno3 inet manual

iface eno4 inet manual

auto vmbr0
iface vmbr0 inet static
        address 10.1.10.40/24
        bridge-ports eno1
        bridge-stp off
        bridge-fd 0
# internal office

auto vmbr1
iface vmbr1 inet manual
        bridge-ports eno2
        bridge-stp off
        bridge-fd 0
#public.com

I suppose you do not really want any (public) IP on the host, so bridging the NIC and leaving it without any would be the right thing to do.

Did you give your VM both network interfaces? The VM is using netplan with correctly renamed interfaces after you converted it to the VM?

On a second read, you have resolved your issue - you had an IP conflict there, apparently. You can't have the same IP for two machines - in this case host and guest.
 
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!