Community discussions

MikroTik App
 
mnour
just joined
Topic Author
Posts: 18
Joined: Wed Jul 25, 2012 10:45 pm

PCC vs Nth

Wed Jan 30, 2013 8:52 pm

Hello everybody , I know I am asking you too much , but I tried a lot of solution to make my networks works and there are always problems that comes usually up .

I Have Mikrotik RB1200 I am using it as a hotspot with dual wan connection " DHCP Connection "

I tried PCC and I couldn,t make it work to load balance or combine thow two line together .

when I tired Nth it worked beautifully as load balance with mark routing as odd and even like it is mentioned here

http://wiki.mikrotik.com/wiki/NTH_load_ ... masquerade

but in this method they have this code

/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 routing-mark=odd
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 routing-mark=even

add dst-address=0.0.0.0/0 gateway=10.111.0.1 scope=255 target-scope=10 distance=1
add dst-address=0.0.0.0/0 gateway=10.112.0.1 scope=255 target-scope=10 distance=1


when I try to use the name of the interface instead of IP address I can get the login page and when it redirects me the requied page it times out . when i change them back to IP address it works right away .

I need to make this two rule dynamic cause those IPs are assigned dynamically by ISP and we don,t know when ISP will change those IP thats why I am trying with interface name instead of IP .

is there any solution to that problem ???????
 
User avatar
jgellis
Member Candidate
Member Candidate
Posts: 139
Joined: Wed May 30, 2007 10:57 am
Location: USA

Re: PCC vs Nth

Thu Feb 07, 2013 8:27 am

A route with an interface specified instead of a gateway IP will not be used for NextHop lookups. This is by design, as without an IP, it can only communicate on a Point to Point link, meaning there is only one host at the other end of the interface.

If you are receiving the IPs via DHCP and using the add default route option, it's unlikely (though not impossible) that the ISP is providing you different gateways even though the IP may change. If the IPs are always from the same netblock and the gateway doesn't change, you can hard code the default route and turn off the option in the DHCP-client for add-default-gateway or change it to a lower priority/higher distance than other default routes in the main table to be used as a backup. Note that learned default routes are only entered into the "Main" routing table.

If however, you are using something else like PPPoE or if the DHCP gateway truly is variable, then you will need to create a script that periodically checks the DHCP-client to ensure it is bound and copies the value of the dynamically allocated gateway into your default routes that contain the routing mark.

Alternatively, I encourage you to explore the options available with the add-on package "Routing". With that, you can create a route filter that makes changes to the dynamic-in routes. Just set each dhcp-client to a different default-route-distance so the routing filter can correctly match each gateway separately. Using those filters, you could then set the routing mark of the dynamically learned gateway. Assuming you have DHCP and set your DHCP-clients default-route-distances to 10 and 11 respectively, here's a sample:
/routing filter
add chain=dynamic-in distance=10 action=passthrough set-routing-mark=even
add chain=dynamic-in distance=11 action=passthrough set-routing-mark=odd
Unfortunately, if you are using PPPoE for more than 1 wan link, I am not sure how to help, as the default route distance cannot be set on this connection type and would thus all be created with a distance of 1, making it impossible for the routing filter matcher to distinguish between them.

Who is online

Users browsing this forum: Google [Bot], keithy, sebi099 and 93 guests