Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dhcpcd not working for IPv6
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
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Sep 06, 2017 1:33 am    Post subject: [SOLVED] dhcpcd not working for IPv6 Reply with quote

I followed the dhcp set up instructions step by step in the Gentoo Handbook.

I rebooted and it did the dhcp method for IPv6, instead of IPv4.

So I couldn't connect to the internet.

The kernel .config:
https://paste.pound-python.org/show/AMTDQG6cuwcXCMGdAr2/

rc.log for my dhcpcd output: https://paste.pound-python.org/show/NfcWUPNlmuelPPh4vzZr/

Is there any way I can just use IPv4 instead of IPv6?

dhcp in portage is set to version 4, instead of 6, which is stupid.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep


Last edited by roboto on Sun Sep 10, 2017 1:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 595
Location: Italia

PostPosted: Wed Sep 06, 2017 10:06 am    Post subject: Reply with quote

I don't be able to open your kernel config:
https://paste.pound-python.org/show/AMTDQG6cuwcXCMGdAr2/

Maybe you must enable IPV4 and disable IPV6.
I disabled IPV6 in my kernel and now i have only IPV4.

Furthermore, posting /etc/conf.d/net file would be usefull
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Sep 06, 2017 9:17 pm    Post subject: Reply with quote

I'm not sure on how you disable IPv6 and enable IPv4, considering there's no "CONFIG_IPV4" option. Only CONFIG_IPV6

/etc/conf.d/net:

config_enp2s0="dhcp"



.config: https://paste.pound-python.org/show/RFWeJ5XgBA4N4mMAy1j5
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Wed Sep 06, 2017 9:41 pm    Post subject: Reply with quote

I disabled IPv6 entirely just now in my .config and dhcpcd still uses IPv6 addresses. Its output this boot was slightly different.

https://paste.pound-python.org/show/gb8oykgF6RVRsHVfguD8
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Thu Sep 07, 2017 12:45 am    Post subject: Reply with quote

Normally, an IPv6-enabled system will also configure an IPv4 address. This is necessary because key parts of the Internet (in particular, residential ISPs) are years behind on their IPv6 deployment, so trying to run an IPv6 only stack is painful. Please explain why you believe you had only an IPv6 address.

roboto wrote:
dhcp in portage is set to version 4, instead of 6, which is stupid.
Please explain this statement. The DHCP server package version in Portage is version 4. The DHCPCD (client) package in Portage is version 6. Neither of these has any bearing on what IP versions are supported.

roboto wrote:
I disabled IPv6 entirely just now in my .config and dhcpcd still uses IPv6 addresses. Its output this boot was slightly different.
That log appears to cover several reboots, including ones from Tuesday, the day before your post. You did not indicate your local time at the time of the post, so we must guess which log entries were made with your IPv6-disabled kernel. I see one boot at 16:22 that tried to use IPv6. I see another boot at 16:33 that did not.
Back to top
View user's profile Send private message
Maxxx
Guru
Guru


Joined: 12 Jan 2016
Posts: 595
Location: Italia

PostPosted: Thu Sep 07, 2017 8:07 am    Post subject: Reply with quote

What's the output of

Code:
ifconfig


In this output, there should be "inet" line which means IPV4 while "inet6" means IPV6.
If you have "inet" line, your IPV4 is active and loaded from kernel.

For example, i disabled ipv6 directly in kernel and i haven't "inet6" line.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Fri Sep 08, 2017 7:56 pm    Post subject: Reply with quote

Quote:
dhcp_open: enp2s0: Address family not supported by protocol


Oh dear, looks like AF_PACKET aka the Packet Filter isn't enabled in your kernel config.
Quote:
# CONFIG_PACKET is not set


Yup, I was right :)
_________________
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
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Sep 08, 2017 9:24 pm    Post subject: Reply with quote

UberLord wrote:
Quote:
dhcp_open: enp2s0: Address family not supported by protocol


Oh dear, looks like AF_PACKET aka the Packet Filter isn't enabled in your kernel config.
Quote:
# CONFIG_PACKET is not set


Yup, I was right :)

Maybe nitpicking, but shouldn't all the dhcp client packages be using linux-info.eclass to check for that?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sat Sep 09, 2017 12:37 am    Post subject: Reply with quote

That's a good point. Feel free to file a Gentoo bug, hopeful the maintainers can fix all DHCP packages.

But to really pick more nits, they use also add an ipv4 use flag and only test that if enabled.
IPv6 only kernels are a thing as well you know and afaik only dhcpcd supports building as IPv6 only
_________________
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
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21595

PostPosted: Sat Sep 09, 2017 12:40 am    Post subject: Reply with quote

While that warning could be useful, remember that not all systems even have a kernel configuration available when the DHCP client is built, so the test needs to be optional. I have a bit of a sore point about the linux-info.eclass functions from a few years ago when packages kept needlessly dying because, while my kernel was configured correctly, they couldn't prove it, so they aborted.

Also, even when the configuration is available and shows AF_PACKET support, there's no guarantee that the package will be run on a well-configured system, only that the current build host is well-configured.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sat Sep 09, 2017 8:12 am    Post subject: Reply with quote

Hu wrote:
I have a bit of a sore point about the linux-info.eclass functions from a few years ago when packages kept needlessly dying because, while my kernel was configured correctly, they couldn't prove it, so they aborted.


That is truely nefarious!
It should just be a warning at most because it's not API/ABI breaking, just a runtime requirement and guess what - dhcpcd keeps running regardless because other protocols might just work.
_________________
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
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Sun Sep 10, 2017 1:12 am    Post subject: Reply with quote

Enabling AF_PACKET solved my issue, dhcpcd now uses IPv6.

Thank you all very much.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Sun Sep 10, 2017 1:15 am    Post subject: Reply with quote

So AF_PACKET is only needed for IPv4.
AF_INET6 is the sole requirement (afaik) for IPv6.
_________________
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
roboto
Apprentice
Apprentice


Joined: 15 Feb 2017
Posts: 156
Location: My IP address.

PostPosted: Sun Sep 10, 2017 1:23 am    Post subject: Reply with quote

Oops, I meant to say IPv4, sorry.
_________________
Answers please.

The true hater of man expects nothing from him and is indiscriminate to his works.
-Ayn Rand
Quote:
Dude. Minus 30 credibility points.

Yep
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