Oh well, that’s interesting. So I guess we would have to “detect” NICs first and then generate /etc/network/interfaces from that. Just a quick scatch of a script that might be helpful with that:
[CODE]for iface in $(ls -1 /sys/class/net | tr -d ‘@’)
do
all interface need to be up or you will get an invalid
argument error when checking the link state
ifconfig $iface up
linkstate=$(cat /sys/class/net/$iface/carrier)
if [[ “x$linkstate” = “x1” ]]
then
if [[ “x$iface” = “xlo” ]]
then
echo “auto lo”
echo “iface lo inet loopback”
else
echo “auto $iface”
echo “iface $iface inet dhcp”
echo “udhcpc_opts -t 100 -T 20”
fi
fi
done[/CODE]