* dhclient: ignore libvirt's network interfaces.

svn path=/nixos/trunk/; revision=26327
This commit is contained in:
Eelco Dolstra 2011-03-15 15:30:12 +00:00
parent 3cb7a54dba
commit f71bd3f93c
1 changed files with 3 additions and 2 deletions

View File

@ -82,10 +82,11 @@ in
# Only run dhclient on interfaces of type ARPHRD_ETHER
# (1), i.e. Ethernet. Ignore peth* devices; on Xen,
# 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 ! 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
echo "Running dhclient on $i"
interfaces="$interfaces $i"