scripts ip-up

Questions related to general functionality
Post Reply
edsonag
Posts: 19
Joined: 22 Mar 2018, 20:30

scripts ip-up

Post by edsonag »

Hello.

I've been searching and have not found.
How do I run a script (/etc/ppp/ip-up) in pppd-compact ip-up configuration?

thanks
dimka88
Posts: 866
Joined: 13 Oct 2014, 05:51
Contact:

Re: scripts ip-up

Post by dimka88 »

Hi, in accel-ppp.conf uncomment

Code: Select all

[modules]
pppd-compat

and

Code: Select all

[pppd-compat]
verbose=1
#ip-pre-up=/etc/ppp/ip-pre-up
ip-up=/etc/ppp/ip-up
ip-down=/etc/ppp/ip-down
#ip-change=/etc/ppp/ip-change
radattr-prefix=/var/run/radattr
#fork-limit=16
then create file and give permissions to execute

Code: Select all

mkdir -p /etc/ppp/
touch /etc/ppp/ip-up
chmod +x /etc/ppp/ip-up
in /etc/ppp/ip-up script you write some command, for example

Code: Select all

#!/bin/sh
echo "test" >  /tmp/test_ppppd-compat
edsonag
Posts: 19
Joined: 22 Mar 2018, 20:30

Re: scripts ip-up

Post by edsonag »

I did this and it's working. Thanks.

Needed other help. I need to pass some qos functions to the connection, through a script. But I can not.
Initially I'm just trying to implement the ip-up file, but it looks like it did not work.
Here is the code:

Code: Select all

#!/bin/sh
if [ -f /var/run/radattr.$1 ];
then
DOWNSPEED='awk '/Mikrotik-Rate/ {print $2}' radattr.$1 | tr -d 'k' | awk -F "/" '{print $1}'';

    /sbin/tc qdisc del dev $1 root
    /sbin/tc qdisc del dev $1 ingress

    /sbin/tc qdisc add dev $1 root handle 1:0 htb
    /sbin/tc class add dev $1 parent 1:0 classid 1:1 htb rate ${DOWNSPEED}mbit
fi
I found an ip-up file in another post and changed it as needed, but it is not working. I needed the script to take the pppoe connection and from there make the modifications.

Thanks.
nik247
Posts: 108
Joined: 11 Oct 2014, 15:57

Re: scripts ip-up

Post by nik247 »

If you want only shaper from "Mikrotik-Rate-Limit":

Code: Select all

[shaper]
vendor=Mikrotik
attr=Mikrotik-Rate-Limit
rate-multiplier=0.001
edsonag
Posts: 19
Joined: 22 Mar 2018, 20:30

Re: scripts ip-up

Post by edsonag »

Hi,
Yes. The shaper works correctly.
I need to make some changes to this shaper, through script.
SashkaKP
Posts: 2
Joined: 29 Jul 2018, 17:09

scripts ip up

Post by SashkaKP »

How do I save all these scripts?

I have so many now, im scared ill lose them all
Post Reply