Autoroute pptp client

For auto routing on my pptp server I use similar script like this but with ${IPREMOTE} parameter

cat << "EOF" > /etc/ppp/ip-up
case ${PEERNAME} in
(USERNAME1) ... ;;
(*) ... ;;
chmod +x /etc/ppp/ip-up

So I really want to use the same concept on my client router

But I don't know the names of parameters for client like ${} , or pptp client can't do such thing ?

1 Like
mkdir -p /etc/ppp/ip-up.d
cat << "EOF" > /etc/ppp/ip-up.d/
logger -t pppsh ${0} ${@} $(env)
chmod +x /etc/ppp/ip-up.d/
ifup vpn
sleep 5
logread -e pppsh

But I think it's best to avoid using PPP scripts on the client side.
PPTP client is managed by netifd which cannot track changes outside of the UCI config.
So, setting up routes is recommended using native UCI syntax:


So I can make just static route ?
Like this

I have already in my /etc/config/network

config interface 'vpn'                                                                 
        option proto 'pptp'                                                            
        option ipv6 'auto'                                                             
        option server ''                                                  
        option defaultroute '0'                                                        
        option password 'crml'                                                     
        option username 'vpnic'

So I just add

config route
        option interface 'vpn'
        option target ''
        option netmask ''
        option gateway ''

But there is no gateway before connnection , would it work

1 Like

You can specify the target as and remove netmask and gateway.


This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.