I need to configure PCC for 3 connections, two of them are cable modems, dynamic IP and one is PPPoE, dynamic IP too.
For a moment I saw examples with static IP only and that didn’t work for me. I have tested with two connections and this will not work without specified IP gateway for each routing mark and I am not sure is there is another way to do it. There is always possibility to made script which will read what DHCP client and PPPoE clients get, to run script each min and to look for difference, to rebuild all … I don’t like complicated solutions, there shall be something better ?
Something like (I know, this won’t work but why ?):
add dst-address=0.0.0.0/0 gateway=wlan1 routing-mark=to_wlan1 check-gateway=ping
instead of :
add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_wlan1 check-gateway=ping
Another question :
if I have two DHCP clients and have assigned for both of them “add default route”, why this must be exclusive ? When second client add default route this disables previous one default route and this again pushing me to scripts, not to use automatic default rute but to run script and to made “static” route (if can be called static route something checked every 1 minute).
Thank you in advance,
Dejan
btw. Article http://wiki.mikrotik.com/wiki/PCC may be confusing. In first part 10.111.0.0/24 is assigned to wlan1 and in second part this is assigned to wlan2.
I mean, you have dynamic IP address… but gateway should be static - so you simply add static routes for your Ethernet uplinks, and then use gateway=pppoe-out1 for your 3rd uplink
The problem is because static routes didn’t work well. I am doing testing with two cable modem connections right now and, if I add default route to interface instead of default gateway IP that didn’t work by some reason. If I add static routes after DHCP client get addresses that working but that IP may change anytime and I don’t want to think about that.
two dhcp clients assigned to two ports, both getting default gateway results is :
wan1 111.111.111.111/24 gateway 111.111.111.1
wan2 222.222.222.222/24 gateway 222.222.222.1
in routing table both show as assigned as default gateway but one is disabled, randomly.
after static routes are added there are extra records in routing table, some of them dissabled but all working OK. If I delete default route to gateway IP (111.111.111.1) and add default route to interface wan1 this just don’t working, can’t connect anywhere.
as I can see best way is to have disabled default route in dhcp client, once dhcp client get IP to check what is gateway for each one interface and to made static routes. I have tried that and this is working but, in order to have this working after IP change I need to made script which will check IP on each interface every 1 minute and to recreate all routes if something is changed. Also, would like to have default route to all interfaces, in case one connection drop another connections would take all traffic.
So, my question is : shall routes working to interface instead of IP when IP is dynamic ? Maybe I am doing something wrong, I have done something like that already on debian couple years ago, only one difference was because all IP were fixed.
dhcp lease is 24 hours, that usually don’t change for days and weeks and then they work on something and this all reset. I don’t know what is in backgrund but this is local cable provider with bunch /16 IP blocks.
I have done one of scripts needed for route change but can’t find how to call script from another script. In all documentations this is mentioned as allowed but I just can’t find syntax.
I guess this is the same I asked long time ago. I actually proposed to Mikrotik to include option that is availiable even on Windows Home: option to set priority of interfaces.
That way, interface can obtain network parameters dynamicaly, including default gateway. If several interfaces obrain default gateway, priority of the interfaces would rule priority of default gateways. That is plain and simple.