Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

netifrc: how do I retry dhcp negotiation

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
2 posts • Page 1 of 1
Author
Message
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

netifrc: how do I retry dhcp negotiation

  • Quote

Post by szatox » Mon Mar 02, 2026 11:07 pm

So, I have an rpi and a router connected to the same power socket, and the router boots slower than the rpi when power comes up.
Since DHCP server is not ready when IP is requested, I end up with APIPA address instead and without gateway and all the good stuff. And I wonder, is there any trick inside netifrc that would let it keep trying until it succeeds?

Now, APIPA fallback does come in handy too once in a while, so I don't really want to disable it completely, but a single interface can have multiple addresses, so maybe I could have both of them work independently? I don't know, just thinking out loud.
Should everything else fail, I can always resort to a crude script launched from cron, but maybe there is a better way?

My conf.d/net config contains nothing related to eth0. The defaults are almost perfect, it just gives up too easily.
Make Pipewire a system service
Top
pietinger
Administrator
Administrator
Posts: 6631
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Mar 03, 2026 12:53 am

I found this in /usr/share/doc/netifrc-0.7.13/net.example.bz2
# DHCP
# DHCP can be provided by dhclient, dhcpcd, or udhcpc.
#
# dhclient: emerge net-misc/dhcp
# dhcpcd: emerge net-misc/dhcpcd
# udhcpc: emerge sys-apps/busybox

# If you have more than one DHCP client installed, you need to specify which
# one to use - otherwise we default to dhcpcd if available.
#modules="dhclient" # to select dhclient over dhcpcd
#
# Notes:
# - All clients send the current hostname to the DHCP server by default
# - dhcpcd does not daemonize when the lease time is infinite
# - udhcp-0.9.3-r3 and earlier do not support getting NTP servers
# - DHCP tends to erase any existing device information - so add
# static addresses after dhcp if you need them
# - dhclient and udhcpc can set other resolv.conf options such as "option"
# and "sortlist"- see the System module for more details

# Regardless of which DHCP client you prefer, you configure them the
# same way using one of following depending on which interface modules
# you're using.
#config_eth0="dhcp"

# For passing custom options to dhcpcd use something like the following. This
# example reduces the timeout for retrieving an address from 60 seconds (the
# default) to 10 seconds.
#dhcpcd_eth0="-t 10"

[...]
So , if you use dhcpcd maybe try a "-t 600"?
https://wiki.gentoo.org/wiki/User:Pietinger --> New at Gentoo
Top
Post Reply

2 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic