Community discussions

MikroTik App
 
LPby
just joined
Topic Author
Posts: 8
Joined: Thu Jun 17, 2010 11:03 pm

Reset pppoe connection

Wed Jun 23, 2010 2:30 pm

When RB750 connects to provider, some times it get IP from 10.x.x.x subnet (DHCP).
How can I reset this connection by script to receive another IP?
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Reset pppoe connection

Wed Jun 23, 2010 5:57 pm

mmm... dhcp has nothing to do with pppoe... what exactly do you need?..
 
LPby
just joined
Topic Author
Posts: 8
Joined: Thu Jun 17, 2010 11:03 pm

Re: Reset pppoe connection

Thu Jun 24, 2010 10:13 am

mmm... dhcp has nothing to do with pppoe... what exactly do you need?..
Not dhcp. I want mikrotik to reestablish pppoe connection to get another IP.

Here is my script:
# Define Global Variables
:global ddnsipmask
:global ddnsip
:global ddnslastip
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip "0" }
:global ddnsinterface "pppoe-ByFly"

# Grab the current IP address on that interface.
:global ddnsipmask [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
:global ddnsip [:pick $ddnsipmask 0 ([:len $ddnsipmask]-3) ]

# Did we get an IP address to compare?
:if ([ :typeof $ddnsip ] = nil ) do={
   :log info ("DynDNS: No ip address present on " . $ddnsinterface . ", please check.")
} else={
# Did we get correct IP?
#  :if ([:pick $ddnsip 0 2] != 93 || [:pick $ddnsip 0 2] != 82) do={   HERE_I_WANT_TO_REESTABLISH_PPPOE_CONNECTION   }
  :if ($ddnsip != $ddnslastip) do={
    :log info "DynDNS: Sending UPDATE! ($ddnsip)"
    :log info [/tool dns-update name=someone.myddns.com address=$ddnsip key-name=key key=pass]
    :global ddnslastip $ddnsip
  }
}
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Reset pppoe connection

Thu Jun 24, 2010 12:33 pm

/interface disable pppoe-ByFly
/interface enable pppoe-ByFly
BTW, when does ByFly assign 10/8 addresses?..
 
LPby
just joined
Topic Author
Posts: 8
Joined: Thu Jun 17, 2010 11:03 pm

Re: Reset pppoe connection

Thu Jun 24, 2010 3:41 pm

For example, logs from changeip.com:
6/23/2010 1:40:05 AM D:1 R:1 S:1 Success ip=93.84.185.56&hostname=x.myddns.com 93.84.185.56 x Mikrotik/3.x
6/22/2010 1:30:03 PM D:0 R:1 S:1 Success ip=10.0.5.147&hostname=x.myddns.com 93.84.184.0 x Mikrotik/3.x
6/22/2010 4:30:02 AM D:1 R:1 S:1 Success ip=93.84.186.199&hostname=x.myddns.com 93.84.186.199 x Mikrotik/3.x
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Reset pppoe connection

Thu Jun 24, 2010 4:17 pm

omg, they're crazy %)
 
gabuplace
just joined
Posts: 1
Joined: Fri Apr 10, 2015 8:42 pm

Re: Reset pppoe connection

Fri Apr 10, 2015 8:55 pm

Hi,
I have the same problem, inaccessible subnet. You could find a solution ?


For example, logs from changeip.com:
6/23/2010 1:40:05 AM D:1 R:1 S:1 Success ip=93.84.185.56&hostname=x.myddns.com 93.84.185.56 x Mikrotik/3.x
6/22/2010 1:30:03 PM D:0 R:1 S:1 Success ip=10.0.5.147&hostname=x.myddns.com 93.84.184.0 x Mikrotik/3.x
6/22/2010 4:30:02 AM D:1 R:1 S:1 Success ip=93.84.186.199&hostname=x.myddns.com 93.84.186.199 x Mikrotik/3.x
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Reset pppoe connection

Mon Apr 13, 2015 12:56 pm

if you have the same problem - then use the same solution!
http://forum.mikrotik.com/viewtopic.php ... 53#p214453

Who is online

Users browsing this forum: No registered users and 20 guests