In explanation the most useful Topeka
set up a parallel (balanced) pair PPPoE connections with two local providers.
Author topic suggested two scripts: the first to specify routes and masquerading (NAT for Internet sharing to the rest of the local computers), the second to test the connection with pings then one, then the other interface and, appropriate, (re)assignment for the gateways (depending on the passage of the pings is enabled the gateway of the first provider, the second or both at once balanced). The second script is in its very early simply calls the first. Themselves scripts entirely possible to look into that topic
Everything turned out perfectly. Work available, distributed in a LAN.
But the idyll lasted until I handles in the console run:
And the weirdness started after quite a natural step. To up itself after a reboot, I added in crontab for root:
After you download the system check and see:
# ps ax | grep che
1261 ? Ss 0:00 /bin/sh -c /etc/balance/check.sh
1262 ? S 0:00 /bin/bash /etc/balance/check.sh
That is how the script would start.
And the Internet on the machine (and on ppp1 and ppp2 — all good) but on eth0 (to LAN) — it does not sound
At the same time, if I do it again manually in the console that seemed to have made the cron:
And I see this message:
RTNETLINK answers: File exists
And then starts output of the script ("Both channels", etc.) and, most importantly, at eth0 there is the Internet.
Suggested that the script is executed too early (for example, mascarading still nothing at the moment of his execution), set this in crontab:
5 23 * * * /etc/balance/check.sh
And restarted the car almost exactly 23 hours. Output redirected to a file. I looked in 23:10 — log script to write in time started, i.e. start the script on time, but the Internet does not sound. After starting manually in the console — all again apprx.
Tell me, please, what is the magic?
And, ideally, tell me the correct way to start all this stuff at boot and automatically restart if a script suddenly when something will die.
P. S. I Publish this question in addition to the comments in the topic, as the author of a topic on Habre a couple of days did not appear (and be notified of new comments the top level comes only to the author).
P. P. S. I asked this question on habré and not on any forum, because it is valuable in my situation the manual I also found only on Habre, but not on any forum.