From: Justin Wind Date: Sun, 1 Oct 2017 19:20:28 +0000 (-0700) Subject: add ipv6 to shaper.sh X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=57db2162f7b9db5619f946fa5ffac84ab9b0ac03;p=firewall-squeep add ipv6 to shaper.sh --- 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