Score:0

DHCP address keeps getting generated with netplan and bonded interface

eg flag

I have a bonded interface set up with netplan. Config is as follows:

# This is the network config written by 'subiquity'
network:
    bonds:
        bond0:
            addresses: [192.168.65.90/18]
            gateway4: 192.168.64.1
            interfaces:
            - eno1
            - eno2
            nameservers:
                addresses: [192.168.3.222,192.168.70.80]
            parameters:
                mode: active-backup
                primary: eno1
                mii-monitor-interval: 100
    ethernets:
        eno1: {}
        eno2: {}
    version: 2
    renderer: networkd

This is how I configure any server that uses a bonded interface, but something is off with this one. It keeps grabbing a DHCP address and I can no longer ssh into the server.

I also see this many times in /var/log/syslog:

dhclient[1357]: DHCPREQUEST for 192.168.25.226 on eno1 to 192.168.3.222 port 67 (xid=0x17fa4eb1)

How do I stop this from happening? I keep having to run netplan generate and netplan apply to get the static IP back.

Every other server that has this exact config keeps its static IP. I don't know where to look to determine what is doing it.

I see this process running. Could it be related?

root@my_server:/var/log# ps -ef | grep dhclient
root        1357       1  0 Nov22 ?        00:00:02 dhclient <--- THIS ONE
root      109077  108785  0 18:24 pts/3    00:00:00 grep --color=auto dhclient
Doug Smythies avatar
gn flag
Yes, as far as I know dhclient should not be running on a 20.04 system. Was your system upgraded from a previous release, like 18.04? I do not know how to disable dhclient.
DevOpsSauce avatar
eg flag
It was a fresh install of 20.04. I killed the process and have not seen the problem return.......yet.
Score:2
us flag

Networkd never invokes dhclient. This running dhclient process is the result of something else on your system besides your netplan config. Killing the process and checking that it does not return (including after a reboot) is the correct approach.

If it does return, you will want to check for other configuration under /etc, such as /etc/network/interfaces.

DevOpsSauce avatar
eg flag
That works for me. It's been almost 2 hours and it hasn't kicked me out of my ssh session and my `ifconfig` is still showing my static IP. It was probably something I did. I'm just not finding it in my bash history. Thank you for the tip!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.