Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCPCD fails to assign ip address and local link address
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
yagamiram
n00b
n00b


Joined: 17 Feb 2015
Posts: 13

PostPosted: Tue Mar 31, 2015 1:44 pm    Post subject: DHCPCD fails to assign ip address and local link address Reply with quote

The two network interfaces that I have are :

a. net.net0
b. net.net1

Both are in the runlevels of gentoo.

Now dhcpcd assigns ip address to net.net0 when ethernet is connected and assigns local link address to net.net1 whenever I boot my computer.
If I unplug the ethernet from the computer, it is not assigning anything to net.net0. It is because it waits for carrier status and it gets timed out. How I will make dhcpcd to automatically assign ip address and local link address to net.net0 ?

I pass the command line options of dhcpcd from /etc/config/net file.
Code:


dhcpcd_net0="-b -t 0 --noipv4ll"

config_net0="dhcp"

dhcpcd_net1="-b -t 0 --noipv4ll -S ip_address=203.0.113.1/24"
config_net1="dhcp"
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Apr 01, 2015 12:15 pm    Post subject: Reply with quote

Do you have some other network management in place? Try just adding dhcpcd to the default runlevel and removing net.eth0 and net.eth1 and go from there.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
yagamiram
n00b
n00b


Joined: 17 Feb 2015
Posts: 13

PostPosted: Wed Apr 01, 2015 1:36 pm    Post subject: Reply with quote

Thanks for your suggestion.

What I understood from dhcpcd is, it assigns link local address only when the lease is expired.

Quote:
Local Link configuration
If dhcpcd failed to obtain a lease, it probes for a valid IPv4LL address (aka ZeroConf, aka APIPA). Once obtained it restarts the process of looking for a DHCP server to get a proper address.


And it is possible to forcibly expire the lease when you pass lease time in dhcpcd.conf file:

Quote:
leasetime seconds
Request a leasetime of seconds.


So if lease if expired and Ethernet is connected, dhcpcd tries to renew the lease or it will assign link local address. Now this works even when Ethernet connected/disconnected frequently.

This helped me to solve the problem.

And I cannot remove network interfaces from runlevel as it mandatory to have them at runlevels for my project.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum