[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ppp/ip-up vs. network/if-up



On Wed, 2004-10-13 at 22:10 +0200, Thomas Hood wrote:
> On Wed, 13 Oct 2004 09:50:04 +0200, Adrian 'Dagurashibanipal' von Bidder
> wrote:
> > I think Robert thought about if the scripts are rerun if pppd loses 
> > connection and reconnects - typically with a different IP.
> 
> 
> FYI: The experimental ifupdown does not currently rerun "up" scripts if
> pppd reconnects.
> 
> I can see why, in the case of PPP interfaces, that might be desired.  I am
> not sure that we should implement it, though.  It would depart from the
> way ifupdown "up" and "down" scripts have worked in the past for other
> interfaces.

If the goal is something like:
bring my adsl link up when the box starts.
run an iptables script when the link ataches, every time
if ppp gives up completely on the link, sms my phone
AND only use ifupdown scripts, not the ppp specific ones....

then something has to be implemented. Note that ethernet interfaces with
dhcp would also benefit - there are dhcp customisation
(/etc/dhclient-{enter,exit}-hooks scripts that folk customise to run
iptables or whatever after the link comes up, because the ip address may
change. Wireless too is another one.

I think there is basically a general class of network event to represent
these, and if ifupdown is taught it, and then dhcp, ppp, <whatever> are
hooked into it, the result would be fanastic. That class is link events,
as opposed to interface ones. I.e. add link-pre-up.d, link-up.d,
link-post-down.d directories.

where link-pre-up.d might be invoked by dhclient when a wireless
interface gets link, before the dhcp requests are sent, link-up.d after
the ip address is allocated, link-post-down.d after the link is found to
be dead for whatever reason. (link-down.d is unlikely to be needed IMO,
but perhaps we should add it for completeness..)

So for my goal above, I'd:
set ppp0 to auto in /etc/interfaces
add an iptables paranoid rule for the interface in the link-pre-up.d
scripts dir.
add an iptables customisation-for-the-up in the link-up.d dir
add the sms script to the if-post-down.d

-Rob


-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: