From 57db2162f7b9db5619f946fa5ffac84ab9b0ac03 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Sun, 1 Oct 2017 12:20:28 -0700 Subject: [PATCH] add ipv6 to shaper.sh --- shaper.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/shaper.sh b/shaper.sh index 8fdc296..5b55d3f 100755 --- a/shaper.sh +++ b/shaper.sh @@ -52,15 +52,24 @@ function shape(){ then $IPTABLES -t mangle -A "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio} fi + if ! $IP6TABLES -t mangle -C "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio} >/dev/null 2>&1 + then + $IP6TABLES -t mangle -A "${SHAPE_CHAIN}" "$@" -j MARK --set-mark ${prio} + fi } shape_if "${EXT_IF}" "${UPLINK}" "${BURST}" if ! $IPTABLES -t mangle -L "${SHAPE_CHAIN}" >/dev/null 2>&1 then - echo "initializing chain '${SHAPE_CHAIN}'" + echo "initializing ipv4 chain '${SHAPE_CHAIN}'" $IPTABLES -t mangle -N "${SHAPE_CHAIN}" fi +if ! $IP6TABLES -t mangle -L "${SHAPE_CHAIN}" >/dev/null 2>&1 +then + echo "initializing ipv6 chain '${SHAPE_CHAIN}'" + $iP6TABLES -t mangle -N "${SHAPE_CHAIN}" +fi # prioritize small and responsive things shape 1 -p icmp @@ -92,3 +101,12 @@ then $IPTABLES -t mangle -I POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}" fi +if ! $IP6TABLES -t mangle -C POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}" >/dev/null 2>&1 +then + $IP6TABLES -t mangle -I POSTROUTING -o "${EXT_IF}" -j "${SHAPE_CHAIN}" +fi + +if [[ ! -e /etc/local.d/shaper.start ]] +then + echo "add shaper to local rc start!" +fi -- 2.45.2