Erro ao fazer QOS [RESOLVIDO]

1. Erro ao fazer QOS [RESOLVIDO]

Thiago
thiago_th

(usa Red Hat)

Enviado em 26/05/2012 - 11:32h

Bom dia!

Tive a necessidade de fazer um cotrole de banda QOS, por porta de comunicação, pois estamos impantando voip na empresa. Fiz as seguintes configurações, colocando os comandos abaixo dentro do script do firewall:

---------------------------------------------------------------------------------------

#####CONTROLE DE PACOTES QOS
tc qdisc add dev eth0 root handle 1: htb default 30
tc class add dev eth0 parent 1: classid 1:1 htb rate 2048kbit ceil 2048kbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 200kbit ceil 240kbit prio 1
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1848kbit ceil 1848kbit prio 2

##MELHORAR A DISPUTA DE BANDA
tc qdisc add dev eth0 parent 1:10 handle 120: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 130: sfq perturb 10

###CORRELAÇO ENTRE OS VALORES DE PRIORIDADE
tc filter add dev eth0 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev eth0 parent 1:0 protocol ip prio 2 handle 2 fw classid 1:20


###DADOS APRA A VELOCIDADE DA REDE INTERNA
tc qdisc add dev eth1 root handle 1: htb default 30
tc class add dev eth1 parent 1: classid 1:1 htb rate 10000kbit ceil 10000kbit
tc class add dev eth1 parent 1:1 classid 1:10 htb rate 10000kbit ceil 10000kbit prio 1
tc class add dev eth1 parent 1:1 classid 1:20 htb rate 1848kbit ceil 1848kbit prio 2


###GARANTIA DA DISPUTA DE BANDA PARA ETH1
tc qdisc add dev eth1 parent 1:20 handle 120: sfq perturb 10
tc qdisc add dev eth1 parent 1:30 handle 130: sfq perturb 10


###CORRELAÇO ENTRE OS VALORES DA ETH1
tc filter add dev eth1 parent 1:0 protocol ip prio 1 handle 1 fw classid 1:10
tc filter add dev eth1 parent 1:0 protocol ip prio 2 handle 2 fw classid 1:20


###PACOTES DSCP
iptables -t mangle -A PREROUTING -p icmp -j DSCP --set-dscp 46
iptables -t mangle -A PREROUTING -p icmp -j MARK --set-mark 0x2
iptables -t mangle -A PREROUTING -p icmp -j RETURN

iptables -t mangle -A POSTROUTING -m dscp --dscp 46 -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -m dscp --dscp 46 -j RETURN
iptables -t mangle -A POSTROUTING -m dscp --dscp 34 -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -m dscp --dscp 34 -j RETURN

###

##VOIP
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 5060 -j DSCP --set-dscp 46
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 5060 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 5060 -j RETURN

iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5060 -j DSCP --set-dscp 46
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5060 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5060 -j RETURN

iptables -t mangle -A PRETOUTING -p tcp -m tcp --sport 5061 -j DSCP --set-dscp 46
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 5061 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp -m tcp --sport 5061 -j RETURN

iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5061 -j DSCP --set-dscp 46
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5061 -j MARK --set-mark 0x1
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 5061 -j RETURN

###REDIRECIONAMENTO DO TRAFEGO RESTANTE
iptables -t mangle -A PREROUTING -j MARK --set-mark 0x2
iptables -t mangle -A POSTROUTING -j MARK --set-mark 0x3


###RESOLVENDO A LIMITAÇO NA TROCA DE DADOS NA REDE INTERNA
iptables -t mangle -A OUTPUT -s 192.168.0.0/24 -j DSCP --set-dscp 46
iptables -t mangle -A OUTPUT -s 192.168.0.0/24 -j MARK --set-mark 0x1
iptables -t mangle -A OUTPUT -s 192.168.0.0/24 -j RETURN

------------------------------------------------------------------------------------

O problema é que, quando reinicio os serviços do firewall, recebo os seguintes erros (apesar dos erros, as outras regras do firewall, que já estaam no arquivo, iniciam normalmente):

Shutting down Firewall rules
Starting Firewall rules: RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
We have an error talking to the Kernel
RTNETLINK answers: File exists
We haven an error talking o the Kernel
RTNETLINK answers: File exists
We have an error talking to the Kernel
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: No such file or directory
RTNETLINK answers: File exists
FIREWALL RULES: Started

Akguém sabe o que pode estar errado no arquivo?


Obrigado!



  






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts