From: Wolfgang Bumiller Date: Wed, 15 Mar 2017 10:20:39 +0000 (+0100) Subject: kvm-ifup: use iproute2 X-Git-Url: https://git.proxmox.com/?p=pve-qemu-kvm.git;a=commitdiff_plain;h=b94f51a6ab0e90699a7c8cfae17676debeffa631 kvm-ifup: use iproute2 --- diff --git a/debian/kvm-ifup b/debian/kvm-ifup index 29dae84..a4c63ea 100755 --- a/debian/kvm-ifup +++ b/debian/kvm-ifup @@ -1,5 +1,5 @@ #!/bin/sh -switch=$(/sbin/ip route list | awk '/^default / { print $NF }') -/sbin/ifconfig $1 0.0.0.0 promisc up -/sbin/brctl addif ${switch} $1 +switch=$(/sbin/ip route show |sed -nre 's/^default .* dev ([^ ]+).*$/\1/;T;p;q') +/sbin/ip link set "$1" up promisc on +test -d "/sys/class/net/$switch/bridge" && /sbin/ip link set "$1" master "$switch"