You are not logged in.

#1 2023-04-07 18:06:04

the_jest
Member
Registered: 2022-02-07
Posts: 35

dhcpcd not giving a static lease

I'm getting a new computer set up on my network, and although I have set up dhcpcd to set a static lease with a particular IP address, the same way I've previously done it, and seemingly following the docs, I am being given a DHCP lease instead.

I'm using eth0 for my interface (using the "Revert to traditional interface names" section of the Network Configuration docs). I've added to /etc/dhcpcd.conf:

#define static profile
profile static_eth0
static ip_address=10.10.1.50/24
static routers=10.10.1.1
static domain_name_servers=10.10.1.1

# fallback
interface eth0
fallback static_eth0

where 10.10.1.1 is the correct address of my router and DNS server.

I've removed the leases in /var/lib/dhcpcd/, run "dhcpcd -k", and run "dhcpcd", which reports that it is "soliciting a DHCP lease", which the router duly gives, leaving me connected to the network on 10.10.0.220. What am I doing wrong?

Offline

#2 2023-04-07 18:30:22

progandy
Member
Registered: 2012-05-17
Posts: 5,277

Re: dhcpcd not giving a static lease

You are setting the static profile as the fallback, so it will be only used if dhcp fails.
https://wiki.archlinux.org/title/Dhcpcd#Static_profile

Last edited by progandy (2023-04-07 18:36:54)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2023-04-07 18:42:09

the_jest
Member
Registered: 2022-02-07
Posts: 35

Re: dhcpcd not giving a static lease

Huh. I had the fallback line previously, and it worked as expected. But removing it, and changing it to "interface eth0", did in fact do the trick.

Thank you.

Offline

Board footer

Powered by FluxBB