Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Stopping gentoo from starting network interfaces at boot
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
stan999
n00b
n00b


Joined: 10 Sep 2014
Posts: 3

PostPosted: Wed Sep 10, 2014 8:39 am    Post subject: Stopping gentoo from starting network interfaces at boot Reply with quote

Hi all,

In using Debian Wheezy, I am used to starting network interfaces manually and would like to do the same for Gentoo.

In Debian, I configure the network interfaces in /etc/network/interfaces. And I'll start or stop them using ifup or ifdown.

For example, I could have various configurations for eth0

iface ethofficestatic
iface ethhomestatic
iface ethhomedhcp
iface wlancafedhcp
iface wlanofficedhcp

I would like to do the same in Gentoo except there is no /etc/network/interfaces to be found.

I have one wired port, one wireless, and from time to time I'll plug in an usb-ethernet adapter.

Any ideas / tips?

Thanks in advance!
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Sep 10, 2014 8:47 am    Post subject: Re: Stopping gentoo from starting network interfaces at boot Reply with quote

Why not leave it all to DHCPCD?
Back to top
View user's profile Send private message
stan999
n00b
n00b


Joined: 10 Sep 2014
Posts: 3

PostPosted: Wed Sep 10, 2014 9:11 am    Post subject: Re: Stopping gentoo from starting network interfaces at boot Reply with quote

Hey charles17

I just found out that dhcpcd will start all network interfaces. https://wiki.archlinux.org/index.php/Dhcpcd This is for archlinux but it appears to apply to my case.

I removed dhcpcd and brought in dhclient. Currently I'm able to start eth0 manually and bring in dhcp via dhclient.

To get to static IP address, the usual ifconfig applies. (I'll look into iproute2)

I've looked into your URL. I think it means dhcpcd will be applied to all interfaces - which is not what i want.

charles17 wrote:
Why not leave it all to DHCPCD?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Sep 10, 2014 10:26 am    Post subject: Re: Stopping gentoo from starting network interfaces at boot Reply with quote

stan999 wrote:
I just found out that dhcpcd will start all network interfaces.


You trust a wiki over my fine man pages? dhcpcd(8 ) dhcpcd.conf(5) :)

It will by default, but this can be restricted by the command line or dhcpcd.conf(5).
When triggered via net.* it is restricted.
Quote:

I removed dhcpcd and brought in dhclient. Currently I'm able to start eth0 manually and bring in dhcp via dhclient.


Ewww. dhcpcd is so much better than dhclient. I could bore you with the technical details of why if you wanted.
When running via net.eth0, dhcpcd will behave like dhclient.
Just remember to remove dhcpcd from any default runlevels.

So in summary:

/etc/init.d/net.eth0 will start dhcpcd only for eth0
/etc/init.d/dhcpcd will start dhcpcd for all interfaces unless restricted by dhcpcd.conf(5)

Still, I'd like to know why you feel the urge to manually handle your interfaces. What are your use cases for doing this and why don't you feel they can be automated?
_________________
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
stan999
n00b
n00b


Joined: 10 Sep 2014
Posts: 3

PostPosted: Wed Sep 10, 2014 2:43 pm    Post subject: Re: Stopping gentoo from starting network interfaces at boot Reply with quote

O forgive me UberLord. I am not worthy!

I agree using dhcpcd is much easier than dhclient. I'll find sometime to revert back. I had been spending more than intended on this issue alone (oh the joys of learning!)

The premise for me to manually manage interfaces basically stems from my previous experience using Debian.

I like to start up a machine that does not try to probe or connect to the network when booted up. I'd like the machine to call dhcpcd only (or to a static ip) when i startup the interface.

In my previous debian instance, I had setup two scenarios for eth0. First scenario for it to connect via static ip and the other for it to connect via dhcp. Reason for this, I had port forwarding to the static ip (dmz). Whereas for the dhcp scenario, I didn't want to be in the dmz for normal web surfing.

Does this make sense? There is probably a better way of managing my use cases. I'll be interested to hear from you if there is a better way of doing things.


UberLord wrote:
stan999 wrote:
I just found out that dhcpcd will start all network interfaces.


You trust a wiki over my fine man pages? dhcpcd(8 ) dhcpcd.conf(5) :)

It will by default, but this can be restricted by the command line or dhcpcd.conf(5).
When triggered via net.* it is restricted.
Quote:

I removed dhcpcd and brought in dhclient. Currently I'm able to start eth0 manually and bring in dhcp via dhclient.


Ewww. dhcpcd is so much better than dhclient. I could bore you with the technical details of why if you wanted.
When running via net.eth0, dhcpcd will behave like dhclient.
Just remember to remove dhcpcd from any default runlevels.

So in summary:

/etc/init.d/net.eth0 will start dhcpcd only for eth0
/etc/init.d/dhcpcd will start dhcpcd for all interfaces unless restricted by dhcpcd.conf(5)

Still, I'd like to know why you feel the urge to manually handle your interfaces. What are your use cases for doing this and why don't you feel they can be automated?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Sep 10, 2014 2:56 pm    Post subject: Re: Stopping gentoo from starting network interfaces at boot Reply with quote

stan999 wrote:
O forgive me UberLord. I am not worthy!


https://www.youtube.com/watch?v=-FucbvoFFy0

:D

Quote:
I agree using dhcpcd is much easier than dhclient. I'll find sometime to revert back. I had been spending more than intended on this issue alone (oh the joys of learning!)

The premise for me to manually manage interfaces basically stems from my previous experience using Debian.

I like to start up a machine that does not try to probe or connect to the network when booted up. I'd like the machine to call dhcpcd only (or to a static ip) when i startup the interface.

In my previous debian instance, I had setup two scenarios for eth0. First scenario for it to connect via static ip and the other for it to connect via dhcp. Reason for this, I had port forwarding to the static ip (dmz). Whereas for the dhcp scenario, I didn't want to be in the dmz for normal web surfing.

Does this make sense? There is probably a better way of managing my use cases. I'll be interested to hear from you if there is a better way of doing things.


Scenario 1) eth0 is on the same network. Why not assign a static IP and let dhcpcd get a dynnamic IP? This works fine :) although you'll have to use the ip address command to see it as ifconfig won't show it.

Scenario 2) two different networks. Why not setup dhcpcd to arping your fixed router to setup a static ip and fall back to dhcp if not found?

Both of these are very easily automated :)
_________________
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
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