bugfix script for ROSv7 PPPoE-Client

we are running WISP setup with ROSv7.5beta4 running on both PPPoE server and PPPoE clients.

if wlan1 goes down, pppoe client also goes down but its ipv4 address stays in /ip address menu as stuck…

so we wrote a script to remove dublicate address to prevent “error: could not add address: already have such address (6)”

:local interfaceName
:set interfaceName [/interface get $interface name]

:if ( [ :len ($"local-address") ] <= 0 ) do=\
{
  :log info "PPP removestuckadr: empty local address (down), checking if its stuck"
} else=\
{
  :log info "PPP removestuckadr: local address was ($"local-address") (down), checking if its stuck"
}

/ip address
:local stuckadrId
:set stuckadrId [ find interface="$interfaceName" ]
#check if address still exists
:if ( [ :len $stuckadrId ] > 0 ) do=\
{
  :log info "PPP removestuckadr: removing stuck IPv4 address of $interfaceName"
  remove $stuckadrId
}
/

I hope you can benefit from this script, would be useful if you run WISP setups based on ROSv7.

please add script’s name to PPP profile’s on-down textarea. so it can be auto-run.

What is “WISP Setup”?

Why you use beta on device that serve your customers?


:local interfaceName [/interface get $interface name]
:local ladd $"local-address"

:if ([:len $ladd] <= 0) do={
    :log info "PPP removestuckadr: empty local address (down), checking if its stuck"
} else={
    :log info "PPP removestuckadr: local address was $ladd (down), checking if its stuck"
}

/ip address
:local stuckadrId [find where interface=$interfaceName]
:if ([:len $stuckadrId] > 0) do={
    :log info "PPP removestuckadr: removing stuck IPv4 address of $interfaceName"
    remove $stuckadrId
}

https://en.wikipedia.org/wiki/Wireless_Internet_service_provider

@Jotne… I’m a WISP…

is not absolutely clear, but i think in this case WISP setup from client perspective refers to using Wireless interface as a cliente to connect to WISP infrastructure

this topic is a clear example why beta versions of software cannot be blindly deployed to production

this topic best fit on official topic of 7.5 beta release

http://forum.mikrotik.com/t/v7-5beta-testing-is-released/159724/1