Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP: Complete network stack without net.* scripts
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Fri Sep 19, 2014 7:17 pm    Post subject: Reply with quote

I think the clue is that you're starting wpa_supplicant via /etc/init.d

With everything working, do this
Code:

dhcpcd -x
pkill wpa_supplicant
dhcpcd -dB


Watch in the console.
If you don't get the message that dhcpcd is starting wpa_supplicant then something is wrong with your setup - probably the wpa_supplicant.conf dhcpcd is using.
_________________
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
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2659

PostPosted: Sun Sep 21, 2014 5:45 pm    Post subject: Reply with quote

UberLord wrote:
With everything working, do this
Code:

dhcpcd -x
pkill wpa_supplicant
dhcpcd -dB

Tried watching the startup procedure with wpa_supplicat and dhcpcd killed. So just only
Code:
dhcpcd -dB

And everything runs fine. But what is "if_disable_autolinklocal: Invalid argument"?
Code:
$ su -c "dhcpcd -dB"
Password:
dhcpcd[23772]: version 6.4.5 starting
dhcpcd[23772]: udev: starting
dhcpcd[23772]: dev: loaded udev
dhcpcd[23772]: enp2s14: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: adding address fe80::b7ef:4566:e492:4625
dhcpcd[23772]: wlp8s0: vltime infinity, pltime infinity
dhcpcd[23772]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
dhcpcd[23772]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
dhcpcd[23824]: wlp8s0: starting wpa_supplicant
ntpd             | * Stopping ntpd ... [ ok ]
ntpd             | * Starting ntpd ... [ ok ]
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
dhcpcd[23772]: no interfaces have a carrier
dhcpcd[23772]: enp2s14: waiting for carrier
dhcpcd[23772]: wlp8s0: waiting for carrier
dhcpcd[23772]: wlp8s0: carrier acquired
dhcpcd[23772]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
dhcpcd[23772]: DUID 00:01:00:01:0f:02:bb:59:00:1b:77:b1:c8:8e
dhcpcd[23772]: wlp8s0: IAID 77:b1:c8:8e
dhcpcd[23772]: wlp8s0: delaying IPv6 router solictation for 0.5 seconds
dhcpcd[23772]: wlp8s0: delaying IPv4 for 0.3 seconds
dhcpcd[23772]: wlp8s0: reading lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[23772]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[23772]: wlp8s0: sending REQUEST (xid 0xdec22e04), next in 4.3 seconds
dhcpcd[23772]: wlp8s0: acknowledged 192.168.178.23 from 192.168.178.1
dhcpcd[23772]: wlp8s0: leased 192.168.178.23 for 864000 seconds
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Sun Sep 21, 2014 6:42 pm    Post subject: Reply with quote

charles17 wrote:
startup procedure with wpa_supplicat and dhcpcd killed. So just only
Code:
dhcpcd -dB

And everything runs fine. But what is "if_disable_autolinklocal: Invalid argument"?


It means you kernel is too old for that feature.
Due to the wisdom the of the linux kernel devs, we have no way of knowing if it exists at compile time so we force the value but only show an error with debugging enabled.

OK, so it does appear to be working. Could be a race somewhere. Try changing your kernel hack to this

Code:
rmmod module
sleep 3
insmod module


Or this

Code:

dhcpcd -x
rmmod module
insmod module
dhcpcd -d

_________________
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
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2273
Location: Bardowick, Germany

PostPosted: Mon Sep 22, 2014 7:29 am    Post subject: Reply with quote

Yamakuzure wrote:
UberLord wrote:
Have to ask why do this anyway? Just keep the module and don't rfkill on suspend?
There is a bug that causes the driver to fail to connect anywhere when the card came out of resume. rmmod+insmod is the "official" workaround.
UberLord wrote:
Going to assume that the interface it will add is allowed.
Quote:
Code:

interface wlan1
env ifwireless=1


You shouldn't need that with dhcpcd-6.4.5
I have updated today after spotting the update. Haven't tried out whether the issue might be fixed completely with the new version. I'll reply to that once I have tested it.
One try with the new version yesterday. After wakeup the network status applet showed that the device does not exist (module not loaded), after a second it changed to "not connected", a second later it changed to "connected". Tried a ping on google, it worked.

Wow. That new version of dhcpcd really seemed to do do the trick! Thank you very much!
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5021
Location: Dark side of the mood

PostPosted: Fri Nov 07, 2014 11:20 pm    Post subject: Reply with quote

