Subject: [alpine-devel] [RFC] replace network config with dhcpcd

From: Natanael Copa <[email-masked]>
Date: Thu, 22 Jul 2010 16:45:37 +0200

Hi,

Here is a crazy idea: let dhcpcd handle all network config.

Yes. dhcpcd is more than just a dhcp client, its like a netinterface
monitoring tool that can do link detection, set static ip address,
monitor ppp interface (and run hooks) and more.

Why?
Basically, ifup/ifdown and /etc/network/interfaces is not good enough.
Some of the problems:
* ifup -a (called by network start) will exit with failure if a dhcp
configured interface fails. this is not good as since the "net"
serivices is not started, none of the serivces depending on it won't
start. So you won't be able ssh to your box if ISP (via dhcp) is down.
* ifup <dhcp interface>, change interfaces file to static , ifdown &&
ifup. whoops! dhcp was not killed.
* only a wrapper to configure vlans, bonding and ppp interfaces. (you
put your script in the interfaces file)
* no link detection (do actions when link is detected)
* other distros seems to move to NetworkManager and such.

Some benefits with dhcpcd
* you can do fork to background on boot so "net" service starts
sucessful, even if ISP is down so all services depending on net starts
(firewall, sshd etc)
* link detection
* support for monitoring 3rdparty interfaces like ppp0 and execute
hooks on events. (useful for multi-isp with failover)
* dbus management interface that can modify the config file for you
(will probably make the ACF coding simpler)
* IPv4LL support (rfc 3927)

Some drawbacks:
* This is a *big* change that will basically break every configuration
out there. Way scary. However, most of it is there already.
Configuring static ip address and dhcp is there and works very well
(with link detection - plug out cable and static ip goes away from
interface - unless 'nolink' is configured in dhcpcd.conf)
* we need figure out how to configure ppp interfaces and how to set up
vlans/bond interfaces. Basically, we need to move the scripts some
place else (dhcp hooks?)
* there is currently no easy/obvious way to 'disable' an interface
temporarily. Well, there is: 'ip link set dev eth0' down will flush
the address and 'ip link set dev0 up' will have dhcpcd to reconfigure
it.
* lots of documentation needs to be written

Thoughts?

Since alpine-2.0 is breaking alots of things already, this might be a
good time to break even more things...

-- 
Natanael Copa

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 22 Jul 2010 17:02:27 +0200

> Here is a crazy idea: let dhcpcd handle all network config.

I forgot to say, the biggest benefit would probably be that networking
would probably be alot more reliable.

Some options we have to configure loopback interface if we go for full
dhcpcd - since dhcpcd does not handle looopback interfaces at all:
* keep 'iface lo inet loopback' in  /etc/network/interfaces and start
'networking' service in addition to 'dhcpcd' service. (I dot this on
my lappy now - i'm not too happy with it)
* create a separate /etc/init.d/loopback service that only brings up
the lo interface.
* add a config option to /etc/conf.d/dhcpcd: enable_loopback=yes and
have the dhcpcd init.d script to configure it together with starting
dhcpcd.

I think I prefer the third option, but i woudl be ok with the separate
loopback service too (and have dhcpcd depend on it).

-- 
Natanael Copa

---

---

From: Nathan Angelacos <[email-masked]>
Date: Thu, 22 Jul 2010 17:50:15 -0700

Just so we are all talking about the same thing, do you mean

1. http://www.phystech.com/download/dhcpcd.html
2. http://roy.marples.name/projects/dhcpcd
3. http://developer.berlios.de/projects/dhcpcd/
5. busybox udhcpcd
or another dhcpcd?

---

---

From: Natanael Copa <[email-masked]>
Date: Fri, 23 Jul 2010 08:36:57 +0200

> 1. http://www.phystech.com/download/dhcpcd.html
No

> 3. http://developer.berlios.de/projects/dhcpcd/

Those two are the same. Yes, its Roy Marples' dhcpcd (also author of
openrc). No #2 is the correct homepage.

> or another dhcpcd?

No. this does not do link state and interface monitoring.

-- 
Natanael Copa

---