blob: 08fd177547202361d1a9377ecf03f2d5e8bec41a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#!/bin/sh
. /lib/functions/tunneldigger.sh
TUNNEL_ID="$1"
INTERFACE="$3"
MTU="$4"
# Get the bridge interface name for this MTU.
tunneldigger_get_bridge bridge "${MTU}"
if [ -z "$bridge" ]; then
echo "Unable to determine which bridge to use for MTU ${MTU}."
exit 1
fi
# Get the isolation option for this bridge
tunneldigger_get_bridge_isolate isolate "${MTU}"
# Disable IPv6 on this interface as it will be bridged.
echo 1 > /proc/sys/net/ipv6/conf/${INTERFACE}/disable_ipv6
# Add the interface to the proper bridge and bring it up.
ip link set dev ${INTERFACE} master ${bridge} mtu ${MTU} up
# Isolate the bridge port, if so configured
echo $isolate > /sys/class/net/${INTERFACE}/brport/isolated
# Ensure bridge MTU.
ip link set dev ${bridge} mtu ${MTU}
|