Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static IPv4 and IPv6 in a DHCPv4 and DHCPv6 environment #434

Closed
Kenny-a11y opened this issue Jan 16, 2025 · 7 comments
Closed

Static IPv4 and IPv6 in a DHCPv4 and DHCPv6 environment #434

Kenny-a11y opened this issue Jan 16, 2025 · 7 comments

Comments

@Kenny-a11y
Copy link

Kenny-a11y commented Jan 16, 2025

hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
reboot 10

interface eth0
nodhcp
nodhcp6
noipv6rs
metric 100
static ip6_address=2001:db8:abcd:1234::178/64
static ip6routers=2001:db8:abcd:1234::2
static ip_address=10.11.12.100/24
static routers=10.11.12.101
static domain_name_servers=8.8.8.8 1.1.1.1

So after putting this configuration the DHCPv4 and DHCPv6 addresses were still getting lease and configured on my device despite me not wanting DHCPv4 and DHCPv6 addresses. All this configuration did was added a the static IPv4 and IPv6 addresses on top of the DHCPv4 and v6 addresses. All i want is static IPv4 and static IPv6. Is there a way to fully stop DHCPv4 and DHCPv6 addresses?

Versions:
Device: Raspi (Bullseye)
OS: Debain GNU/Linux 11
dhcp: 8.1.2

@rsmarples
Copy link
Member

So when dhcpcd applies any config regardless of source, it won't remove or change any existing config unless it needs to - you need to do that by hand or more easily reboot.

Your config looks fine. If you're still getting DHCP of any kind it's not from dhcpcd or it's from another interface. If you think overwise, please supply some debug logs to show this.

@Kenny-a11y
Copy link
Author

Thanks but it after viewing the logs I noticed dhcp.conf is not the one requesting another ip address it probably another service that causes that thanks for the confirmation of my configuration

@perkelix
Copy link
Contributor

You might wanna check whether networkd or network-manager are also installed.

Alternately, for IPv6, the kernel does RS on its own, unless explicitly told not to.

@Kenny-a11y
Copy link
Author

quick question what is the line i should add to to let me add a ipv6 dns server? I want to it to append it to resolv.conf

@perkelix
Copy link
Contributor

If you want to append this, you need to create /etc/resolv.conf.tail with content similar to this:

nameserver 2606:4700:4700::1111

@Kenny-a11y
Copy link
Author

In other word is there no way to add ipv6 dns by using dhcpcd

@rsmarples
Copy link
Member

rsmarples commented Jan 21, 2025

In other word is there no way to add ipv6 dns by using dhcpcd

With dhcpcd and the power of shell scripting you can do pretty much anything. I commented how to do this here.
There is no way to do this in dhcpcd.conf however and I have no wish to add options to do that. That's a rabbit hole I'd rather not go down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants