Hello Rani,

 : i am currently now serving PPPoE in my area. i had a script 
 : generated from tcng that worked perfectly before i started 
 : serving PPPoE. the issue is not in the script it self BUT in that 
 : "tc" code is not shaping on the ethernet anymore BUT INSTEAD on 
 : the pppX devices. I tested it and talking jargon, what should i 
 : do?
 : 
 : The issue is that for each PPPoE login, PPPoE-server creates on 
 : the server a pppX device. that is 10 logins means 10 ppp devices. 
 : from ppp0 till ppp9. and one might die upon disconnection. 

I'd suggest simply using the pppoe ip-up configuration scripts to 
call the appropriate tc or tcng commands.  Since ip-up should be 
called something like this:

  ip-up ppp0 $TTY $SPEED 192.168.0.4 10.0.0.4 $OTHER

Is ip-up called by YOUR pppoe-server binary? I am not able to test 
this.

you should be able to create a script that would either execute tc 
commands or a create tcng file on the fly.  I created the basic 
structure of such a script below, although you could probably 
add/replace your own shell functions (tc_sfq, tc_my_complex_config) 
with a much more complex traffic control configuration.

Good luck,

-Martin

#! /bin/bash
#
# -- add queuing to an interface brought up by pppd, 2006-04-11; -MAB
#    GPL
#
# ip-up <iface> <tty> <speed> <local-IP> <remote-IP> <ipparm>
dev="$1"    && shift
pty="$1"    && shift
spd="$1"    && shift
lip="$1"    && shift
rip="$1"    && shift


logger () { command logger -it "${0##*/}" -- "$@" ; }
abort  () { logger "$@" ; exit 1 ; }

tc_tbf () {
  local dev="$1"    && shift
  local lip="$1"    && shift
  local rip="$1"    && shift
  test "$dev" = ""  && abort "${FUNCNAME}() called with no device name"
  test "$lip" = ""  && abort "${FUNCNAME}() called with no local IP"
  test "$rip" = ""  && abort "${FUNCNAME}() called with no remote IP"

  cat <<-EOTC
        tc qdisc add dev $dev root handle 1:0 tbf rate 1544kbit limit 20kB 
burst 3kB
EOTC
}

# -- run all commands in a single shell that we instruct to quit on any error
#
tc_tbf  "$dev" "$lip" "$rip" | bash -e

# -- did the shell complete successfully?
#
test "$?" -gt 0 && abort "Could not install traffic control on $dev."

logger "Installed traffic control configuration on $dev."

# -- end of file



-- 
Martin A. Brown --- Wonderfrog Enterprises --- [EMAIL PROTECTED]
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

Reply via email to