Bug/solved: Problem with multiple NICs with FAI

Christian Meyer c2h5oh at web.de
Wed Feb 21 22:06:45 CET 2018


Hello Thomas and others,

in the meantime I'm rather sure, that this is a bug. Please think about
it.

task_confdir fails in "line 822: /sys/class/net/$NIC1/address", when
there is more that one NIC and routing gives more than one default
route (using metric, e.g. for WLAN)

#ip route
default via 172.16.0.1 dev ens5 
default via 172.16.0.1 dev wlp3s0 proto dhcp src 172.16.1.12 metric
1024 
172.16.0.0/16 dev wlp3s0 proto kernel scope link src 172.16.1.12 
172.16.0.0/16 dev ens5 proto kernel scope link src 172.16.0.178 
172.16.0.1 dev wlp3s0 proto dhcp scope link src 172.16.1.12 metric
1024 

Since I heavily modified standard classes, I don't know if variable
$NIC1 is used any more. I do so to configure my
/etc/network/interfaces.

For me this change solves the issue:
> NIC1=$(ip route | awk '/^default/ {print $5}')
< NIC1=$(ip route | awk '/^default.*dev en|^default.*dev eth/ {print
$5}' | head -1)

To allow NIC1 to be wlan as well, one will want
< NIC1=$(ip route | awk '/^default/ {print $5}' | head -1)
Or if it's really important have a look at the metric.

So thanks a lot,
Christian Meyer


More information about the linux-fai mailing list