Re: Bug/solved: Problem with multiple NICs with FAI

2018-03-15 Diskussionsfäden Christian Meyer
Am Mittwoch, den 14.03.2018, 12:17 +0100 schrieb Thomas Lange:
> > > > > > On Wed, 21 Feb 2018 22:06:45 +0100, Christian Meyer  > > > > > @web.de> said:
> 
> > 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)
> Which FAI version are you using? I've added head -1 to all
> definitions of NIC1 in this commit
> https://github.com/faiproject/fai/commit/3e434d0f9ecb7b9e3123058415e8
> d88cd6892b1d
> 
> So FAI 5.5 and later should include this fix.

I'm using FAI 5.3.6 from Debian stable. So it's an older version. (I
wrote it in my first mail, sorry for not placing it more visible.)

Thanks for fixing the issue (4 months ago).
In the meantime I will ignore the error till the fixed version arrives
in stable.

Christian


Re: Bug/solved: Problem with multiple NICs with FAI

2018-03-14 Diskussionsfäden Thomas Lange
> On Wed, 21 Feb 2018 22:06:45 +0100, Christian Meyer  said:

> 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)
Which FAI version are you using? I've added head -1 to all definitions
of NIC1 in this commit
https://github.com/faiproject/fai/commit/3e434d0f9ecb7b9e3123058415e8d88cd6892b1d

So FAI 5.5 and later should include this fix.
-- 
regards Thomas


Bug/solved: Problem with multiple NICs with FAI

2018-02-21 Diskussionsfäden Christian Meyer
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


Problem with multiple NICs with FAI

2018-02-04 Diskussionsfäden Christian Meyer
Hello there,

I'm trying to set up FAI-clients with more than only one NIC with
systemd-networkd instead of ifup.
Some clients use both WLAN (e.g. wlp3s0) and LAN (e.g. enp4s0) in the
same subnet, a different (proxy-)machine is a virtual box (XEN) with
eth0 and eth1 in different networks.

However, I don't know wheather this is a FAI bug or a config problem. I
see the following output during testing softupdates:
...
Setting SERVER=fai-server. Value extracted from FAI_CONFIG_SRC.
/usr/lib/fai/subroutines: Zeile 822: /sys/class/net/$NIC1/address:
Mehrdeutige Umlenkung.
Monitoring to server fai-server enabled.
...

The problem is clear: NIC1 are two NIC's: variables.log says:
NIC1=$'enp4s0\nwlp3s0'

Possibly this happens AFTER switching a machine to systemd-networkd, so
managing one NIC works fine, but it could be a routing problem.
According to /usr/lib/fai/subroutines it seems that there is no default
route and that "NIC1" is "everything" that is a network device:

   # determine the name of the default network interface
# try several times if dhclient needs some more time
local i=0
NIC1=$(ip route | awk '/^default/ {print $5}')
while [ ! "$NIC1" -a $i -lt 8 ]; do
sleep 2
NIC1=$(ip route | awk '/^default/ {print $5}')
(( i += 1 ))
done
if [ -z "$NIC1" ]; then
NIC1=$(ip route | awk '/ dev / {print $3}')
fi
export NIC1

On the other hand it seems that FAI doesn't really know how to deal
with more than one NIC and I can't find anything about other NIC's.
FYI: I'm using Debian stable with FAI 5.3.6 and a very own configspace.

Is there a way to proper deal with multiple network cards in FAI or is
my routing just broken? In this cases, can anyone please give me a hint
how to configure multiple NICs / networks with systemd-networkd and
systemd-resolved?

Thanks a lot,
Christian