Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#12350 closed defect (invalid)

$PPP_IFACE variable not working

Reported by: OviC Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: Cc:

Description

Hi.
I'm trying to run a custom shaper script on AA for a pppoe connection when the ppp interface is up, but it doesn't seem to work.
The script is located in /etc/ppp/ip-up.d/qos-on.sh

insmod cls_fw >/dev/null 2>&1
insmod sch_htb >/dev/null 2>&1
insmod sch_esfq >/dev/null 2>&1
insmod sch_prio >/dev/null 2>&1
insmod cls_u32 >/dev/null 2>&1
insmod act_mirred >/dev/null 2>&1
insmod sch_ingress >/dev/null 2>&1
insmod ifb >/dev/null 2>&1

SFQD="esfq perturb 10 hash dst"
SFQU="esfq perturb 10 hash src"
TC=/usr/sbin/tc
ip link set dev ifb0 up

$TC qdisc del dev $PPP_IFACE root
$TC qdisc del dev ifb0 root
$TC qdisc del dev $PPP_IFACE ingress
$TC qdisc add dev $PPP_IFACE root handle 1: htb
$TC filter add dev $PPP_IFACE parent 1: protocol ip prio 1 u32 match u32 0 0 flowid 1: action mirred egress redirect dev ifb0
$TC qdisc add dev ifb0 root handle 1:0 htb r2q 16 default 99
$TC class add dev ifb0 parent 1:0 classid 1:1 htb rate 25Mbit
$TC class add dev ifb0 parent 1:1 classid 1:11 htb rate 512kbit ceil 25Mbit prio 2
$TC class add dev ifb0 parent 1:1 classid 1:12 htb rate 256kbit ceil 20Mbit prio 4
$TC class add dev ifb0 parent 1:1 classid 1:99 htb rate 128kbit ceil 4Mbit prio 5
$TC qdisc add dev ifb0 parent 1:11 handle 11: $SFQD
$TC qdisc add dev ifb0 parent 1:12 handle 12: $SFQD
$TC filter add dev ifb0 parent 1:0 protocol ip pref 5 u32 match ip dst 10.76.0.2 flowid 1:11
$TC filter add dev ifb0 parent 1:0 protocol ip pref 5 u32 match ip dst 10.76.0.3 flowid 1:12


$TC qdisc add dev $PPP_IFACE ingress
$TC filter add dev $PPP_IFACE parent ffff: protocol ip prio 10 u32 match u32 0 0 flowid ffff: action mirred egress redirect dev ifb0
$TC class add dev ifb0 parent 1:1 classid 1:3 htb rate 4096kbit prio 1
$TC class add dev ifb0 parent 1:1 classid 1:21 htb rate 3072kbit prio 2
$TC class add dev ifb0 parent 1:1 classid 1:22 htb rate 1024kbit prio 4
$TC qdisc add dev ifb0 parent 1:3 handle 3: $SFQU
$TC qdisc add dev ifb0 parent 1:21 handle 21: $SFQU
$TC qdisc add dev ifb0 parent 1:22 handle 22: $SFQU
$TC filter add dev ifb0 protocol ip parent 1:0 pref 5 u32 match ip src 10.76.0.2 flowid 1:21
$TC filter add dev ifb0 protocol ip parent 1:0 pref 5 u32 match ip src 10.76.0.3 flowid 1:22
$TC filter add dev ifb0 parent 1:0 protocol ip prio 1 u32 \
           match ip protocol 1 0xff \
           match u8 0x05 0x0f at 0 \
           flowid 1:3

Here is the output when I run the script:

root@OpenWrt:/etc/ppp/ip-up.d# ./qos-on.sh
Cannot find device "root"
Cannot find device "ingress"
Cannot find device "root"
Unknown filter "1:", hence option "protocol" is unparsable
Cannot find device "ingress"
Unknown filter "ffff:", hence option "protocol" is unparsable

It used to work but not anymore. It doesnt' recognize the $PPP_IFACE variable.

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by jow

  • Resolution set to invalid
  • Status changed from new to closed

Well if you execute the script manually you have to declare PPP_IFACE yourself.

comment:2 Changed 5 years ago by OviC

The script is supposed to run when the ppp interface is up. It's not run manually. Like I said, it used to work until a few months ago without any declaration.
It is the $PPP_IFACE exported anymore in the ppp package ?

comment:3 Changed 5 years ago by jow

I don't see any trace of "PPP_IFACE" in the pppd 2.4.5 sources. The exported variables are:

BUNDLE
BYTES_RCVD
BYTES_SENT
CONNECT_TIME
DEVICE
DNS1
DNS2
IFNAME
IPLOCAL
IPREMOTE
LINKNAME
LLLOCAL
LLREMOTE
MACREMOTE
OLDIPLOCAL
OLDIPREMOTE
ORIG_UID
PEERNAME
PPPD_PID
PPPLOGNAME
SPEED
USEPEERDNS

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.