Revision be3f52f3 tools/kvm-ifup.in
b/tools/kvm-ifup.in | ||
---|---|---|
33 | 33 |
exec @SYSCONFDIR@/ganeti/kvm-vif-bridge |
34 | 34 |
fi |
35 | 35 |
|
36 |
ip link set $INTERFACE up |
|
37 |
|
|
38 | 36 |
if [ "$MODE" = "bridged" ]; then |
37 |
# Fix the autogenerated MAC to have the first octet set to "fe" |
|
38 |
# to discourage the bridge from using the TAP dev's MAC |
|
39 |
FIXED_MAC=$(ip link show $INTERFACE | awk '{if ($1 == "link/ether") printf("fe%s",substr($2,3,15))}') |
|
40 |
ip link set $INTERFACE address $FIXED_MAC |
|
41 |
|
|
42 |
ip link set $INTERFACE up |
|
39 | 43 |
ip link set $INTERFACE mtu $(</sys/class/net/${BRIDGE}/mtu) |
40 | 44 |
|
41 | 45 |
# Connect the interface to the bridge |
42 | 46 |
brctl addif $BRIDGE $INTERFACE |
43 | 47 |
else |
48 |
ip link set $INTERFACE up |
|
49 |
|
|
44 | 50 |
if [ -z "$IP" ]; then |
45 | 51 |
echo "Routed NIC but no IP address specified" |
46 | 52 |
exit 1 |
Also available in: Unified diff