Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCP fails to assign IP [SOLVED]
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
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1159
Location: Online

PostPosted: Thu Sep 21, 2023 7:10 am    Post subject: DHCP fails to assign IP [SOLVED] Reply with quote

At some point last almost 2 years ago, this and a few other problems happened.
One other problem is still ongoing here

So about a couple months ago I did a fresh install.
Result was the same with the same problems. For network to work I have to use IPSET.

Documentation followed:
https://wiki.gentoo.org/wiki/Handbook:AMD64
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking#Using_DHCP
https://wikitest.gentoo.org/wiki/Network_management_using_DHCPCD
https://forums.gentoo.org/viewtopic-t-771986.html (almost worked until reboot)


Code:
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
Kernel driver in use: r8169


The device is up

Code:
# cat /etc/conf.d/net

config_eth0="dhcp"
modules_wlan0="wpa_supplicant"
config_wlan0="dhcp
#macchanger -r wlan0"


I also tried with an empty net config file. It worked once but after reboot, did not work again.

Code:
# dhcpcd eth0
sending commands to dhcpcd process


Does not get the device an ip.

At some point depending on what I try, I get:
Code:
no valid interfaces found


Usually when restarting the network.

I looked into this topic:
https://forums.gentoo.org/viewtopic-t-1148627-highlight-dhcp+valid+interfaces.html

Deleted dhcpcd from default runlevel and restarted net.eth0. Output indicated to have received an address. ifconfig sees no address
Í removed dhcpcd and rebooted.

Nothing provides dhcp was the message after boot.

Similar problem here and no solution
https://forums.gentoo.org/viewtopic-t-1013970-highlight-dhcp+valid+interfaces.html

On my desktop. Everything works.
I cannot see the difference on the configs

Not sure what else to look for and it has been exhausting to the point of overthinking.
_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244


Last edited by HeXiLeD on Fri Dec 15, 2023 5:05 am; edited 2 times in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Thu Sep 21, 2023 11:15 am    Post subject: Reply with quote

Is net.wlan0 also enabled?
If yes plz disable it together with dhcpcd.
And enable only net.eth0.
Do you have a dhcp server installed except the one provided by your router?
_________________
:)
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3138

PostPosted: Thu Sep 21, 2023 11:27 am    Post subject: Reply with quote

That's quite a bit to get through.
So:
* you're configuring the interface with netifrc
* your network uses dhcp
* you have multiple network interface; eth0 doesn't work and you want to fix it. Does wifi work?
* are you able to configure it by typing commands manually instead of starting system services?

Quote:
# cat /etc/conf.d/net

config_eth0="dhcp"
modules_wlan0="wpa_supplicant"
config_wlan0="dhcp
#macchanger -r wlan0"

Is this even a valid config?
If you want to comment macchanger out, terminate the quotation first. The way it is now doesn't look right, though I don't know what is netifrc going to do with this input. It may or may not work, possibly crashing and burning, depending on implementation details.

Quote:
Deleted dhcpcd from default runlevel and restarted net.eth0
Good. They were in a conflict. Use either one or the other.
Do you have any consistent errors? "Depending on what I try" is certainly true, but doesn't help a lot. We need to be on the same page, gotta start from a known state.

Also, you might try this:
Reboot your system to clear all changes you made in the runtime, and see which services providing net are active. There were some not so funny issues with service dependencies a caused by an ebuild update few months ago.

Quote:
On my desktop. Everything works.
Does your desktop has exactly the same network interfaces? The same number of interfaces, named in the same way?
Some bugs only bite if certain conditions are met.
Back to top
View user's profile Send private message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1159
Location: Online

PostPosted: Mon Sep 25, 2023 10:24 am    Post subject: Reply with quote

This conf was an error of mine after long hours and lost sleep over this issue. Once corrected , eth0 is now working.

Quote:
# cat /etc/conf.d/net

config_eth0="dhcp"
modules_wlan0="wpa_supplicant"
config_wlan0="dhcp
#macchanger -r wlan0"

Is this even a valid config?
If you want to comment macchanger out, terminate the quotation first. The way it is now doesn't look right, though I don't know what is netifrc going to do with this input. It may or may not work, possibly crashing and burning, depending on implementation details.

[/quote]

Wifi is not working at this moment.
The interface detects and finds the wireless network but does not obtain an ip or connects.

# cat /etc/wpa_supplicant/wpa_supplicant.conf

Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
update_config=1

network={
        ssid="SSI"
        psk="mypass"
        proto=RSN
        key_mgmt=WPA-PSK
        auth_alg=OPEN
        mesh_fwding=1
}


User is on the wheel group


# rc-update show | grep net*

Code:
    local |      default nonetwork                 
             net.eth0 |      default                           
             net.lo |      default                                                 
             netmount |      default         


Desktop uses dhcp and not net. scripts

I would ditch the net.scripts if dhcpcd worked.
_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54254
Location: 56N 3W

PostPosted: Mon Sep 25, 2023 10:28 am    Post subject: Reply with quote

HeXiLeD,

Stop the interface you want to use dhcpcd on.
Make sure dhcpcd is not already running.

What does
Code:
dhcpcd -v <interface>
tell?
The whole command and output please.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1159
Location: Online

PostPosted: Mon Sep 25, 2023 12:10 pm    Post subject: Reply with quote

On boot eth0 does not come up because it was removed from run levels.

Code:
ifconfig eth0 up
dhcpcd -v eth0

invalid vendor format: eth0


/etc/dhcpcd.conf is also not writable

Right now I will either use dhcpdc for one interface that semi-works or net-misc/netifrc for the other interface.
_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1661

PostPosted: Mon Sep 25, 2023 1:06 pm    Post subject: Reply with quote

I think Neddy meant the -d option (--debug) instead of -v (which is often verbose, but here it is --vendor).

In any case, are there firmware error messages in dmesg for this ethernet device? Some do need it including several recent RealTek.
Back to top
View user's profile Send private message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1159
Location: Online

PostPosted: Mon Sep 25, 2023 1:48 pm    Post subject: Reply with quote

Code:
 dhcpcd -d eth0
sending commands to dhcpcd process
send OK


No error messages.

The eth0 also does not come up on boot.
In any case it needs:

Code:
ifconfig eth0 up

_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Back to top
View user's profile Send private message
HeXiLeD
Veteran
Veteran


Joined: 20 Aug 2005
Posts: 1159
Location: Online

PostPosted: Fri Dec 15, 2023 5:05 am    Post subject: Reply with quote

Code:

emerge -C net-misc/dhcpcd net-misc/dhcpcd-ui
emerge net-misc/dhcp


cat /etc/conf.d/net
Code:

# https://wiki.gentoo.org/wiki/Handbook:X86/Installation/System#Network
# https://wiki.gentoo.org/wiki/Netifrc

config_eth0="dhcp"

# https://wiki.gentoo.org/wiki/Netifrc#DHCP_with_WPA_Supplicant
modules_wlan0="wpa_supplicant"
wpa_supplicant_wlan0="-Dnl80211 -d -f /var/log/wpa_supplicant.log"
config_wlan0="dhcp"



Went back to openrc scripts, ie: net.eth0
Wired and wireless network is now working after months and months of no solution.

cd /etc/init.d/

Code:

ln -s net.lo net.eth0
ln -s net.lo net.wlan0

rc-update add net.eth0 default
rc-update add net.wlan0 default

rc-update  del wpa_supplicant default


rc-update show default | grep net

Code:
             net.eth0 | default
               net.lo | default
            net.wlan0 | default
             netmount | default


This problem is [SOLVED]
_________________
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
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