Simplest network for VM ?

ybabel

New Member
Dec 8, 2019
2
0
1
50
Hello, I'm new to proxmox (6). I previously used Virtual Box and vSphere.
I installed proxmox on a Kimsuffi server. It's working well. I can install a VM (a Ubuntu server 18.04 LTS), but I cannot get the network to work. I have tried various tutorial but I'm not used to configure networks on linux and I cannot figure out what's wrong. Many tutorials refers to PVE5, or specific configurations.

By default my /etc/network/interface is :
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

iface enp1s0 inet manual

auto vmbr0
iface vmbr0 inet dhcp
  bridge-ports enp1s0
  bridge-stp off
  bridge-fd 0

On VirtualBox I just add a bridge and that's all ... my VM can access internet. Here, it does not work the same.
What should I do ?
AFAICT I have 2 solutions : fix IP or DHCP.
I have tryed fix IP with this host configuration :
Code:
auto lo
iface lo inet loopback

auto enp1s0
iface enp1s0 inet static
        address  188.xx.xx.41
        netmask  255.255.255.0
        gateway  188.xx.xx.254

auto vmbr0
iface vmbr0 inet static
        address  10.10.10.1
        netmask  255.255.255.0
        bridge_ports none
        bridge_stp off
        bridge_fd 0
        post-up echo 1 > /proc/sys/net/ipv4/ip_forward
        post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp1s0 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp1s0 -j MASQUERADE

and then on the VM 50-cloud-init.yaml
Code:
network:
  version: 2
  ethernets:
    ens18:
      dhcp4: no
      addresses: 
        - 10.10.10.2/24
      gateway4: 188.xx.xx.254
      nameservers:
        adresses: [8.8.8.8]

Ideally I would like to have a DNS so that I can install new VM as needed but for now, static IP working would just be fine because after 2 days of trying, I'm confused and tired.
 

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!