Skip to main content
Topic: confusion about openrc and networking (Read 2844 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

confusion about openrc and networking

I am suddenly confused about the networking chain with openrc which I thought I understood.

When the machine boots, what scripts in openrc actually bring up the ethernet devices and assigned them IP addresses.

My workstation only has a net.lo, and /etc/conf.d/net is empty.  So it is a puzzle to me how the ethernet device eth0 is being started or what process is picking up dhcp from the network.

Re: confusion about openrc and networking

Reply #1
I fully agree that this is a messy subject, and I don't know much myself.

The core functionality is in the /etc/init.d/net.lo script which you can symlink to net.eth0 for ethernet. The config is in /etc/conf.d/net. This file being empty (or all comments) is normal in most use cases. Just means you're using the default setup. The netifrc package contains a whole lot of other files, though. I assume they are used only internally.

As for dhcp, my understanding is that the netifrc scripts require outside help for this. The comments in a stock /etc/conf.d/net say "DHCP can be provided by dhclient, dhcpcd, or udhcpc."

Indeed, when I had no dhcp client installed and tried to start the net.eth0 service, I got an error that "nothing provides dhcp". But now I'm just running the dhcpcd service, in which case I don't need the net.eth0 script at all... So yes, I am also somewhat confused about what the script really does in the case of ethernet.

Re: confusion about openrc and networking

Reply #2
TL;DR
/etc/conf.d/net shouldn't be empty (delete it and re-install netifrc if it is). By default, dhcp will be fired and IP assigned to wired interfaces and no user intervention is needed.
If you want static IP, edit /etc/conf.d/net and make a symlink of your wired interface to net.lo inside /etc/init.d:
Code: [Select]
host:[root]:/etc/init.d# ln -s net.lo net.eth0

Re: confusion about openrc and networking

Reply #3
then how does one stop the network then other than ifconig or ip set link?

Re: confusion about openrc and networking

Reply #4
also, my dhcp server does not set up ip 6 addresses.  Yet openrc seems to find them

Re: confusion about openrc and networking

Reply #5
Code: [Select]
flatbush:[ruben]:~$ sudo rc-status boot
Runlevel: boot
 hwclock                                                                                                   [  started  ]
 modules                                                                                                   [  started  ]
 fsck                                                                                                      [  started  ]
 root                                                                                                      [  started  ]
 mtab                                                                                                      [  started  ]
 swap                                                                                                      [  started  ]
 localmount                                                                                                [  started  ]
 sysctl                                                                                                    [  started  ]
 bootmisc                                                                                                  [  started  ]
 elogind                                                                                       [  started 20:53:14 (3) ]
 termencoding                                                                                              [  started  ]
 consolefont                                                                                               [  started  ]
 net.lo                                                                                                    [  started  ]
 procfs                                                                                                    [  started  ]
 binfmt                                                                                                    [  started  ]
 esysusers                                                                                                 [  started  ]
 etmpfiles-setup                                                                                           [  started  ]
 hostname                                                                                                  [  started  ]
 keymaps                                                                                                   [  started  ]
 loopback                                                                                                  [  started  ]
 save-keymaps                                                                                              [  started  ]
 save-termencoding                                                                                         [  started  ]
 seedrng                                                                                                          [ started ]



Re: confusion about openrc and networking

Reply #6
that's the service Networkmanager :)
you should see it in
Code: [Select]
rc-status

Re: confusion about openrc and networking

Reply #7
that's the service Networkmanager :)
you should see it in
Code: [Select]
rc-status


Instead of a Networkmanger (and I hate them) they depend on /etc/init.d/net.lo as the network configuration program.  Mind you, I looked over the shell script and barely understand it.  Then again, I barely understand the C code in most of these systems.  Shell just lulls you into this misconception that because you can read it,, it should be easy.   One needs Lew Pitcher -- if he is still alive.