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, 6  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: 6835
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: 5098
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: 547
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: 6835
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: 547
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: 6835
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: 547
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: 6835
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: 547
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: 6835
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: 5098
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: 6835
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: 5098
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
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Mon Jan 05, 2015 9:52 am    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

Dr.Willy wrote:
charles17 wrote:
Also, I am wondering why Gentoo handbook hasn't yet adopted this simplified setup.

That is a good question.

Just opened bug 534752.
Back to top
View user's profile Send private message
v_andal
Guru
Guru


Joined: 26 Aug 2008
Posts: 541
Location: Germany

PostPosted: Mon Jan 05, 2015 4:05 pm    Post subject: Reply with quote

One question. I have network filesystem which is supposed to be mounted on boot. It is listed in /etc/fstab. Things are working fine when I use net.* scripts. Without them, the filesystem is not mounted. I have to do it manually. Is there any simple way to tell dhcpcd to do it? I guess, I can create some script that dhcpcd executes when network is up, but rather relied on existing solution.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Mon Jan 05, 2015 4:27 pm    Post subject: Reply with quote

v_andal wrote:
One question. I have network filesystem which is supposed to be mounted on boot. It is listed in /etc/fstab. Things are working fine when I use net.* scripts. Without them, the filesystem is not mounted. I have to do it manually. Is there any simple way to tell dhcpcd to do it? I guess, I can create some script that dhcpcd executes when network is up, but rather relied on existing solution.
There is /etc/init.d/netmount which is part of openrc.
I have rpcbind and fetchmail being started after dhcpcd comes up. And I guess it sould work for netmount as well.
https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD/Network_dependant_services
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 Mar 23, 2016 2:27 pm    Post subject: Reply with quote

Just linking here to keep it all in one place; new wpa_supplicant should be started as a service.

Note that it's not in ebuild form yet, so just a heads-up.
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Tue Feb 13, 2018 6:05 pm    Post subject: Reply with quote

Do i put static IPv6 gateway just after IPv4 gateway to "static routers" line in dhcpcd.conf or is it even supported?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Feb 13, 2018 10:02 pm    Post subject: Reply with quote

While the setting of a static IPv6 address is supported, routes are not.
You'll still need something broadcasting RA's.
_________________
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
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Fri Feb 16, 2018 11:47 am    Post subject: Reply with quote

UberLord wrote:
While the setting of a static IPv6 address is supported, routes are not.
You'll still need something broadcasting RA's.


Code:
ip -family inet6 route add default via [IPv6-GW] dev eth0


Ok, dhcpcd.conf with static IPv6 address and noipv6rs option with above ip command at local startup script seem keep it working. With ipv6rs enabled it only works for a while, apparently some problem in OVH/Kimsufi network configuration.
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, 6  Next
Page 5 of 6

 
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