Guest Posted December 3, 2008 Report Share Posted December 3, 2008 /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 More sharing options...
Administrator 111111 Posted December 4, 2008 Administrator Report Share Posted December 4, 2008 Това с 2.9.хх работи ли? при мен нежелае Харесай поста ^^^ Форумът е за взаимопомощ а не за свършване на чужда работа ɹɐǝɥ uɐɔ noʎ ǝɹoɯ ǝɥʇ 'ǝɯoɔǝq noʎ ɹǝʇǝınb ǝɥʇ Link to comment Share on other sites More sharing options...
Guest Posted December 4, 2008 Report Share Posted December 4, 2008 Не съм тествал. Може да е за 2.8. Дава ти грешки при пействането в терминала? Или просто скрипта не изпълнява задачата си? Link to comment Share on other sites More sharing options...
Administrator 111111 Posted December 4, 2008 Administrator Report Share Posted December 4, 2008 просто недейства нещо орязано има или не е копиран правилно дори по скоро е непълен защото невключва маркиране Харесай поста ^^^ Форумът е за взаимопомощ а не за свършване на чужда работа ɹɐǝɥ uɐɔ noʎ ǝɹoɯ ǝɥʇ 'ǝɯoɔǝq noʎ ɹǝʇǝınb ǝɥʇ Link to comment Share on other sites More sharing options...
Guest Posted December 5, 2008 Report Share Posted December 5, 2008 Преди години май от тук го сейвнах: http://www.butchevans.com/readarticle.php?article_id=15 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now