D
D
Dmitry Q2021-07-19 07:40:25
ubuntu
Dmitry Q, 2021-07-19 07:40:25

How to set a static address on an interface in netplan in addition to a dynamic one?

There is an interface:

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: yes
      mtu: 1500
      nameservers:
        addresses: [8.8.8.8, 77.88.8.8]
      routes:
        - to: 192.168.0.0/24
          via: 192.168.10.240
          on-link: true
        - to: 192.168.100.0/24
          via: 192.168.10.101
          on-link: true

How, in addition to DHCP, to specify a static address on the same interface? address: 192.168.15.250/24

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2021-07-19
@Krotesk

Just add static addresses to this configuration.

A
Alexander Karabanov, 2021-07-19
@karabanov

If netplan can run scripts on an event, then you can write a script that will add a second address after DHCP has completed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question