Jump to content

Динамично назначаване на QoS за PPPoE клиенти.


NetworkPro

Recommended Posts

/system script add name=set_pppoe_queues \

source={


:local mark-p2p p2p

:local mark-non-p2p other


/queue tree{

#

# First remove any invalid queues. This happens whenever a pppoe

# connection is dropped - even if the connection returns the queue is

# forever lost.

#

:foreach j in [find invalid=yes] do {

#

# MT Bug?: "disabled" entries are considered to be "invalid" and

# would be deleted here - this keeps any "disabled" entries

#

:if (![get $j disabled]=yes) do {

remove $j

}

}

}


/interface {

:foreach i in [find type="pppoe-in"] do {

:set ifacename ([get $i name])


# This will print the list of interfaces found (debugging)

# :put ($ifacename)


:set queuename ([:pick $ifacename 1 ([:len $ifacename] - 1)])


# Print the queue name to the console (debugging)

# :put $queuename


/queue tree{

#

# Create a "master-queue". The parent is the virtual interface

# (pppoe) not the physical interface

:if ([:len [find name=($queuename . " all out")]] = 0) do {

add name=($queuename . " all out") parent=$ifacename \

queue=qtype_p2p priority=1 limit-at=50000 \

max-limit=400000

}


#

# MT Bug?: It is possible to add a sub-queue to a "disabled" parent

# queue, and the sub-queue is not made "invalid" despite the fact

# that the parent queue "does not exist" (ie is "invalid")

# This prevents adding queue to a disabled parent

:if (![get [find name=($queuename . " all out")] disabled]=yes) do {

# Create a "sub-queue" for p2p traffic. The parent is the

# "master-queue" for the virtual interface (pppoe)

:if ([:len [find name=($queuename . " p2p out")]] = 0) do {

add name=($queuename . " p2p out") \

parent=($queuename . "all out") \

packet-mark=$mark-p2p queue=qtype_p2p priority=8 \

limit-at=50000 max-limit=200000

}


# Create a "sub-queue" for non-p2p traffic. The parent is the

# "master-queue" for the virtual interface (pppoe)

:if ([:len [find name=($queuename . " non-p2p out")]] = 0) do {

add name=($queuename . " non-p2p out") \

parent=($queuename . "all out") \

packet-mark=$mark-non-p2p queue=qtype_non_p2p \

priority=1 limit-at=0 max-limit=0

}

# Depending on how you have set up packet marking in mangle you

# can create "sub-queues" here for any other type of traffic sent out # on this virtual interface (pppoe)

}

}

}

}

}



/ system scheduler add name=set_pppoe_queues \

on-event=set_pppoe_queues \

interval=15s \

comment="Sets up non-simple pppoe queues for QoS"

Адрес на коментара
Сподели в други сайтове

  • Администратор

Това с 2.9.хх работи ли?

при мен нежелае

Харесай поста ^^^
acer.gif htc.gifsigpic4024_2.gif

Форумът е за взаимопомощ а не за свършване на чужда работа


ɹɐǝɥ uɐɔ noʎ ǝɹoɯ ǝɥʇ 'ǝɯoɔǝq noʎ ɹǝʇǝınb ǝɥʇ

Адрес на коментара
Сподели в други сайтове

Не съм тествал. Може да е за 2.8. Дава ти грешки при пействането в терминала? Или просто скрипта не изпълнява задачата си?

Адрес на коментара
Сподели в други сайтове

  • Администратор

просто недейства

нещо орязано има или не е копиран правилно

дори по скоро е непълен защото невключва маркиране

Харесай поста ^^^
acer.gif htc.gifsigpic4024_2.gif

Форумът е за взаимопомощ а не за свършване на чужда работа


ɹɐǝɥ uɐɔ noʎ ǝɹoɯ ǝɥʇ 'ǝɯoɔǝq noʎ ɹǝʇǝınb ǝɥʇ

Адрес на коментара
Сподели в други сайтове

Адрес на коментара
Сподели в други сайтове

Създайте нов акаунт или се впишете, за да коментирате

За да коментирате, трябва да имате регистрация

Създайте акаунт

Присъединете се към нашата общност. Регистрацията става бързо!

Регистрация на нов акаунт

Вход

Имате акаунт? Впишете се оттук.

Вписване
  • Потребители разглеждащи страницата   0 потребители

    • No registered users viewing this page.
×
×
  • Създай нов...

Important Information

By using this site, you agree to our Terms of Use.