Merge property setting to one function and a bit of bugsquashes, add mcast routing
This commit is contained in:
parent
f8856c5b33
commit
6859984225
38
netdev.sh
38
netdev.sh
|
@ -157,27 +157,37 @@ new_if_bridge() {
|
||||||
new_link "$if"
|
new_link "$if"
|
||||||
}
|
}
|
||||||
|
|
||||||
bridge_stp() {
|
bridge_property() {
|
||||||
local if="${1:?missing if}"
|
local prop="${1:?missing prop}"
|
||||||
local state="${2:-1}"
|
local if="${2:?missing if}"
|
||||||
|
local state="${3:-1}"
|
||||||
|
local downstate="${4-0}"
|
||||||
|
|
||||||
local sname="interface.$if.stp"
|
local sname="interface.$if.$prop"
|
||||||
ifbundle "$if" "$sname"
|
ifbundle "$if" "$sname"
|
||||||
|
|
||||||
install -Dm644 <(
|
install -Dm644 <(
|
||||||
h_if "$if"
|
header_eb
|
||||||
|
header_if "$if"
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
define PROP $prop
|
||||||
define STATE $state
|
define STATE $state
|
||||||
EOF
|
EOF
|
||||||
echo 'ip link set $INTERFACE type bridge stp_state $STATE'
|
header_path
|
||||||
|
echo 'ip link set $INTERFACE type bridge $PROP $STATE'
|
||||||
) rc/"$sname"/up
|
) rc/"$sname"/up
|
||||||
install -Dm644 <(
|
[ -z "$downstate" ] || install -Dm644 <(
|
||||||
h_if "$if"
|
header_eb
|
||||||
echo 'ip link set $INTERFACE type bridge stp_state 0'
|
header_if "$if"
|
||||||
|
cat <<EOF
|
||||||
|
define PROP $prop
|
||||||
|
define STATE $downstate
|
||||||
|
EOF
|
||||||
|
echo 'ip link set $INTERFACE type bridge $PROP $STATE'
|
||||||
) rc/"$sname"/down
|
) rc/"$sname"/down
|
||||||
install -Dm644 <(echo oneshot) rc/"$sname"/type
|
install -Dm644 <(echo oneshot) rc/"$sname"/type
|
||||||
install -Dm644 /dev/null rc/"$sname"/dependencies.d/module.stp
|
|
||||||
install -Dm644 /dev/null rc/"$sname"/dependencies.d/interface."$if".create
|
install -Dm644 /dev/null rc/"$sname"/dependencies.d/interface."$if".create
|
||||||
|
[ "$prop" == 'stp_state' ] && install -Dm644 /dev/null rc/"$sname"/dependencies.d/module.stp
|
||||||
}
|
}
|
||||||
|
|
||||||
if_lladdress() {
|
if_lladdress() {
|
||||||
|
@ -330,13 +340,17 @@ route_v6_vrf_default_if() {
|
||||||
ifbundle "$vrf" "$sname"
|
ifbundle "$vrf" "$sname"
|
||||||
|
|
||||||
install -Dm644 <(
|
install -Dm644 <(
|
||||||
|
header_eb
|
||||||
header_vrf "$vrf"
|
header_vrf "$vrf"
|
||||||
h_if "$if"
|
header_if "$if"
|
||||||
|
header_path
|
||||||
echo 'ip -6 route add default dev $INTERFACE vrf $VRF'
|
echo 'ip -6 route add default dev $INTERFACE vrf $VRF'
|
||||||
) rc/"$sname"/up
|
) rc/"$sname"/up
|
||||||
install -Dm644 <(
|
install -Dm644 <(
|
||||||
|
header_eb
|
||||||
header_vrf "$vrf"
|
header_vrf "$vrf"
|
||||||
h_if "$if"
|
header_if "$if"
|
||||||
|
header_path
|
||||||
echo 'ip -6 route del default dev $INTERFACE vrf $VRF'
|
echo 'ip -6 route del default dev $INTERFACE vrf $VRF'
|
||||||
) rc/"$sname"/down
|
) rc/"$sname"/down
|
||||||
install -Dm644 <(echo oneshot) rc/"$sname"/type
|
install -Dm644 <(echo oneshot) rc/"$sname"/type
|
||||||
|
|
22
router.sh
22
router.sh
|
@ -20,6 +20,7 @@ new_if_phys "vnet5"
|
||||||
|
|
||||||
# Bridges
|
# Bridges
|
||||||
new_if_bridge "home"
|
new_if_bridge "home"
|
||||||
|
bridge_property 'stp_state' "home"
|
||||||
new_forward "home"
|
new_forward "home"
|
||||||
new_if_slave "home" "vnet1"
|
new_if_slave "home" "vnet1"
|
||||||
new_if_slave "home" "phys3"
|
new_if_slave "home" "phys3"
|
||||||
|
@ -29,13 +30,23 @@ new_if_bridge "br-dn42"
|
||||||
new_if_slave "br-dn42" "phys2-42"
|
new_if_slave "br-dn42" "phys2-42"
|
||||||
|
|
||||||
new_if_bridge "f33d"
|
new_if_bridge "f33d"
|
||||||
bridge_stp "f33d"
|
bridge_property 'stp_state' "f33d"
|
||||||
|
bridge_property 'mcast_snooping' "f33d"
|
||||||
|
bridge_property 'mcast_querier' "f33d"
|
||||||
|
bridge_property 'mcast_router' "f33d"
|
||||||
|
bridge_property 'mcast_stats_enabled' "f33d"
|
||||||
|
bridge_property 'mcast_mld_version' "f33d" '2' ''
|
||||||
if_lladdress "f33d" '02:00:00:00:f3:3d'
|
if_lladdress "f33d" '02:00:00:00:f3:3d'
|
||||||
addr_v6_static_if "f33d" "2a04:5b81:2060:f33d::1/64"
|
addr_v6_static_if "f33d" "2a04:5b81:2060:f33d::1/64"
|
||||||
new_if_slave "f33d" "vnet2"
|
new_if_slave "f33d" "vnet2"
|
||||||
|
|
||||||
new_if_bridge "b00b"
|
new_if_bridge "b00b"
|
||||||
bridge_stp "b00b"
|
bridge_property 'stp_state' "b00b"
|
||||||
|
bridge_property 'mcast_snooping' "b00b"
|
||||||
|
bridge_property 'mcast_querier' "b00b"
|
||||||
|
bridge_property 'mcast_router' "b00b"
|
||||||
|
bridge_property 'mcast_stats_enabled' "d00d"
|
||||||
|
bridge_property 'mcast_mld_version' "b00b" '2' ''
|
||||||
if_lladdress "b00b" '02:00:00:00:b0:0b'
|
if_lladdress "b00b" '02:00:00:00:b0:0b'
|
||||||
addr_v6_static_if "b00b" "2a04:5b81:2060:b00b::1/64"
|
addr_v6_static_if "b00b" "2a04:5b81:2060:b00b::1/64"
|
||||||
new_if_slave "b00b" "vnet0"
|
new_if_slave "b00b" "vnet0"
|
||||||
|
@ -43,7 +54,12 @@ new_if_bridge "b00b"
|
||||||
new_if_slave "b00b" "phys2-66"
|
new_if_slave "b00b" "phys2-66"
|
||||||
|
|
||||||
new_if_bridge "d00d"
|
new_if_bridge "d00d"
|
||||||
bridge_stp "d00d"
|
bridge_property 'stp_state' "d00d"
|
||||||
|
bridge_property 'mcast_snooping' "d00d"
|
||||||
|
bridge_property 'mcast_querier' "d00d"
|
||||||
|
bridge_property 'mcast_router' "d00d"
|
||||||
|
bridge_property 'mcast_stats_enabled' "d00d"
|
||||||
|
bridge_property 'mcast_mld_version' "d00d" '2' ''
|
||||||
if_lladdress "d00d" '02:00:00:00:d0:0d'
|
if_lladdress "d00d" '02:00:00:00:d0:0d'
|
||||||
addr_v6_static_if "d00d" "2a04:5b81:2060:d00d::1/64"
|
addr_v6_static_if "d00d" "2a04:5b81:2060:d00d::1/64"
|
||||||
new_if_slave "d00d" "vnet3"
|
new_if_slave "d00d" "vnet3"
|
||||||
|
|
Loading…
Reference in New Issue