Dani Arbel wrote: > > Besides, even when running "route add default gateway" manually, it > > doesn't OVERRIDE the original gateway, but only inserts a yet another > > entry. > Thats a normal behaviour. routes have metric. make your original default > route have metric larger than 0 , and then the new default (with 0 metric) > will come first.
Thanks, it works! (but there is a continue...): > > In addition, since pppd is invoked in the background, it is impossible > > to add a "route" command to the rc init script, but it must be done > > after pppd succeeded to establish a connection with the ADSL (which > > takes at least a few seconds). "route" also needs the exact IP number > > of the default router in the case of ADSL, which usually isn't > > permanent, and should be sed'ed/awk'ed/etc. from the output of > > ifconfig. > > you could do some if-then clauses in the connect script that will handle > the new route. No, the calls return immediately, and the real work of pppd is done in the background, so if-then will not help. There are two other options, though: a. *IF* there are scripts that pppd uses to do its work, the if-then can be inserted there. I'll try to find such scripts. b. Immediately after invoking the pptp command, the relevant rc init script can invoke a command that will wait 30 seconds (using "at"), check the status of ppp0, and if it's OK - "route add default". But it's ugly (up/down scripts may be nicer). An advanced version will use cron to check the status of the ADSL line once per 2 minutes, and anytime its status changes, it will call "route add/del default metric 0 dev ppp0". This is why it was so important for me to understand what is needed so the "defaultroute" parameter of pptp/pppd would work correctly. It could save us the whole balagan. By the way: I've always thought that the "gateway XXX.XXX.XXX.XXX" is required. Now I see that it can be omitted, and the "dev ppp0" is enough. However, omitting the "gateway" affects the behavior, and in a very wierd and inconsistent way: a. The original case that I presented in this thread, was a FR default with metric 1, that remains the default even after adding ppp0 as a default. b. However, if the "gateway" is omitted from the "route add default" of ppp0, then the ppp0 becomes the main default, although its metric is the same as the FR. c. On the other hand, if in the original case (a), that default was deleted using "route del default", and then the "route add default" was re-invoked but without the "gateway" (i.e. case (b)), then the FR remains the main default. This is not the first case of inconsistency with routings. And all those woes leave me very confused. When there are clear rules, you know where you are and what you should do. Here, you always hope that your guesses were correct, and that nothing will behave differently tomorrow. Fortunately, Dani/Tzafrir/Tzahi/etc. are here to help ;-) Thanks, -- Eli Marmor [EMAIL PROTECTED] CTO, Founder Netmask (El-Mar) Internet Technologies Ltd. __________________________________________________________ Tel.: +972-9-766-1020 8 Yad-Harutzim St. Fax.: +972-9-766-1314 P.O.B. 7004 Mobile: +972-50-23-7338 Kfar-Saba 44641, Israel ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
