This may be a horrible kludge (I dunno - not much of a scripter), but here 
goes:

1.  Write the first portion of your filter (up to the IP address) into a 
file (i.e. /etc/LaBrea.tmp)  - contents for mine would be:

tcp dst port 80 or 21 and dst host

2.  Create a script (i.e. /etc/ipupdate) that writes the filter and checks 
the IP of the external interface (eth0 on my box, change if needed).  The 
script's contents should look like this:

#Creates /etc/LaBrea.bpf
#!/bin/sh
cat filter > /etc/LaBrea.bpf
ip addr show eth0 | grep "inet " | sed s/"    "// | cut -d' ' -f 2 | cut 
-d'/' -f1 >> /etc/LaBrea.bpf
#Done

(that should only be 2 lines - not 3 - the second line wrapped)

3.  Chmod /etc/ipupdate to 744 (command would be "chmod 744 /etc/ipupdate" 
to do this).

4.  Edit the dhclient-exit-hooks to with the following changes:

# Reload networking to see new address
    reload_all

Add a line so you have

# Reload networking to see new address
    reload_all
    /etc/ipupdate

Save the file and it _should_ work (of course I can't test whether it works 
or not as my ip hasn't changed in over a year).  If anyone sees any obvious 
mistakes please point them out.

S

>From: Steve Jeppesen <[EMAIL PROTECTED]>
>To: "Simon Bolduc" <[EMAIL PROTECTED]>, leaf-user 
><[EMAIL PROTECTED]>
>Subject: Re: [Leaf-user] Unused IP's with LaBrea
>Date: Sun, 17 Feb 2002 17:38:19 -0600
>
>On Sun, 17 Feb 2002 17:27:21 -0500
>"Simon Bolduc" <[EMAIL PROTECTED]> wrote:
>
> > As long as you aren't dynamic you can always just use these settings in 
>the
> > options file:
>
>Thats the problem so far, I have a dynamic IP.  Suppose I could just 
>monitor my IP and change it manually.
>However that doesn't cut it in case it changes in the middle of the night 
>;) I have never created a script, but that sounds like the way to go like 
>Charles suggested - a script to monitor the IP assigned to eth0, and when 
>it changes have the script update the /etc/LaBrea.bpf
>
>If writing script is anything like Lisp code for AutoCAD, then I have a 
>chance at creating one!
>However, I am going to study what has been suggested before ever getting to 
>the point of letting LaBrea loose on the LRP box.
>
> >
> > # Options for start/restart the daemons
> > OPTIONS="-i eth0 -l -v -p 80000 -z -x -F /etc/LaBrea.bpf"
> >
> > and this is my /etc/LaBrea.bpf:
> >
> > tcp dst port 80 or 21 and dst host my.ext.ip.address
> >
> > and then you won't upset your neighbours/ISP, and don't have to have 
>another
> > machine running all the time.
>
>_______________________________________________
>Leaf-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/leaf-user




_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to