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

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

Why do not you contact your ISP about this?

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

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…

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

Let me know if this work for you.

I did paste it this way as shown below:

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?

do not create other profiles, use default or default-encryption, what is used by pppoe-out

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.
ppp1.jpg
ppp.jpg

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 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 :slight_smile:


: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…

Work?

YES YES, I checked today and it is working pretty fine.

I really appreciate your help. it is genius :slight_smile:

Thanks a lot and Enjoy the day
I will mark the article as resolved