0

I did everything as in this answer, I can connect with to the VM via the static IP but I still get an IP from the DHCP server instead of the static one on the interface, how is it possible? How do I get rid of it? Could it be because of vnet0? I was experimenting a lot with different configurations on this machine. Something very strange is happening on the network when DHCP was used, Cisco router(an old one) was giving out the same IP address to VMs with different MAC addresses, so trying to go static now.

I'm running Ubuntu Server 18.04.1 with the same OS for the VM

My /etc/network/interfaces on the HOST:

auto br0
iface br0 inet static
address 10.101.22.10
netmask 255.255.255.0
network 10.101.22.0
broadcast 10.101.22.255
gateway 10.101.22.253
dns-nameservers 8.8.8.8
bridge_ports enp3s0
 bridge_fd 9
 bridge_hello 2
 bridge_maxage 12
 bridge_stp off

On the VM:

auto enp1s0
iface enp1s0 inet static
address 10.101.22.11
netmask 255.255.255.0
network 10.101.22.0
broadcast 10.101.22.255
gateway 10.101.22.253
dns-nameservers 8.8.8.8

My ifconfigs are on the host :

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.101.22.10  netmask 255.255.255.0  broadcast 10.101.22.255
        inet6 fe80::325a:3aff:fe81:71d7  prefixlen 64  scopeid 0x20<link>
        ether 30:5a:3a:81:71:d7  txqueuelen 1000  (Ethernet)
        RX packets 3459  bytes 388406 (388.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2126  bytes 281068 (281.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::325a:3aff:fe81:71d7  prefixlen 64  scopeid 0x20<link>
        ether 30:5a:3a:81:71:d7  txqueuelen 1000  (Ethernet)
        RX packets 3492  bytes 759637 (759.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1890  bytes 293653 (293.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 258  bytes 21898 (21.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 258  bytes 21898 (21.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::fc54:ff:fea0:202f  prefixlen 64  scopeid 0x20<link>
        ether fe:54:00:a0:20:2f  txqueuelen 1000  (Ethernet)
        RX packets 887  bytes 121511 (121.5 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1843  bytes 503003 (503.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And on the VM:

enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.101.22.198  netmask 255.255.255.0  broadcast 10.101.22.255
        inet6 fe80::5054:ff:fea0:202f  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:a0:20:2f  txqueuelen 1000  (Ethernet)
        RX packets 1843  bytes 499023 (499.0 KB)
        RX errors 0  dropped 613  overruns 0  frame 0
        TX packets 899  bytes 122831 (122.8 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 166  bytes 13132 (13.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 166  bytes 13132 (13.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
hiigaran
  • 6,473
  • 4
  • 28
  • 40

1 Answers1

0

18.04 does not use /etc/network/interface. You need to get familiar with netplan and configure networking accordingly in /etc/netplan/*yaml

marosg
  • 1,303