* dhclient: ignore libvirt's network interfaces.
svn path=/nixos/trunk/; revision=26327
This commit is contained in:
parent
3cb7a54dba
commit
f71bd3f93c
|
@ -82,10 +82,11 @@ in
|
||||||
# Only run dhclient on interfaces of type ARPHRD_ETHER
|
# Only run dhclient on interfaces of type ARPHRD_ETHER
|
||||||
# (1), i.e. Ethernet. Ignore peth* devices; on Xen,
|
# (1), i.e. Ethernet. Ignore peth* devices; on Xen,
|
||||||
# they're renamed physical Ethernet cards used for
|
# they're renamed physical Ethernet cards used for
|
||||||
# bridging. Likewise for vif* and tap*.
|
# bridging. Likewise for vif* and tap* (Xen) and
|
||||||
|
# virbr* and vnet* (libvirt).
|
||||||
if [ "$(cat /sys/class/net/$i/type)" = 1 ]; then
|
if [ "$(cat /sys/class/net/$i/type)" = 1 ]; then
|
||||||
if ! for j in ${toString ignoredInterfaces}; do echo $j; done | grep -F -x -q "$i" &&
|
if ! for j in ${toString ignoredInterfaces}; do echo $j; done | grep -F -x -q "$i" &&
|
||||||
! echo "$i" | grep -x -q "peth.*\|vif.*\|tap.*";
|
! echo "$i" | grep -x -q "peth.*\|vif.*\|tap.*\|virbr.*\|vnet.*";
|
||||||
then
|
then
|
||||||
echo "Running dhclient on $i"
|
echo "Running dhclient on $i"
|
||||||
interfaces="$interfaces $i"
|
interfaces="$interfaces $i"
|
||||||
|
|
Loading…
Reference in New Issue