Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#152532 - 01/04/2003 22:36 Running a script on addition/removal of an iface
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Ok, long story short, my firewall script and pptp connection hate eachother. I connect my pptp connection,and the firewall begins blocking everything until it is restarted. I disconnect, and the same problem occurs. I've poked and prodded at the issue for a few hours, and at this point just want a quick fix, since the box is being replaced/reloaded in under a month. So, how can I have my Linux machine run a script the instant it sees a new interface appear, or disappear? I would do it manually, but the problem is that at times, I connect the PPTP session remotely, and cannot get the firewall script to run again if the connection drops without warning.

Top
#152533 - 01/04/2003 22:44 Re: Running a script on addition/removal of an ifa [Re: drakino]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Which distro? There are some variances

But if on RH/Mandrake, check out /etc/sysconfig/network-scripts
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#152534 - 01/04/2003 23:23 Re: Running a script on addition/removal of an ifa [Re: drakino]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
RedHat 7.ancient seems to run /sbin/if{up,down}-local with arguments including the interface name.

Top
#152535 - 01/04/2003 23:32 Re: Running a script on addition/removal of an ifa [Re: genixia]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Sorry, forgot that part. SuSE 7.2. Can't see anything like /etc/sysconfig/network-scripts, or if scripts.

Top
#152536 - 02/04/2003 07:52 Re: Running a script on addition/removal of an ifa [Re: drakino]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
If you're using pppd to make your pptp connection (I've seen some that work this way ages ago -- don't know if it's still the case), then you should be able to use up and down scripts to deal with it.

Read your pppd man page and look at the end at the ``SCRIPTS'' section. You should be able to whip up a quick ip-up script that checks to see if $IFNAME is the correct one, and, if so, restart your firewall.
_________________________
Bitt Faulk

Top
#152537 - 02/04/2003 10:25 Re: Running a script on addition/removal of an ifa [Re: wfaulk]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Bitt, that actually uncovered the problem for me. The ppp scripts were running the firewall wrongly when a pptp, or incoming pptp connection was run. Since the machine has no modem, and no need of ppp beyond pptp, I simply commented out the lines trying to stop and start the firewall.

I have never dialed up with Linux, so all the PPP interfaces are new to me.

Top