0

I have the following config from 18.04 that im bringing to 20.04:

auto lo
iface lo inet loopback
auto enp0s31f6 enp0s31f6:1
iface enp0s31f6 inet static
address 10.42.2.2
netmask 255.255.255.0

iface enp0s31f6:1 inet dhcp

basically I have an interface that I want to give a static ip AND dhcp. This config worked great but I'm not sure how to configure this with netplan on 20.04

What is the equivalent yaml file for this?

mugetsu
  • 165

1 Answers1

1

This is very simply converted; the only significant difference is that in netplan you would do both dhcp and static addresses on the same interface, rather than using an interface alias for one of the addresses (since interface aliases are deprecated):

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s31f6:
      dhcp4: true
      addresses: [10.42.2.2/24]
slangasek
  • 5,562