Email: pacolinux arroba inicia punto es
Web: http://aldarias.es/pacodebian
Con Linux Debian. En Valencia (España)
Este documento es de libre reproducción siempre que se cite su fuente.
Realizado con: LATEX
El control se realiza sobre el tráfico saliente. Vamos a dar prioridades del 20 al 26. El 20 es la máxima prioridad y la 26 es la menor prioridad.
Puertos | Prioridad | Comentario |
0:1024 | 23 | Default for low port traffic |
20 | 26 | ftp-data port, low prio |
5190 | 23 | aol instant messenger |
icmp | 20 | ICMP (ping) - high prio, impress friends |
udp | 21 | DNS name resolution (small packets) |
ssh | 22 | secure shell |
http | 25 | Local web server |
64 | 21 | small packets (probably just ACKs) |
3389 | 23 | windows remote computer connection |
6346 | 26 | Default for low port traffic |
Localizado en:
http://www.sonicspike.net/software/
Descomprimierlo:
tar xzpf dsl_qos_queue-0.7.tar.gz
Una vez descomprimido copiamos esto:
cp dsl_qos_queue/dsl_qos_queue /usr/bin/
Comprobar que la tarjeta de red q sale a internet es eth1, sino cambiarla por eth0 si fuera esta.
cat /etc/init.d/dslqos
#!/bin/bash # add MYSHAPER-OUT chain to the mangle table in iptables - this sets up the table we'll use # to filter and mark packets. DEV=eth1 CMD="/usr/local/bin/dsl_qos_queue -d -i $DEV -r 15900" function cleanup(){ # Reset everything to a known state (cleared) echo iptables -t mangle -D POSTROUTING -o $DEV -j MYSHAPER-OUT iptables -t mangle -D POSTROUTING -o $DEV -j MYSHAPER-OUT 2> /dev/null > /dev/null echo iptables -t mangle -F MYSHAPER-OUT iptables -t mangle -F MYSHAPER-OUT 2> /dev/null > /dev/null echo iptables -t mangle -X MYSHAPER-OUT iptables -t mangle -X MYSHAPER-OUT 2> /dev/null > /dev/null } function install(){ echo iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT echo iptables -t mangle -I POSTROUTING -o $DEV -j MYSHAPER-OUT echo -n "Set priorities..." # add fwmark entries to classify different types of traffic - Set fwmark from 20-26 according to # desired class. 20 is highest prio. iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 0:1024 -j MARK --set-mark 23 # Default for low port traffic iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 0:1024 -j MARK --set-mark 23 # "" iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 20 -j MARK --set-mark 26 # ftp-data port, low prio iptables -t mangle -A MYSHAPER-OUT -p tcp --dport 5190 -j MARK --set-mark 23 # aol instant messenger iptables -t mangle -A MYSHAPER-OUT -p icmp -j MARK --set-mark 20 # ICMP (ping) - high prio, impress friends iptables -t mangle -A MYSHAPER-OUT -p udp -j MARK --set-mark 21 # DNS name resolution (small packets) iptables -t mangle -A MYSHAPER-OUT -p tcp --dport ssh -j MARK --set-mark 22 # secure shell iptables -t mangle -A MYSHAPER-OUT -p tcp --sport ssh -j MARK --set-mark 22 # secure shell #iptables -t mangle -A MYSHAPER-OUT -p tcp --dport telnet -j MARK --set-mark 22 # telnet (ew...) #iptables -t mangle -A MYSHAPER-OUT -p tcp --sport telnet -j MARK --set-mark 22 # telnet (ew...) #iptables -t mangle -A MYSHAPER-OUT -p ipv6-crypt -j MARK --set-mark 24 # IPSec - we dont know what the payload is though... iptables -t mangle -A MYSHAPER-OUT -p tcp --sport http -j MARK --set-mark 25 # Local web server iptables -t mangle -A MYSHAPER-OUT -p tcp -m length --length :64 -j MARK --set-mark 21 # small packets (probably just ACKs) iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 3389 -j MARK --set-mark 23 # windows remote computer connection iptables -t mangle -A MYSHAPER-OUT -m mark --mark 0 -j MARK --set-mark 26 # redundant- mark any unmarked packets as 26 (low pri iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 6346 -j MARK --set-mark 26 # Default for low port traffic echo " done." } case "$1" in start) $CMD cleanup install ;; stop|stop) killall dsl_qos_queue cleanup ;; status) iptables -t mangle -L cat /proc/net/ip_queue ;; restart) killall dsl_qos_queue sleep 1 $CMD cleanup install ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0
This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.70)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html dslqosqueue -split 0 -local_icons 1 -show_section_numbers -no_auto_link -no_navigation
The translation was initiated by on 2004-10-10