diff --git a/hypervisor.sh b/hypervisor.sh new file mode 100755 index 0000000..f087655 --- /dev/null +++ b/hypervisor.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +. "$(dirname -- "$0")/netdev.sh" + +# Physical +new_if_phys "phys0" +new_if_phys "phys1" +new_if_phys "phys2" +new_if_phys "phys3" +new_if_phys "phys4" +new_if_phys "phys5" + +# Bridges +IFACE="br-v6" +new_if_bridge "$IFACE" + bridge_property 'stp_state' "$IFACE" + bridge_property 'mcast_router' "$IFACE" + bridge_property 'mcast_snooping' "$IFACE" '0' '' # TODO: Remove such entries when bridges play well with multicasting + bridge_property 'mcast_querier' "$IFACE" + bridge_property 'mcast_mld_version' "$IFACE" '2' '' + +IFACE="br0" +new_if_bridge "$IFACE" + bridge_property 'stp_state' "$IFACE" + bridge_property 'mcast_router' "$IFACE" + bridge_property 'mcast_snooping' "$IFACE" '0' '' # TODO: Remove such entries when bridges play well with multicasting + bridge_property 'mcast_querier' "$IFACE" + bridge_property 'mcast_mld_version' "$IFACE" '2' '' + +# Wireguard +IFACE="wg-tunnel" +new_if_wg "$IFACE" + addr_static_if "$IFACE" "172.22.12.5/32" + addr_static_if "$IFACE" "fd42:42:42::2:5/128" diff --git a/netdev.sh b/netdev.sh index 4a21036..72fa1c9 100755 --- a/netdev.sh +++ b/netdev.sh @@ -2,7 +2,7 @@ # # Generate s6 network definitions -# set -x +set -x header_eb() { echo '#!/bin/execlineb -P' @@ -46,7 +46,7 @@ addrfam() { # Use ipv6 if cannot autodetect of if no semicolons are present local addr="$1" local fam='6' - if which grep >/dev/null 2>&1 && echo "$addr" | grep -v ':'; then + if which grep >/dev/null 2>&1 && echo "$addr" | grep -v ':' >/dev/null 2>&1; then local fam='4' fi echo "$fam" @@ -278,14 +278,13 @@ wgconf() { header_path header_if "$if" cat <