Remote gateway over WLAN and 3G dongle as failover

Hi guys!
I know this was a subject to many discussions here but something is not right in my config:

  • Cisco/Linksys E2500 as a gateway - static 192.168.1.254, with DHCP server;
  • RB435G as a main device for local network with following config:
  • wlan1 (WAN) - connects to E2500 and dynamically gets 192.168.1.100 (as assigned);
    • wlan2 (LAN) - acts as an access point for local clients; static 192.168.0.254; DHCP server: gateway-192.168.1.254; DNS-192.168.0.254, 192.168.1.254, 8.8.8.8; pool-192.168.0.1-192.168.0.253;
    • ppp-out1 (WAN2) - Some Huawei dongle: Add Default Route enabled. I’d like to use it as a failover.

Nothing fancy. The ppp-out1 is usually down and everything works fine while I use wlan1 as WAN. After enabling ppp-out1 and disabling wlan1, proper (I hope) dynamic routes for ppp-out1 are being added but the Internet connection on 192.168.0.0 hosts is not working.
I’ve tried adding masq for ppp-out1 to no avail but I can see packets/bytes counter ticking.
There might be a problem since my 3G provider displays a webpage to enter the captcha prior to granting access to the Internet - this page won’t come up.
I know that failover would require some scripting as simply rising route distance of ppp-out1 might be not enough but first of all I need to get the simpler config to work.

Any thoughts on that? If you need some code, jlmk.

I think a script is the way to go here.
You have to change the routing, or you could do it with some nat rules.

Its not more than a few lines of code

Afaik, scripting isn’t necessary to get simple routing between WWAN and WLAN to work. It actually should work out of the box: plug in the dongle, add ppp interface, configure it (with Add Default Route enabled) and that’s it.
I’m sure it worked previously on my box when the whole configuration was simpler so I assume that it’s something wrong within my config.