X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/57fb6fcbfd11c7be1ccc0bc4c02a459f2a45967e..91fba1d1813242d7e2ae73f0cee04b65956ab5d8:/tools/kvm-ifup.in diff --git a/tools/kvm-ifup.in b/tools/kvm-ifup.in index e506d73..5a53cee 100644 --- a/tools/kvm-ifup.in +++ b/tools/kvm-ifup.in @@ -18,65 +18,14 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. -@SHELL_ENV_INIT@ - -if [ -z "$INTERFACE" ]; then - echo "No network interface specified" - exit 1 -fi - -if [ -z "$MODE" ]; then - echo "MODE not specified" - exit 1 -fi +source @PKGLIBDIR@/net-common # Execute the user-supplied network script, if applicable if [ -x "$CONF_DIR/kvm-vif-bridge" ]; then exec $CONF_DIR/kvm-vif-bridge fi -if [ "$MODE" = "bridged" ]; then - # Fix the autogenerated MAC to have the first octet set to "fe" - # to discourage the bridge from using the TAP dev's MAC - FIXED_MAC=$(ip link show $INTERFACE | \ - awk '{if ($1 == "link/ether") printf("fe%s",substr($2,3,15))}') - ip link set $INTERFACE address $FIXED_MAC - - ip link set $INTERFACE up - ip link set $INTERFACE mtu $( /proc/sys/net/ipv4/conf/$INTERFACE/proxy_arp - echo 1 > /proc/sys/net/ipv4/conf/$INTERFACE/forwarding - fi - - if [ -d "/proc/sys/net/ipv6/conf/$INTERFACE" ]; then - echo 1 > /proc/sys/net/ipv6/conf/$INTERFACE/proxy_ndp - echo 1 > /proc/sys/net/ipv6/conf/$INTERFACE/forwarding - fi -fi +check +setup_bridge +setup_ovs +setup_route