commit c6589d973064bf46d1655e06759e459c11047603 parent 4d2aa80662e3e68751389705f28c0178e1bdb45e Author: Martin Schanzenbach <schanzen@gnunet.org> Date: Sun, 4 Dec 2022 12:24:29 +0900 Replace deprecated brctl (https://lwn.net/Articles/703776/) Diffstat:
| M | netjail/netjail-init.sh | | | 10 | +++++++--- |
| M | netjail/netjail.sh | | | 3 | ++- |
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/netjail/netjail-init.sh b/netjail/netjail-init.sh @@ -17,13 +17,17 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" BRIDGE=builderbridge -brctl addbr $BRIDGE -brctl stp $BRIDGE off +# This is deprecated +# brctl addbr $BRIDGE +# brctl stp $BRIDGE off +ip link add dev $BRIDGE type bridge stp_state 0 + ip link set dev $BRIDGE up # Connect bridge to host network ip link add tap0 type veth peer name br-tap0 -brctl addif $BRIDGE br-tap0 +#brctl addif $BRIDGE br-tap0 +ip link set dev br-tap0 master $BRIDGE ip link set dev tap0 up ip link set dev br-tap0 up diff --git a/netjail/netjail.sh b/netjail/netjail.sh @@ -31,7 +31,8 @@ BRTAP=br-tap-$NSUID # Setup link to our bridge ip link add "$TAP" type veth peer name "$BRTAP" -brctl addif "$BRIDGE" "$BRTAP" +#brctl addif "$BRIDGE" "$BRTAP" +ip link set dev $BRTAP master $BRIDGE ip link set "$TAP" netns "$NSNAME" ip link set dev "$BRTAP" up