I have an issue here. I have gone through a huge upgrade (stayed months without upgrading) and a lot of packages have been touched so I have really no idea what causes this. Anyway.

I'm running kernel 3.16.6, OpenRC 0.12.4 (without netifrc) and dhcpcd 6.4.7. I noticed when the computer rebooted the loopback interface is down (causing a few services not to start) and I have to either enable /etc/init.d/loopback (which I'd like to avoid) or bring lo up manually and restart all depending services... which I'd like to avoid as well :D . Is there a reason dhcpcd would not bring up lo?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Sat Nov 08, 2014 12:44 am    Post subject: Reply with quote

VinzC wrote:
I have an issue here. I have gone through a huge upgrade (stayed months without upgrading) and a lot of packages have been touched so I have really no idea what causes this. Anyway.

I'm running kernel 3.16.6, OpenRC 0.12.4 (without netifrc) and dhcpcd 6.4.7. I noticed when the computer rebooted the loopback interface is down (causing a few services not to start) and I have to either enable /etc/init.d/loopback (which I'd like to avoid) or bring lo up manually and restart all depending services... which I'd like to avoid as well :D . Is there a reason dhcpcd would not bring up lo?


dhcpcd does not bring up a loopback interface unless instructed to.

EDIT: To be fair, I've never tested it bringing one up either
_________________
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
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5021
Location: Dark side of the mood

PostPosted: Sat Nov 08, 2014 3:35 pm    Post subject: Reply with quote

UberLord wrote:
dhcpcd does not bring up a loopback interface unless instructed to.

Thanks, Roy. I must confess I crawled the man page several times but couldn't find a hint. Is it through a hook of some sort?

UberLord wrote:
EDIT: To be fair, I've never tested it bringing one up either

I might be soon :D .
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Sat Nov 08, 2014 4:46 pm    Post subject: Reply with quote

try this

Code:

allowinterfaces lo *

interface lo
static ip_address=127.0.0.1/8

_________________
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
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5021
Location: Dark side of the mood

PostPosted: Sat Nov 08, 2014 5:11 pm    Post subject: Reply with quote

Trying it right now. Back in a minute...

EDIT: Back! Roy, I owe you some beercoins. Thanks a lot, man 8) .
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Nov 15, 2014 12:16 pm    Post subject: Reply with quote

Heh guess you can edit this post to say "yes" then?
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 500
Location: NRW, Germany

PostPosted: Sat Nov 15, 2014 1:06 pm    Post subject: Reply with quote

And http://wiki.gentoo.org/wiki/Dhcpcd#Migration_from_Gentoo_net..2A_scripts
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Mon Nov 17, 2014 10:55 am    Post subject: Reply with quote

steveL wrote:
Heh guess you can edit this post to say "yes" then?


Well, he needs to edit it to include the allowinterfaces line as well...
_________________
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
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 500
Location: NRW, Germany

PostPosted: Mon Nov 17, 2014 3:34 pm    Post subject: Reply with quote

UberLord wrote:
Well, he needs to edit it to include the allowinterfaces line as well...

2 questions:
- what is the default value for allowinterfaces?
- why doesn't configuring an interface via 'interface foo' add it to the allowed interfaces?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Mon Nov 17, 2014 3:42 pm    Post subject: Reply with quote

Dr.Willy wrote:
UberLord wrote:
Well, he needs to edit it to include the allowinterfaces line as well...

2 questions:
- what is the default value for allowinterfaces?
- why doesn't configuring an interface via 'interface foo' add it to the allowed interfaces?


The default value for allowinterfaces is nothing, which is to say allow all interfaces except for loopback and pointopoint interfaces.

As to the latter, well that's a good question.
I suppose that if allowinterfaces is NOT defined in the config, we could append it in code.
_________________
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
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 500
Location: NRW, Germany

PostPosted: Mon Nov 17, 2014 4:46 pm    Post subject: Reply with quote

UberLord wrote:
The default value for allowinterfaces is nothing, which is to say allow all interfaces except for loopback and pointopoint interfaces.

So is 'allowinterfaces lo *' actually equivalent to just adding lo or does it also add pointtopoint interfaces?

UberLord wrote:
I suppose that if allowinterfaces is NOT defined in the config, we could append it in code.

Does that even make sense at all? I mean creating a specific configuration for an interface while not letting dhcpcd discover it?
Because otherwise I'd say add it to allowinterfaces unless it's in denyinterfaces.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Mon Nov 17, 2014 4:52 pm    Post subject: Reply with quote

