Donald Chan <[EMAIL PROTECTED]> wrote:
>
> How can one accomplish this with a dynamic IP? What would I specify
> in my startup scripts to setup ipportfw before knowing what my dynamic
> IP might be?
This is something I do by writing a nice /etc/ppp/ip-up script to add
the necessary forwarding rules whenever my connection comes up. The PPP
daemon will launch this script whenever a connection is established, and
the IP address is one of the many parameters that it is invoked with.
Here's a short example:
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
# Get parameters
ifname=$1
ttydev=$2
speed=$3
localip=$4
remoteip=$5
# Add ipportfw rules to forward X traffic to internal machine
ipmasqadm portfw -f
ipmasqadm portfw -a -P tcp -L $localip 4000 -R internal_host 4000
ipmasqadm portfw -a -P tcp -L $localip 6000 -R internal_host 6000
Thus, every time my connection comes up, I flush all the portfw rules,
then add two rules: One that forwards port 4000 connections to
internal_host (for DXPC connections), and another to forward real X
traffic on port 6000 to the same host.
Note, this is the 2.1 kernel syntax, using the "ipmasqadm" command. I'm
afraid I don't have the 2.0 information handy, but I believe it's simply
the command "ipportfw" with the same parameters as above.
I think you'll find this will work well for you. :)
--
[EMAIL PROTECTED] (Fuzzy Fox) || "Nothing takes the taste out of peanut
sometimes known as David DeSimone || butter quite like unrequited love."
http://www.dallas.net/~fox/ || -- Charlie Brown
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For daily digest info, email [EMAIL PROTECTED]