changes to PCC if ADSL modem bridge

I have combine two ADSL lines(with ADSL modems in router mode) using the fallowing code below. I want now to bridge the two ADSL lines so if the internet from one line is off, the traffic goes to the second line.

what lines should I add and what line should I remove and disabled from winbox? I want to be able to enter the modem pages if possible.

/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

the solution I got last time was not clear so I decide to open a new topic for this issuse.

You have two basic methods to implement fail-over, this should not require any modification to your current setup.

1.) Write a script that will test the lines for you via pings, or some other method.
2.) Use the scriptless method described in the Wiki and in the forum.
http://wiki.mikrotik.com/wiki/Advanced_Routing_Failover_without_Scripting

PCC is a load balancing method, not a fail-over one, therefore you need to add in that functionality yourself.

if the Ethernet is working then the ping will be success if if there is no internet in one of the two lines.

I don’t understand what you are saying?

With the script, when you ping you can specify a routing table for it to use, so you can make a test route, and use that to ping a remote address. The key is to ping an address that is on the internet, like Verizon’s DNS servers. Since it’s using a routing table with only one route in it, and it should always be active unless the Ethernet interface goes down, if the pings fail you can detect this and take action. This is the method I use on several boxes and it works just fine, you just need to disable the built in check-gateway function when adding the routes.

If an Ethernet interface goes down, it automatically disables any default routes attached to that interface, and whatever is marked for those routing tables will then fall through to the main routing table.

The script-less method should also work fine, I’ve just never used it since I like the flexibility of the script and use it to send me an e-mail on a down event.

The tools are all there, you just need to use them and adjust them to fit your needs.

I tried this but I can still see that half of the connection go to the second line. It is a bit slow when on of the modem is On but no internet but it is better than before when the internet stop working