Opened 8 years ago

#103 new defect

debirf should be able to use kernel parameters to preconfigure network

Reported by: dkg Owned by: jrollins
Priority: major Component: debirf
Keywords: debirf networking Cc:


Pavel Piatruk writes:

I suggest to write init-script which will parse /proc/cmdline and will create /etc/network/interfaces with founded IP address, netmask and gateway. Then we should put this init-script before /etc/init.d/networking.

So kernel could be booted like this

vmlinuz eth0-ip= eth0-gateway= \
eth0-netmask= eth0-dns=

I think that recompilation of whole image to adjust these network settings (in case there is no dhcp) is expensive operation.

This seems like a useful feature to me, because it would let administrators share a debirf image across a range of hosts which they would rather not use DHCP for.

I wonder whether it would be more useful to prebuild /etc/network/interfaces or to simply use /bin/ip to configure the given interface directly. Using /bin/ip would enable a more compact CIDR notation for address/netmask.

and i think the DNS setting (and maybe the gateway?) should be NIC-independent.

So my vision of a parseable /proc/cmdline might look like:

vmlinuz ip-addr-eth0= ip-gateway= dns-nameserver=

which would translate into the following commands at boot:

ip addr add dev eth0
ip route add default via
echo "nameserver" >> /etc/resolv.conf

Change History (0)

Note: See TracTickets for help on using tickets.