Jump to content
Калькуляторы

лыжи не едут? mpd5 coa

sp.sh

#!/bin/bash

echo User-Name = user059, mpd-limit += \\"in #1=all shape 262000 4000 pass\\", mpd-limit += \\"out#1=all shape 262000 4000 pass\\" | radclient -x -s 192.168.0.52:3799 coa set

 

# ./sp.sh
Sending CoA-Request of id 204 to 192.168.0.52 port 3799
       User-Name = "user059"
rad_recv: CoA-ACK packet from host 192.168.0.52 port 3799, id=204, length=20

          Total approved auths:  1
            Total denied auths:  0
              Total lost auths:  0

 

Dynamic routes via peer:

IPFW pipes:

IPFW queues:

IPFW tables:

IPFW rules:

Traffic filters:

Traffic limits:

 

А до запуска срипта было:

Dynamic routes via peer:

IPFW pipes:

IPFW queues:

IPFW tables:

IPFW rules:

Traffic filters:

Traffic limits:

in#1 : 'all shape 4096000 pass'

out#1 : 'all shape 4096000 pass'

 

 

не пойму, по какой причине он сбрасывает настройки, а не просто меняет скорость.

Share this post


Link to post
Share on other sites

Как вижу в логах ничего нету по этому поводу, но запрос есть

 

Mar 22 12:39:10 pppoe mpd: radsrv: CoA request
Mar 22 12:39:10 pppoe mpd: radsrv: Got RAD_USER_NAME: user059
Mar 22 12:39:10 pppoe mpd: radsrv: Matched link: re0-2
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=9 addr="[9a1]:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 0
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2313
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    shutdown (1)
Mar 22 12:39:10 pppoe mpd: netgraph:   args
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=20 addr="mpd22267-B-1-mss:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 0
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2315
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    shutdown (1)
Mar 22 12:39:10 pppoe mpd: netgraph:   args
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=9 addr="[991]:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 32
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2317
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    rmhook (5)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { hook="inet" }
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=7 addr="ng0:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 32
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2319
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    rmhook (5)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { hook="inet" }
Mar 22 12:39:10 pppoe mpd: [b-1] IFACE: Down event
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=9 addr="[991]:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 96
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2321
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    mkpeer (2)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { type="tcpmss" ourhook="inet" peerhook="in" }
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=14 addr="[991]:.inet" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 32
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2323
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    name (4)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { name="mpd22267-B-1-mss" }
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=14 addr="[991]:.inet" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 576
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2325
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie GENERIC (1137070366)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    connect (3)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { path="ng0:" ourhook="out" peerhook="inet" }
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=20 addr="mpd22267-B-1-mss:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 66
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2327
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie TCPMSS (1097623478)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    config (4)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { inHook="in" outHook="out" maxMSS=1448 }
Mar 22 12:39:10 pppoe mpd: netgraph: SENDING MESSAGE:
Mar 22 12:39:10 pppoe mpd: netgraph: SOCKADDR: { fam=32 len=20 addr="mpd22267-B-1-mss:" }
Mar 22 12:39:10 pppoe mpd: netgraph: NG_MESG :
Mar 22 12:39:10 pppoe mpd: netgraph:   vers   8
Mar 22 12:39:10 pppoe mpd: netgraph:   arglen 66
Mar 22 12:39:10 pppoe mpd: netgraph:   flags  0
Mar 22 12:39:10 pppoe mpd: netgraph:   token  2329
Mar 22 12:39:10 pppoe mpd: netgraph:   cookie TCPMSS (1097623478)
Mar 22 12:39:10 pppoe mpd: netgraph:   cmd    config (4)
Mar 22 12:39:10 pppoe mpd: netgraph:   args   { inHook="out" outHook="in" maxMSS=1448 }
Mar 22 12:39:10 pppoe mpd: [b-1] IFACE: Up event
^C
pppoe#

Share this post


Link to post
Share on other sites

не, ерунда какая-то, log radius2 iface2 есть?

Share this post


Link to post
Share on other sites

Mar 22 14:55:18 pppoe mpd: radsrv: CoA request
Mar 22 14:55:18 pppoe mpd: radsrv: Got RAD_USER_NAME: user159
Mar 22 14:55:18 pppoe mpd: radsrv: Matched link: re0-3
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Remove address 10.20.20.254/32->22.6.5.16 from ng1
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Down event
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Change interface flags: -4097 +0
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Connecting tcpmssfix
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Add address 10.20.20.254/32->22.6.5.16 to ng1
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Up event
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: session-timeout: 86400 seconds
Mar 22 14:55:18 pppoe mpd: [b-2] IFACE: Change interface flags: -0 +1
^C
pppoe#


 

Это плюет при запуске скрипта.

        log +ccp +ccp2 +ecp +ecp2 +fsm +echo +phys +phys2 +phys3 +chat +chat2 +iface +iface2 +frame +radius +radius2 +lcp +auth +bund

а это то что стоит в конфиге

Share this post


Link to post
Share on other sites

sp.sh

#!/bin/bash

echo User-Name = user059, mpd-limit += \\"in #1=all shape 262000 4000 pass\\", mpd-limit += \\"out#1=all shape 262000 4000 pass\\" | radclient -x -s 192.168.0.52:3799 coa set

А для чего пробел после "in" здесь?

in #1=all shape 262000 4000 pass

Опечатка в посте, или в скрипте так?

И где ссылка на словари для радклиента?

Share this post


Link to post
Share on other sites

echo User-Name=user059,mpd-limit+=\\"in#1=all shape 262000 pass\\",mpd-limit+=\\"out#1=all shape 262000 pass\\" | radclient -d /usr/share/freeradius/ -x -s 192.168.0.52:3799 coa set

 

Все равно. результат. нуль.

Share this post


Link to post
Share on other sites

Попробуйте вот так

echo User-Name = userXXX, mpd-limit += \"in#1#Ext=all shape 2560000 pass\", mpd-limit += \"out#1#Ext=all shape 2560000 pass\" | /usr/local/bin/radclient -d /usr/local/share/freeradius/ -x -s 10.254.213.3:3799 coa пароль_к_радиусу

У меня во всяком случае работает

Sending CoA-Request of id 95 to 10.254.213.3 port 3799
       User-Name = "userXXX"
       mpd-limit += "in#1#Ext=all shape 2560000 pass"
       mpd-limit += "out#1#Ext=all shape 2560000 pass"
rad_recv: CoA-ACK packet from host 10.254.213.3:3799, id=95, length=20

          Total approved auths:  1
            Total denied auths:  0
              Total lost auths:  0

P.S. Возможно еще из-за двойных слэшей (\\) не обрабатывает. И еще - что это такое у вас в конце строки - "set"?? Там пароль должен быть.

P.P.S. В скрипте обязательно указывайте полные пути к radclient и dictionary

Edited by AlKov

Share this post


Link to post
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
Sign in to follow this