That's another nice aspect of the new networking, ifplugd became obsolete.d2_racing wrote:Right now, I'm using OpenRc 0.5.2 without any net.lo,net.eth0 and you were right, dhcpcd is acting like ifplugd.

How did we learn this? Having two out of four machines running on funtoo stage3 tarballs, I can say this is false. If you are going to use openrc-0.5.0 or greater, then there is no distinction between Funtoo and Gentoo.sera wrote:As we learned in this thread Funtoo is not the same as Gentoo. Thy have a specialized loopback init script called net.lo, not to be confused with our net.lo.d2_racing wrote:If we refer to the Funtoo doc, then we should use the script.
No. Once again, you see a distinction where none exists. I defy anyone to look at my machines and tell me which ones were born of Gentoo tarballs, and which ones were born of Funtoo tarballs. It can't be done!Network on Gentoo is also to bring up the loopback interface but has a little more functionality on top. You can set routes, static IPs, create bridges and other things.
So unlike Gentoo, Funtoo really needs a separate script if not using dhcpcd.
Code: Select all
# mv /etc/init.d/net.lo /root
`/etc/init.d/net.lo' -> `/root/net.lo'
# rc
* Caching service dependencies...
Service `cherokee' needs non existant service `net'
Service `fetchmail' needs non existant service `net'
Service `git-daemon' needs non existant service `net'
Service `netmount' needs non existant service `net'
Service `ntp-client' needs non existant service `net'
Service `ntpd' needs non existant service `net'
Service `openvpn' needs non existant service `net'
Service `pydoc-2.6' needs non existant service `net'
Service `samba' needs non existant service `net'
Service `saslauthd' needs non existant service `net'
Service `slapd' needs non existant service `net'
Service `slpd' needs non existant service `net'
Service `spawn-fcgi' needs non existant service `net'
Service `squid' needs non existant service `net'
Service `sshd' needs non existant service `net'
Service `svnserve' needs non existant service `net'Code: Select all
# cat /etc/init.d/net.lo
#!/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
depend() {
provide net
}
start() {
ebegin "Bringing up network interface lo"
ifconfig lo 127.0.0.1 netmask 255.0.0.0 up && \
route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
eend $?
}
stop() {
ebegin "Shutting down network interface lo"
route del -net 127.0.0.0 netmask 255.0.0.0 dev lo &&
ifconfig lo down
eend $?
}


Code: Select all
#!/sbin/runscript
# Copyright 2009 Funtoo Technologies, LLC
# All rights reserved. Released under the 2-clause BSD license.
IP=192.168.0.130
NM=255.255.255.0
GW=192.168.0.1
INT=eth0
DOM=no.org
NS1=65.68.49.50
NS2=65.68.49.51
NS3=192.168.0.1
depend() {
provide net
after net.lo
}
start() {
ebegin "Bringing up network interface $INT"
ifconfig $INT $IP netmask $NM up && \
route add default gw $GW $INT && \
resolvconf -a $INT << EOF
domain $DOM
nameserver $NS1
nameserver $NS2
nameserver $NS3
EOF
eend $?
}
stop() {
ebegin "Shutting down network interface $INT"
resolvconf -d $INT && \
route del default gw $GW $INT && \
ifconfig $INT down
eend $?
}
think that "after net.lo" should be replace by "after network" since net.lo doesn't exist anymore on Gentoo ?
Code: Select all
zippy ~ # equery belongs net.lo
[ Searching for file(s) net.lo in *... ]
sys-apps/openrc-0.5.2-r1 (/usr/share/openrc/net.lo -> /etc/init.d/net.lo)
sys-apps/openrc-0.5.2-r1 (/etc/init.d/net.lo)


Probably not. I made up a "simple" script to automatically set this machine for wired or wireless networking depending on whether or not the NIC cable is installed. That script took me a about a week to get right. It will not work with baselayout-2/openrc.Kaste wrote:Hi guys
I tried following all the clues in here but I'm somewhat confused. I have a laptop i try to run under openrc. I need to check first if i get a dhcp server on eth0 (one network) then ping some gateways to figure out which of the static networks I'm on (2 others) and then if that doesn't work start wlan (a few others).
Is this possible at all with openrc without too much fuss and if so how would i go about it?
Greets.
d2_racing wrote:Mike Hunt wrote: In my case I use a static IP, so it is configured in /etc/dhcpcd.conf,Code: Select all
interface eth0 static ip_address=192.168.2.10 static routers=192.168.2.1 static domain_name_servers=192.168.2.1 [/quote] So, what is the best method to do static IP then ? Using the script or using the dhcpcd.conf ?[/quote] Whatever works best for you :) My preference is for dhcpcd.conf because it allows much more easily and dhcpcd-5 replaces a lot of the functionality provided by the old scripts.
Yes, it's a major hack and I think the only viable reason for it would be to save cycles on devices where power efficiency is king and very desperate.Kaste wrote:I have a bunch of scripts that i call depending on where i am at the moment and what connection i prefer in that place but they aren't automated in any way yet in a sense of detecting itself which one should be called.
So i need to invest the energy anyway, i am just trying to figure out if i can integrate that stuff into openrc which i use anyway.
Do you think this is a major hack or not?
No need for that! dhcpcd-5 handles arping profiles also. See this exampleKaste wrote:Well my particular problem is one of the networks where there is a dhcp and it will shell out an adress just fine but that one won't allow me to connect to the internet. I need to set a static Ip in that case and the only way i can think of to detect if i am in that network is pinging the gateway. Is it possible to do this with the dhcpcd hooks?
Code: Select all
interface eth0
arping 192.168.1.1
profile 192.168.1.1
static ip_address=192.168.1.4/24
Code: Select all
BESTIA bin # /etc/init.d/net.eth1 start
net.eth1 |* Bringing up interface eth1
net.eth1 |* Starting wpa_supplicant on eth1... [ ok ]
net.eth1 |* Starting wpa_cli on eth1... [ ok ]
net.eth1 |* Backgrounding ......
net.eth1 |* WARNING: net.eth1 has started, but is inactive
Code: Select all
BESTIA bin # cat /etc/conf.d/wpa_supplicant
wpa_supplicant_conf="/etc/wpa_supplicant/wpa_supplicant.conf"
wpa_supplicant_if="eth1"
Code: Select all
BESTIA ~ # rc-update -s
procfs | boot
keymaps | boot
hwclock | boot
dbus | default
local | default nonetwork
consolekit | default
termencoding | boot
urandom | boot
consolefont | boot
fsck | boot
localmount | boot
xdm | default
dhcpcd | default
netmount | default
hostname | boot
hald | default
network | boot
savecache | shutdown
root | boot
sysctl | boot
mount-ro | shutdown
devfs | sysinit
mtab | boot
modules | boot
killprocs | shutdown
swap | boot
dmesg | sysinit
bootmisc | boot
wpa_supplicant | default
udev | sysinit