Community discussions

MikroTik App
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

PCC load blance when the line is on but no internet

Thu Jul 14, 2011 9:27 am

I combine ADSL lines using PCC load balancing. Sometimes One of the line has no internet connection but the ADSL siginal is on. When this happen, the internet stop working for some users. If I Turn off the modem, the problem is solved and all users traffic goes through the Second ADSL line.

The internet signal in my ADSL modem stop frequently and doesn't come back unless I restart the modem ( I don't know if the problem from the modem or from ISP) but I want in that time all traffic to go to the second line that is working.

Bellow is the code that is used for PCC
/ip firewall address-list
add list=exempt-from-pcc address=192.168.9.168/32
add list=exempt-from-pcc address=192.168.3.168/32
/ip firewall mangle
add chain=prerouting dst-address-list=exempt-from-pcc action=accept


/ip address
add address=192.168.9.60/24 broadcast=192.168.9.255 comment="" disabled=no interface=wan1 network=192.168.9.0
add address=192.168.3.60/24 broadcast=192.168.3.255 comment="" disabled=no interface=wan2 network=192.168.3.0
add address=192.168.1.168/24 broadcast=192.168.1.255 comment="" disabled=no interface=lan network=192.168.1.0
/ip firewall mangle
add action=mark-connection chain=input comment="" disabled=no in-interface=wan1 new-connection-mark=wan1_conn passthrough=yes    
add action=mark-connection chain=input comment="" disabled=no in-interface=wan2 new-connection-mark=wan2_conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=wan1_conn disabled=no new-routing-mark=wan1 passthrough=yes    
add action=mark-routing chain=output comment="" connection-mark=wan2_conn disabled=no new-routing-mark=wan2 passthrough=yes
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan2_conn passthrough=yes per-connection-classifier=src-addresses:2/0  
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=lan new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=src-addresses:2/1
add action=mark-routing chain=prerouting comment="" connection-mark=wan1_conn disabled=no in-interface=lan new-routing-mark=wan1 passthrough=yes    
add action=mark-routing chain=prerouting comment="" connection-mark=wan2_conn disabled=no in-interface=lan new-routing-mark=wan2 passthrough=yes
/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.9.168 routing-mark=wan1 scope=30 target-scope=10    
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.3.168 routing-mark=wan2 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.9.168 scope=30 target-scope=10
add check-gateway=ping disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.3.168 scope=30 target-scope=10
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=wan1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=wan2
/ip dns set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: PCC load blance when the line is on but no internet

Thu Jul 14, 2011 4:49 pm

The basic solution is you need to implement a method for the router to test a specific route to insure that it is working properly and if it's not disable it and clear out the connection table for that route.

The reason why unplugging the router works is because it then puts the Ethernet link offline and then the router knows nothing is reachable on that interface, disables those routes, and does it's thing on its own. The check gateway function that you can enable in the router is only checking the default gateways IP address. This is not always a good test as it doesn't see if the internet is reachable, just the next hop.

There are a few posts around that have two methods to this as well as the wiki. There is a method with using a script and a method without using a script. I prefer the script method as I can test as many IPs as I want to and have the router send me an e-mail on a down event.
 
namo
Long time Member
Long time Member
Topic Author
Posts: 530
Joined: Sat Oct 03, 2009 4:44 pm

Re: PCC load blance when the line is on but no internet

Sat Jul 16, 2011 10:04 am

The basic solution is you need to implement a method for the router to test a specific route to insure that it is working properly and if it's not disable it and clear out the connection table for that route.

The reason why unplugging the router works is because it then puts the Ethernet link offline and then the router knows nothing is reachable on that interface, disables those routes, and does it's thing on its own. The check gateway function that you can enable in the router is only checking the default gateways IP address. This is not always a good test as it doesn't see if the internet is reachable, just the next hop.

There are a few posts around that have two methods to this as well as the wiki. There is a method with using a script and a method without using a script. I prefer the script method as I can test as many IPs as I want to and have the router send me an e-mail on a down event.
I will be thankful if you give me the link on the wiki for this issue

I want just to add that I have ADSL lines and IP from ISP is not static.