diff options
author | Jouke Witteveen <j.witteveen@gmail.com> | 2013-07-24 10:57:48 +0200 |
---|---|---|
committer | Jouke Witteveen <j.witteveen@gmail.com> | 2013-07-24 11:39:21 +0200 |
commit | 20c66d6499f22adad6c1dae854a627f061c5fbcb (patch) | |
tree | 5c21c28ce2f17814559188c2ba49ef4bf73dfd2a /src/lib/connections/bridge | |
parent | cbd00d5652700792a7833617d947f8a78bb34ccc (diff) | |
download | netctl-20c66d6499f22adad6c1dae854a627f061c5fbcb.tar.gz netctl-20c66d6499f22adad6c1dae854a627f061c5fbcb.tar.xz |
Use iproute2 for bridging (FS#36165)
This sheds the dependency on the old bridge-utils (brctl).
Diffstat (limited to 'src/lib/connections/bridge')
-rw-r--r-- | src/lib/connections/bridge | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/lib/connections/bridge b/src/lib/connections/bridge index 94a9b64..3b0a94b 100644 --- a/src/lib/connections/bridge +++ b/src/lib/connections/bridge @@ -2,7 +2,6 @@ . "$SUBR_DIR/ip" -: ${BRCTL:=brctl} declare -ag BindsToInterfaces bridge_up() { @@ -12,17 +11,17 @@ bridge_up() { return 1 fi else - $BRCTL addbr "$Interface" + ip link add name "$Interface" type bridge fi for member in "${BindsToInterfaces[@]}"; do - ip link set "$member" promisc on up - ip addr flush dev "$member" - $BRCTL addif "$Interface" "$member" + ip link set dev "$member" promisc on up + ip addr flush dev "$member" scope host &>/dev/null + ip addr flush dev "$member" scope site &>/dev/null + ip addr flush dev "$member" scope global &>/dev/null + ip link set dev "member" master "$Interface" + is_yes "${SkipForwardingDelay:-no}" && bridge link set dev "$member" state 3 done - # Set options - [[ "$FwdDelay" ]] && $BRCTL setfd "$Interface" "$FwdDelay" - [[ "$MaxAge" ]] && $BRCTL setmaxage "$Interface" "$MaxAge" bring_interface_up "$Interface" ip_set @@ -31,12 +30,12 @@ bridge_up() { bridge_down() { for member in "${BindsToInterfaces[@]}"; do ip link set "$member" promisc off down - $BRCTL delif "$Interface" "$member" + ip link set dev "$member" nomaster done ip_unset bring_interface_down "$Interface" - $BRCTL delbr "$Interface" + ip link delete "$Interface" type bridge } |