Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Confusion about nework setup
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
hanfi
n00b
n00b


Joined: 18 Apr 2011
Posts: 6

PostPosted: Thu Apr 12, 2012 9:48 am    Post subject: Confusion about nework setup Reply with quote

Hi,

After reading a lot of Things i am still a little bit confused about how to set-up my network correct. Maybe someone can explain some of the stuff below. (I think parts of the confusion come from outdated docs....)

My Laptop has 2 primary network interfaces. eth0 and wlan0.
I want none of them to be used at boot. All of them shall be managed from my gnome-session using NetworkManager.
As far as i Understand, I can do this by not adding /etc.init.d/net.eth0 or /etc/init.d/net.wlan0 as openrc then does not know about these services and does not bring them up.
This works (its what i do currently), but is this the "right" way to do it? Or should I add those /etc/init.d scripts and put "!net.*" as rc_hotplug in /etc/rc.conf instead? Is this the same (well, i think not, but what's the difference..in end effect, not in how openrc deals with this, but that may be interesting too :-p)?

Next thing is what services to start, and when.
At boot i see the message "WARNING: xyz is scheduled to start when Network Manager has started". those are services i added to default runlevel.
This sounds nice, however, NetworkManager HAS started at that point, its just marked "inactive". If i understand this correct, this is due to no network is available at this point (expect the loopback). So i assume this is a good thing (correct?).
How does NetworkManager know about to be "inactive"?
From checking the init scripts, i do not see anything in the (for example) sshd script which would emit this message... how does this "inactivity detection" works?

Now lets take a look at some services.
- "tcsd".
This is part of TPM-things, i do not need/want it to listen on the network. It shall use loopback and nothing else (as far as I understand this daemon is required for TPM tools to work correct).
How do i tell openrc to start this service without NetworkManager?
Would it be "correct" to set the dependency in /etc/init.d/tcsd from "need net" to "need net.lo" (sounds like a hack, so I assume that's not how to do it, but how then...)?
- "sshd".
Well, i want it start on primary external interfaces if it comes up, and stop if it goes down. The point is that i like to have it listen on my eth0 and wlan0 but never on a bluetooth- or USB-Network which I sometimes have.
Would it be "the right way" to create multiple sshd start scripts (using some trickery to set the correct listen IP...)? eg, sshd.eth0 depending on net.eth0, sshd.wlan0 depending on net.wlan0. Or should i do this with scripts inside /etc/NetworkManager/dipsatch.d ?
- "tor".
similar to sshd, but I want it to start on all networks. That's easy, but how do I tell it about switching networks? eg, if I disable eth0 and enable wlan0? then it shall switch to that network (I do not think tor does support this, so I think I have to restart it in this case).. maybe the easiest way is again to restart it when the currently used network goes down? so using /etc/NetworkManager/dispatch.d scripts is better?

I think those questions above boil down to: shall I use /etc/init.d for such things, or drop that and use /etc/NetworkManager/dispatch.d?


Thanks in advance for any light shed into the darkness in my head.
Back to top
View user's profile Send private message
Arkhelion
Apprentice
Apprentice


Joined: 07 Sep 2010
Posts: 151
Location: France

PostPosted: Thu Apr 12, 2012 12:32 pm    Post subject: Reply with quote

If you do use NetworkManager, you don't need to start net.eth0 nor net.wlan0 (and you shouldn't) so they shouldn't be in any runlevel.
I believe that every script that depends on "net" should be handled by the dispatcher in NetworkManager (or you could go over to NetworkManager 0.9.4 and add NetworkManager to default runlevel, it will automatically start eth0, and _then_ will start net dependant scripts).
_________________
Arkhelion
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