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)"
Code: Select all
: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
}
/
please add script's name to PPP profile's on-down textarea. so it can be auto-run.