Dr.Willy wrote:
UberLord wrote:
The default value for allowinterfaces is nothing, which is to say allow all interfaces except for loopback and pointopoint interfaces.

So is 'allowinterfaces lo *' actually equivalent to just adding lo or does it also add pointtopoint interfaces?


Heh, yeah it does by virtue of the *

Quote:
UberLord wrote:
I suppose that if allowinterfaces is NOT defined in the config, we could append it in code.

Does that even make sense at all? I mean creating a specific configuration for an interface while not letting dhcpcd discover it?
Because otherwise I'd say add it to allowinterfaces unless it's in denyinterfaces.


Yes in my mind it does make sense.
Take apache, or any server daemon, with allow/deny directives. They override any other setting. dhcpcd takes the same approach.
_________________
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
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 500
Location: NRW, Germany

PostPosted: Mon Nov 17, 2014 5:20 pm    Post subject: Reply with quote

UberLord wrote:
Heh, yeah it does by virtue of the *

Sooo … 'allowinterfaces lo *' actually does the same as 'allowinterfaces *'?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Mon Nov 17, 2014 5:45 pm    Post subject: Reply with quote

Yes it does.

I could have worded it better I suppose, maybe something this like:

Ensure that lo appears as a valid match in the allowinterfaces directive.

But I also wanted to give a working code example.
_________________
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
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Tue Nov 18, 2014 2:42 am    Post subject: Reply with quote

Hmm I agree it should just add a configured interface; it seems odd to have allow everything, and really I'd just want whatever I configure as root to be added to the set, without needing to do anything else.

Apologies if I'm missing some subtlety.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5021
Location: Dark side of the mood

PostPosted: Tue Nov 18, 2014 9:53 am    Post subject: Reply with quote

steveL wrote:
Heh guess you can edit this post to say "yes" then?


I forgot about that post but anyway the first post in this topic, which is *the* reference, has already been updated.

steveL wrote:
Hmm I agree it should just add a configured interface; it seems odd to have allow everything, and really I'd just want whatever I configure as root to be added to the set, without needing to do anything else.

Apologies if I'm missing some subtlety.


Well, not sure if this was the intent but let's not confuse *configuring* an interface and *bring it up/down*, which aren't the same thing. To me at least. As a matter of fact, leaving allowinterfaces blank doesn't stop dhcpcd from configuring the interface. The directive must include lo to also bring it up.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6754
Location: Blighty

PostPosted: Tue Nov 18, 2014 12:10 pm    Post subject: Reply with quote

steveL wrote:
Hmm I agree it should just add a configured interface; it seems odd to have allow everything, and really I'd just want whatever I configure as root to be added to the set, without needing to do anything else.

Apologies if I'm missing some subtlety.


This has now been implemented.
However, allowinterfaces is still respected above everything else.
_________________
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
Schnulli
Guru
Guru


Joined: 25 Jun 2010
Posts: 320
Location: Bremen DE

PostPosted: Tue Dec 09, 2014 12:00 am    Post subject: Reply with quote

VinzC ......pssssst
have a look at RedHat and CentOS scripts "ifnetup and ifnetdown"
they usually work fine and might help you and us all ;)
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5021
Location: Dark side of the mood

PostPosted: Wed Dec 10, 2014 7:36 am    Post subject: Reply with quote

Schnulli wrote:
VinzC ......pssssst
have a look at RedHat and CentOS scripts "ifnetup and ifnetdown"
they usually work fine and might help you and us all ;)

:lol:

I prefer dhcpcd's simplicity though. One script, one config, fits most cases. I know CentOS/RH network management but I still find it too complex for the simplest setup.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Schnulli
Guru
Guru


Joined: 25 Jun 2010
Posts: 320
Location: Bremen DE

PostPosted: Wed Dec 10, 2014 4:12 pm    Post subject: Reply with quote

the ifnetup and ifnetdown scripts are a good example to have a cron checking if or dont connected ^^ thats all, complex yes, but works.....
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Dec 10, 2014 8:35 pm    Post subject: Reply with quote

steveL wrote:
I'd just want whatever I configure as root to be added to the set, without needing to do anything else.

UberLord wrote:
This has now been implemented.
However, allowinterfaces is still respected above everything else.

Ah thanks, nice one :-) I take it you mean for deny?
Schnulli wrote:
the ifnetup and ifnetdown scripts are a good example to have a cron checking if or dont connected ^^ thats all, complex yes, but works.....

It's better to post a link to a [url], usually from a version-control web-interface, if you want people to look at stuff.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
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