Jump to content

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


NetworkPro
 Share

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"

Link to comment
Share on other sites

  • Administrator

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

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

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

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


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

Link to comment
Share on other sites

  • Administrator

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

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

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

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

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


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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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