charlie2alpha

QOS script

Dec 24th, 2014
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # TOS rules
  4.  
  5. # Torrents from server, lowest priority
  6. iptables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j RETURN
  7. iptables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j CONNMARK --set-return 0x5/0x7
  8. iptables -t mangle -I QOSO 3 -p udp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j RETURN
  9. iptables -t mangle -I QOSO 3 -p udp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j CONNMARK --set-return 0x5/0x7
  10. ip6tables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j RETURN
  11. ip6tables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j CONNMARK --set-return 0x5/0x7
  12. ip6tables -t mangle -I QOSO 3 -p udp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j RETURN
  13. ip6tables -t mangle -I QOSO 3 -p udp -m mac --mac-source <mac_address> -m multiport --sports 51701:52397,63707 -j CONNMARK --set-return 0x5/0x7
  14.  
  15.  
  16. # Remote SSH from server
  17. iptables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> --sport 22 -j RETURN
  18. iptables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> --sport 22 -j CONNMARK --set-return 0x1/0x7
  19. ip6tables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> --sport 22 -j RETURN
  20. ip6tables -t mangle -I QOSO 3 -p tcp -m mac --mac-source <mac_address> --sport 22 -j CONNMARK --set-return 0x1/0x7
  21.  
  22. # ICMP
  23. iptables -t mangle -I QOSO 3 -p icmp --icmp-type 8 -j RETURN
  24. iptables -t mangle -I QOSO 3 -p icmp --icmp-type 8 -j CONNMARK --set-return 0x1/0x7
  25. iptables -t mangle -I QOSO 3 -p icmp --icmp-type 0 -j RETURN
  26. iptables -t mangle -I QOSO 3 -p icmp --icmp-type 0 -j CONNMARK --set-return 0x1/0x7
  27. ip6tables -t mangle -I QOSO 3 -p icmpv6 --icmpv6-type 128 -j RETURN
  28. ip6tables -t mangle -I QOSO 3 -p icmpv6 --icmpv6-type 128 -j CONNMARK --set-return 0x1/0x7
  29. ip6tables -t mangle -I QOSO 3 -p icmpv6 --icmpv6-type 129 -j RETURN
  30. ip6tables -t mangle -I QOSO 3 -p icmpv6 --icmpv6-type 129 -j CONNMARK --set-return 0x1/0x7
  31.  
  32. exec /jffs/scripts/tshape.sh
Advertisement
Add Comment
Please, Sign In to add comment