Natd stops working on Firewall
jonathan at turnip.org.uk
Thu Mar 27 10:06:49 PST 2003
On Tue, Mar 25, 2003 at 08:33:12PM -0500, Scot wrote:
> Thanks Ruslan ;
> I'll give it a try right now.
> Just want to send this out before I switch firewalls,
> assuming I might be down for an hour or so tweaking.
> oip and iip are static variables in rc.firewall but
> under DHCP oip is a moving target. Is there a recommended
> way to pass these to rc.firewall so a re-edit is not needed?
I just use a perl script (below), and use its output as the value for
$oip in rc.firewall
No doubt there's a better way of doing it, and it won't deal with
changes to your IP after you've booted (I know that won't happen in my
If you want to use it, then in rc.firewall put
(or whatever you call it)
and put the following in that file, changing $and chmod +x it
my $if = $ARGV || 'de0';
chomp (my $ifc = `ifconfig $if | grep inet | head -1`);
$ifc =~ /inet\s(\d+\.\d+\.\d+\.\d+)\s/;
More information about the freebsd-stable