Background
I upgraded my Pi3B from Buster to Bullseye using these instructions.
WiFi is disabled on the Pi. Before the upgrade I had static IP setup and working fine by adding the following lines to the /etc/dhcpcd.conf
:
# Custom static IP address for eth0
interface eth0
static ip_address=192.168.0.65/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
After upgrade to Bullseye the static IP address stopped working and a dynamic IP address 192.168.0.146 was assigned to the Pi. I found out that the Ethernet Interface name has changed from eth0
to enxb827ebaceb8a
. So, I edited /etc/dhcpcd.conf
to:
# Custom static IP address for enxb827ebaceb8a
interface enxb827ebaceb8a
...
...
...
Now I have two IP addresses assigned to the same interface enxb827ebaceb8a
. The hostname -I
give 192.168.0.65 and 192.168.0.146
. ifconfig
shows:
enxb827ebaceb8a: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.65 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::10aa:7b63:4089:8d73 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:ac:eb:8a txqueuelen 1000 (Ethernet)
RX packets 74307 bytes 7398372 (7.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 72692 bytes 23849203 (22.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sudo dhclient -v
shows:
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
RTNETLINK answers: Operation not possible due to RF-kill
Listening on LPF/wlan0/b8:27:eb:f9:be:df
Sending on LPF/wlan0/b8:27:eb:f9:be:df
Listening on LPF/enxb827ebaceb8a/b8:27:eb:ac:eb:8a
Sending on LPF/enxb827ebaceb8a/b8:27:eb:ac:eb:8a
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 4
send_packet: Network is down
dhclient.c:2446: Failed to send 300 byte long packet over wlan0 interface.
DHCPREQUEST for 192.168.0.146 on enxb827ebaceb8a to 255.255.255.255 port 67
receive_packet failed on wlan0: Network is down
DHCPACK of 192.168.0.146 from 192.168.0.1
RTNETLINK answers: File exists
bound to 192.168.0.146 -- renewal in 2861 seconds.
Question
How do I permanently remove the dynamic IP address?
Clarification
This question is not about assigning a predictable or reserved IP address from the DHCP server (the router in my case). I want to set a static IP address outside the range for DHCP IP address assignments, 192.168.0.100
to 192.168.0.250
set in the router.
All my Ethernet connected devices have manually allocated static IP addresses in the range 192.168.0.2
to 192.168.0.99
. This Pi has the static IP address 192.168.0.65
. I don't want to change that. Neither do I want to change the router setting to include this IP address in the DHCP assignment range.
Thanks
dhclient
to remove your fixed IP address. I've not triedbullseye
yet, butdhcpcd
has been the default for a while now... IIRC,dhclient
is installed, but not used in the defaultbuster
networking mix. – Seamus Nov 17 '21 at 23:36dhcpcd
writes other files in/etc
in the course of doing what it does.dhclient
does not *un-write* the filesdhcpcd
makes. THING 2 :man dhcpcd
states:For IPv4, you should use the inform ipaddress option instead of setting a static address.
. – Seamus Nov 18 '21 at 00:14connman
answer" may be the correct one, but your solution would be more helpful to others if you'll useinform
indhcpcd.conf
iaw man pg, and see if that resolves the issue by itself. If you do this, you might also consider editing your question to remove thedhclient
reference as it seems to be a red herring. – Seamus Nov 18 '21 at 00:14