Community discussions

MikroTik App
 
cooling
just joined
Topic Author
Posts: 20
Joined: Tue Aug 22, 2006 12:59 pm

Multi gateway pppoe and static

Fri Jul 30, 2021 5:45 pm

i have 3 connections, 2 pppoe and 1 static ip, how to make that gateway can be 1 routing? does anyone have a script for that?

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

Re: Multi gateway pppoe and static

Fri Jul 30, 2021 5:48 pm

Explain better and probably someother help you
 
cooling
just joined
Topic Author
Posts: 20
Joined: Tue Aug 22, 2006 12:59 pm

Re: Multi gateway pppoe and static

Sat Jul 31, 2021 5:29 am

Explain better and probably someother help you
I have 2 pppoe accounts dynamically, and 1 static account, can with a script we can enter the ip route in 1 comment?
:local newgw1 [/ip address get [find interface="pppoe-out1"] network];
:local newgw2 [/ip address get [find interface="pppoe-out2"] network];
:local routegw1 [/ip route get [find comment="Test"] gateway ];
:local routegw2 [/ip route get [find comment="Test"] gateway ];
:if ($newgw1 != $routegw1),($newgw2 != $routegw2) do={
     /ip route set [find comment="Test"] gateway=$newgw1,$newgw2;
}
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Multi gateway pppoe and static

Sat Jul 31, 2021 10:58 am

@cooling
No need for crossposing same question in multiple threads.
 
cooling
just joined
Topic Author
Posts: 20
Joined: Tue Aug 22, 2006 12:59 pm

Re: Multi gateway pppoe and static

Sat Jul 31, 2021 11:11 am

ok Jotne , i'am sorry
 
mbaute
newbie
Posts: 30
Joined: Fri May 22, 2015 3:54 pm

Re: Multi gateway pppoe and static

Sat Jul 31, 2021 8:02 pm

hi cooling,

You shouldn't be doing this at all because it will break most of your nat'd connections over pppoe interfaces (/ip route set [find comment="Test"] gateway=$newgw1,$newgw2; this will do ecmp and multi socket like https will go haywire)

Try creating a default route with routing marks and a ppp profile for each of your links, and use the script tab to automate the gateway change and then split traffic using mangle, maybe pcc with source address matcher
/ip route set [find where comment=#pppoe1] gateway=[/ip address get [/ip address find interface=pppoe-cli-1] network]
Regards,
 
cooling
just joined
Topic Author
Posts: 20
Joined: Tue Aug 22, 2006 12:59 pm

Re: Multi gateway pppoe and static  [SOLVED]

Sun Aug 01, 2021 7:48 am

Solved
:local newgw1 [/ip address get [find interface="pppoe-out1"] network];
:local newgw2 [/ip address get [find interface="pppoe-out2"] network];
:local routegw1 [/ip route get [find comment="Test"] gateway ];
:local routegw2 [/ip route get [find comment="Test"] gateway ];
:if ($newgw1 != $routegw1) do={
/ip route set [find comment="Test"] gateway="$newgw1,$newgw2";

}
Insert route with one comment Test

Thanks All

Who is online

Users browsing this forum: baragoon and 20 guests