[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HTB (um poco longo, mas com solução!)



Olá chará! :-)
Valeu pela ajuda.

O iproute/tc tem suporte a htb sim!
look:

[root@server qos]$ strings /sbin/tc | grep htb
htb_util
htb2_util
Usage: ... qdisc add ... htb [default N] [r2q N]
... class add ... htb rate R1 burst B1 [prio P] [slot S] [pslot PS]
htb: failed to calculate ceil rate table.
htb: failed to calculate rate table.
htb2
[root@server qos]$

O kernel tb tem suporte...

Eu, estou migrando de uma solução rodando no RedHat, para uma Debian.
Olhando o debug do htb, eis que aparece: (/var/run/htb-start)

# Fri Sep 24 15:01:42 BRT 2004

# ip link show
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:06:5b:28:87:8b brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:7d:b0:ac:90 brd ff:ff:ff:ff:ff:ff
4: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0

# tc qdisc del dev eth0 root
RTNETLINK answers: No such file or directory

# tc qdisc add dev eth0 root handle 1 htb default 100 r2q 10

# ip link show
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000
    link/ether 00:06:5b:28:87:8b brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:e0:7d:b0:ac:90 brd ff:ff:ff:ff:ff:ff
4: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0

# tc class add dev eth0 parent 1: classid 1:2 htb rate 100Mbit

# tc class add dev eth0 parent 1:2 classid 1:100 htb rate 1Kbit ceil 100Mbit

# tc class add dev eth0 parent 1:2 classid 1:101 htb rate 33Kbit ceil 777Kbit prio 1

# tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 200.200.200.200/32 match ip sport 22 0xffff match ip dst 10.42.0.5/3
2 classid 1:101

# tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip src 200.200.200.200/32 match ip dst 10.42.0.5/32 match ip dport 22 0xfff
f classid 1:101

Busacando documentações diversas (e até mesmo antigas) descobri isso:

packet_shaping_howto.txt

6. Using 'tc'

'tc' can be a fairly hard to use program. The user space generally does a
  little bit of syntax checking and then sends it to the kernel. The kernel
sends only a single integer back indicating success or failure. So unless you
  made a spelling mistake, your errors will generally be of the form:

  RTNETLINK answers: No such file or directory
  RTNETLINK answers: File exists
  RTNETLINK answers: Invalid argument

The first generally means you referenced a handle that does not exist. The second generally means to tried to add something where the handle was already in use. The last is the catch-all error that generally means "Something went wrong". There is usually no indication of what and generally only much re-reading of help and trial-and-error will help you here. Part of the reason for writing
  this document is to save you such agony.

Eu estava tendo um RTNETLINK answers: No such file or directory.


Simplesmente eu notei que eu estava "tentando remover algo que não existia".

Retirando-se esta linha, tudo volotu ao normal.

É sexta-feira né? Fazer oq?

[]'s

Christian Lyra wrote:
Oi,

Ou o teu kernel não tem suporte para o HTB, ou (Muito mais provavel) o iproute/tc é que não tem! Vc precisa de um tc que saiba como manipular o htb. Na pagina do htb vc encontra um pacote iproute com os patchs para ele funcionar corretamente com o htb.

Em Sexta 24 Setembro 2004 13:59, Christian escreveu:

Olás!
Alguém aqui que esteja usando o HTB já teve esta mensagem de erro? Ou
pelo menos sabe o que significa??

RTNETLINK answers: No such file or directory
RTNETLINK answers: File exists

ps: Kernel 2.6.7-1-686

[]'s






Reply to: