From 0a322958e4cc399cfa15382aa6aa5b713dbb3cb9 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Tue, 10 Nov 2020 22:09:54 -0500 Subject: [PATCH] =?UTF-8?q?Add=20gateway=20IP+MAC,=20not=20VM=E2=80=99s=20?= =?UTF-8?q?own?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- network/setup-ip | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/network/setup-ip b/network/setup-ip index b8900d0..b050d63 100755 --- a/network/setup-ip +++ b/network/setup-ip @@ -23,21 +23,22 @@ configure_network() { local gateway6="$8" local primary_dns="$9" local secondary_dns="${10}" + local netvm_mac=fe:ff:ff:ff:ff:ff /sbin/ifconfig "$INTERFACE" "$ip" netmask "$netmask" - /sbin/ip -- neighbour replace to "$ip" dev "$INTERFACE" \ - lladdr "$MAC" nud permanent + /sbin/ip -- neighbour replace to "$gateway" dev "$INTERFACE" \ + lladdr "$netvm_mac" nud permanent if [ -n "$ip6" ]; then /sbin/ifconfig "$INTERFACE" add "$ip6/$netmask6" - /sbin/ip -- neighbour replace to "$ip6" dev "$INTERFACE" \ - lladdr "$MAC" nud permanent + /sbin/ip -- neighbour replace to "$gateway6" dev "$INTERFACE" \ + lladdr "$netvm_mac" nud permanent fi /sbin/ifconfig "$INTERFACE" up if [ -n "$gateway" ]; then - /sbin/route add -host "$gateway" dev "$INTERFACE" + add_host_route "$gateway" "$INTERFACE" if [ -n "$gateway6" ] && ! echo "$gateway6" | grep -q "^fe80:"; then - add_route "$gateway6/$netmask6" "$INTERFACE" + add_host_route "$gateway6/$netmask6" "$INTERFACE" fi if ! qsvc disable-default-route ; then add_default_route "$gateway" "$INTERFACE"