Commit d522d098 authored by nanahira's avatar nanahira

change mtu also for bridge

parent 9b8678fb
......@@ -64,11 +64,11 @@ _change_mtu() {
INTERFACE=$2
INTERFACE_MTU=$(ip link show dev "$INTERFACE" | grep -oP 'mtu \d+' | cut -c 5-)
INTERFACE_MTU_4=$((INTERFACE_MTU - 40))
INTERFACE_MTU_6=$((INTERFACE_MTU - 60))
INTERFACE_MSS_4=$((INTERFACE_MTU - 40))
INTERFACE_MSS_6=$((INTERFACE_MTU - 60))
iptables -w -t mangle "$OPTION" FORWARD -o "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MTU_4:1460 -j TCPMSS --set-mss $INTERFACE_MTU_4
iptables -w -t mangle "$OPTION" FORWARD -i "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MTU_4:1460 -j TCPMSS --set-mss $INTERFACE_MTU_4
ip6tables -w -t mangle "$OPTION" FORWARD -o "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MTU_6:1460 -j TCPMSS --set-mss $INTERFACE_MTU_6
ip6tables -w -t mangle "$OPTION" FORWARD -i "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MTU_6:1460 -j TCPMSS --set-mss $INTERFACE_MTU_6
iptables -w -t mangle "$OPTION" FORWARD -o "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MSS_4:1460 -j TCPMSS --set-mss $INTERFACE_MSS_4
iptables -w -t mangle "$OPTION" FORWARD -i "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MSS_4:1460 -j TCPMSS --set-mss $INTERFACE_MSS_4
ip6tables -w -t mangle "$OPTION" FORWARD -o "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MSS_6:1460 -j TCPMSS --set-mss $INTERFACE_MSS_6
ip6tables -w -t mangle "$OPTION" FORWARD -i "$INTERFACE" -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss $INTERFACE_MSS_6:1460 -j TCPMSS --set-mss $INTERFACE_MSS_6
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment