Add gateway IP+MAC, not VM’s own

This commit is contained in:
Demi Marie Obenour 2020-11-10 22:09:54 -05:00
parent aa71677cbd
commit 0a322958e4
No known key found for this signature in database
GPG Key ID: 28A45C93B0B5B6E0

View File

@ -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"