1

I have setup an Ubuntu Server 18.04. There's no network manager active, so configuration is done in /etc/network/interfaces.

In the network there's a dhcp server active.

/etc/network/interfaces content:

auto enp1s0
iface enp1s0 inet dhcp

auto enp2s0
iface enp2s0 inet static
    address 0.0.0.0
    up sysctl -w net.ipv6.conf.enp2s0.disable_ipv6=1

auto enp3s0
iface enp3s0 inet static
    address 0.0.0.0
    up sysctl -w net.ipv6.conf.enp3s0.disable_ipv6=1

The interface enp1s0 should be used by the ubuntu server to access the Lan and should acquire address automatically.

The interfaces enp2s0 and enp3s0 should be online, but the Ubuntu server should not be able to make any networking through them. There's a vm running as service with PfSense that uses the enp2s0 as Lan and enp3s0 as Wan interface.

My actual problem: the automatic configuration for the enp1s0 only works right after boot. If I unplug the Ethernet cable from enp1s0 and reconnect it, the Ubuntu server doesn't detect that there's a linkup event and contact the dhcp again. It just keeps the configuration it got after boot.

How can I tell my server to reset and reconfigure the interface after each linkup like it would be on a desktop installation by default?

2
  • Networking is Ubuntu server 18.04 is not handled by /etc/network/interfaces; it is handled by netplan. I don't know how to accomplish the exact thing you are trying to do here or I'd propose an answer.
    – chili555
    Jun 14, 2018 at 14:55
  • Huge thanks for the hint to netplan. I installed the system in a VM onto a rawdisk usb stick and duplicated it, booted this installation on my APU and copied the duplicate over there. After checking /etc/netplan I found a file there, seems to be placed there from the installation in the VM. The network interface had another name there. Got it working now with a combination of netplan and /etc/network/interfaces 👍
    – 9Lukas5
    Jun 14, 2018 at 18:31

1 Answer 1

0

Thanks to @chili555 I looked into netplan and found a working solution:

In /etc/netplan I set the interface I wanted my server for it's own usage.

Sadly I couldn't get it all there configured, as I wanted the interfaces 2 and 3 be only enabled, but without any addresses. Therefore I left those two interfaces to /etc/network/interfaces file.

=> Now working setup as follows:

Content of /etc/netplan/01-netcfg.yaml

network:
    version: 2
    renderer: networkd
    ethernets:
        enp1s0:
            dhcp4: yes

Content of /etc/network/interfaces:

auto enp2s0
iface enp2s0 inet static
    address 0.0.0.0
    up sysctl -w net.ipv6.conf.enp2s0.disable_ipv6=1

auto enp3s0
iface enp3s0 inet static
    address 0.0.0.0
    up sysctl -w net.ipv6.conf.enp3s0.disable_ipv6=1

Now my setup works as expected: enp1s0 is fully automatically mamaged and I on every linkup I do it makes a new dhcp request.

enp2s0 and enp3s0 are both without ipv4/6 addresses and can be used from my pfSense Virtual machine

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .