case where you do need to use ifupdown instead of netplan

Bug #1826760 reported by Caffeine Addict
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nplan (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I have use the following config in the past to provide redundancy in the event that someone resets the router to factory defaults ... this is no longer possible in netplan.

```
auto enp9s0
iface enp9s0 inet dhcp

auto enp9s0:s
iface enp9s0:s inet static
  address 192.168.4.2
  netmask 255.255.255.0
  gateway 192.168.4.1
  dns-nameservers 8.8.4.4 8.8.8.8
```

Specifically, I want to be able to configure 1x interface (only have one physical eth on the box) to have both a static IP as well as be able to accept a dynamic ip. This setup allows for remote troubleshooting to continue in the even that someone resets the ip range of the local network which would normally kill network connectivity with a static IP.

Revision history for this message
oldMonkey (nsun) wrote :

I find a workaround, it is not perfect but works in most the way I expect.

Here is my /etc/netplan/01-netcfg.yaml

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
# and https://netplan.io/examples
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes
      addresses:
        - 192.168.4.2/24

given dhcp4 enabled on eth0, and assign an extra static ip address to it. This results the eth0 to require DHCP address as well as a manually assigned static ip address.
The little issue is that through ifconfig, I can only see the static ip address with the eth0, even there is a DHCP address has granted from DHCP server and the granted ip address works all fine. (by checking the DHCP server I saw the granted ip address to that MAC address, so did all the tests). Maybe there is a way to tweak /etc/netplan/01-netcfg.yaml to show all ip bound to eth0? I'm not expert on netplan, someone may help!

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Thank you, oldmonkey, that's awesome information and helped me out tremendously.

Revision history for this message
Lukas Märdian (slyon) wrote :

The configuration in comment #1 is actually the way to do this in netplan. One could potentially add a "dhcp4-overrides: {...}" stanza, to make sure the DHCP response does not override the statically configured routes or nameservers (if need be): https://netplan.io/reference/#dhcp-overrides

Does that work for you @caffeineaddict?

Changed in nplan (Ubuntu):
status: New → Incomplete
status: Incomplete → Opinion
status: Opinion → Incomplete
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.