leahneukirchen / ignite

OBSOLETE: use Void Linux
Other
66 stars 12 forks source link

static ip configuration #18

Open c00kiemon5ter opened 11 years ago

c00kiemon5ter commented 11 years ago

One can use dhcpcd to request and get a static ip. A eth0-static service would be nice to do that.

I have a branch where I tested such a service and works fine.

This would mean that some variables would need to be configured on /etc/rc.conf. I guess we'd need INTERFACE (or unconditionally eth0) ADDRESS NETMASK GATEWAY BROADCAST and NAMESERVER (?) for such a simple configuration.


If not dhcpcd, ip could be used to achieve a static ip configuration, like:

ip link set dev "$INTERFACE" up &&
ip addr add "${ADDRESS}/${NETMASK}" broadcast "$BROADCAST" dev "$INTERFACE" &&
ip route add default via "$GATEWAY"

ofcourse ip would exit once it's done its job, so it's not very suitable here, but it can be used in /etc/rc.local (for anyone wanting this if this is rejected).


So, that's the idea. I am not sure it's worth it. Configuring in /etc/rc.local should work fine too.

leahneukirchen commented 11 years ago

On some machines, we have been using a script akin to:

ip link set eth0 up
ip addr add XXX dev eth0
ip route add default via XXX
ip -6 route add XXX via XXX mtu XXX
exec pause

Not sure anyone still uses the rc.conf variables. But we could ship something like this as an example.

leahneukirchen commented 11 years ago

Also, one should set the interface down in a finish task.