Community discussions

MikroTik App
 
volkirik
Member Candidate
Member Candidate
Topic Author
Posts: 208
Joined: Sat Jul 23, 2016 2:03 pm

bugfix script for ROSv7 PPPoE-Client

Fri Jul 29, 2022 7:29 pm

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: bugfix script for ROSv7 PPPoE-Client

Fri Jul 29, 2022 8:52 pm

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
}
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: bugfix script for ROSv7 PPPoE-Client

Fri Jul 29, 2022 10:54 pm

 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: bugfix script for ROSv7 PPPoE-Client

Fri Jul 29, 2022 11:09 pm

@Jotne... I'm a WISP...........
 
User avatar
chechito
Forum Guru
Forum Guru
Posts: 2989
Joined: Sun Aug 24, 2014 3:14 am
Location: Bogota Colombia
Contact:

Re: bugfix script for ROSv7 PPPoE-Client

Fri Jul 29, 2022 11:47 pm

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

viewtopic.php?t=187950

Who is online

Users browsing this forum: No registered users and 19 guests