Community discussions

MikroTik App
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Wed Nov 02, 2022 12:33 pm

Dear Team,

I have two lines from ISP which were connected to my mkrotik router 2001 to interfaces pppoe-out1 & pppoe-out2
ISP is disconnecting regularely and I need to check if the connected IP from ISP is to start with private address 10.*.*.*, then disable the interface and reconnect again and keep the connection if IP is none of ip range 10.*.*.*

Note : router model is 2011UiAS-2HnD ; revesion R2 ; upgrade firmware is 6.46.6
Thanks in advance
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Wed Nov 02, 2022 3:42 pm

ISP is disconnecting regularely
Why do not you contact your ISP about this?
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 12:56 pm

Hi rextended

In fact, the ISP is intended to assign a private IP (10.x.x.x) address with very low speed to the adsl line ( e.g. if Iam paying for 8 Mbps speed plan, they only submit 2 Mbps speed) with this IP. No idea why they are doing this! Maybe they have limited bandwidth.
Anyway, once the line is re-connected with another ip, the line speed is fine. (e.g. buying a 8Mbps speed plan, it reaches in good scenarios to 7.1 Mbps which still good)

I hope I did answer your question.

Finally, this is a WA to get rid of the issue.

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

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 1:16 pm

[…] this is a WA to get rid of the issue […]
Sorry, what is "WA"?

Probaly when the ISP go out of IPv4 public address assing 10.x to clients, but 10.x must be double natted and is slower...

I have one idea, wait the time I write...
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 1:25 pm

Try this, paste on on-up script on ppp profile used by pppoe-out1 and pppoe-out2:
:if ($"local-address" in 10.0.0.0/8) do={
    :delay 10s
    /interface
    set [get $interface name] name=[get $interface name]
}
EDIT: added delay for prevent excessive CPU and log usage
Last edited by rextended on Mon Nov 07, 2022 6:20 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 1:31 pm

I hope I did answer your question.
Let me know if this work for you.
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 10:32 pm

I did paste it this way as shown below:

[img]C:\Users\sfaqih\Desktop\ppp.jpg[/img]

I've created two profiles (profile 1 & profile2)
but I'm not sure which profiles are used by pppoe1 and pppoe2. There must be a way to link the pppoe to the profile number, isn't it?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 10:34 pm

do not create other profiles, use default or default-encryption, what is used by pppoe-out
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 10:39 pm

sorry, here is the attachments

and Yes, you are right, ISP has run of public IPs and there are double NAT for private IPs and tha't why the speed is very low.
You do not have the required permissions to view the files attached to this post.
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 10:44 pm

do not create other profiles, use default or default-encryption, what is used by pppoe-out
Ok, I did delete the new profiles and past the script into default and default-encryption but how to test the script. what should it do? Will it find the IP address started with 10.x.x.x and then disconnect the connection and re-connect it again?

Currently, pppoe-out2 has this IP 10.x.x.x as shown in the attachment but nothing changed yet after pasting the script to On Up into the two mentioned profiles above.
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 10:46 pm

you see the effect on next "on-up" when pppoe disconnect and reconnect
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 11:12 pm

you see the effect on next "on-up" when pppoe disconnect and reconnect
Yes, I did test this by disconnecting the pppoe-out2 and I've seen in the log that is connected twice. Does it get the same 10.x.x.x IP in the 1st attempt and then tried to reconnect again?!
BTW, in the 2nd attempt, I got a new Ip 134.x.x.x which is good.

it would be pretty if we log info for what happened during the trials of the re-connection. what do you think :)
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*  [SOLVED]

Thu Nov 03, 2022 11:16 pm

:local pppIP $"local-address"
:local iname [/interface get $interface name]
:if ($pppIP in 10.0.0.0/8) do={
    :log warning "I do not like $pppIP provided by the PPP Server to $iname, I am about to provoke a Reconnect in 10 seconds."
    :delay 10s ; # this prevents excessive CPU usage
    /interface
    set $iname name=$iname
} else={
    :log info "I like $pppIP provided by the PPP Server to $iname"
}
EDIT: Added delay for not have excessive logging and CPU use...
Last edited by rextended on Mon Nov 07, 2022 6:19 pm, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Thu Nov 03, 2022 11:48 pm

it would be pretty if we log info for what happened during the trials of the re-connection.
Work?
 
sfaqih
newbie
Topic Author
Posts: 26
Joined: Tue Aug 06, 2019 12:13 pm

Re: checking my ppoe-out1 and ppoe-out2 IP address and disable if equlal to private IP starts with 10.*

Fri Nov 04, 2022 10:58 am

it would be pretty if we log info for what happened during the trials of the re-connection.
Work?
YES YES, I checked today and it is working pretty fine.

I really appreciate your help. it is genius :)

Thanks a lot and Enjoy the day
I will mark the article as resolved
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: rextended and 20 guests