Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2000 07:34:40 -0400
From:      Milo Bloom <mbloom@cinci.rr.com>
To:        Peter Pentchev <roam@orbitel.bg>
Cc:        redwards@meccamediagroup.com, freebsd-security@FreeBSD.ORG
Subject:   Re: Dynamic rc.firewall
Message-ID:  <3.0.5.32.20001013073440.009093f0@pop-server.cinci.rr.com>
In-Reply-To: <20001013132743.B17444@ringwraith.office1.bg>
References:  <20001013131528.A17444@ringwraith.office1.bg> <5.0.0.25.2.20001013032255.00a8ee40@127.0.0.1> <20001013131528.A17444@ringwraith.office1.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
At 01:27 PM 10/13/00 +0300, you wrote:
>On Fri, Oct 13, 2000 at 01:15:28PM +0300, Peter Pentchev wrote:
>[snip]
>> 
>> Actually, this just made me think of a way better solution.  In a Bourne
>> shell, you just do..
>> 
>> [roam@ringwraith /etc]$ set `ifconfig | fgrep -w inet`; outaddr=$2;
outmask=$4; outbcast = $6
>> 
>> Yes, it really is that easy :)
>
>..except it doesn't necessarily work :)  Don't you just love this feeling -
>spotting an error in something you just mailed out to God knows how many
>people :)
>
>ifconfig | fgrep -w inet  returns the 'inet' line for ALL configured
>interfaces; set `...` shall only use the first line, which in my case
>just happened to be the xl0 iface..
>
>set `ifconfig xl0 | fgrep -w inet`; outaddr="$2"; outmask="$4"; outbcast="$6"
>
>..is a much better solution.
>
>G'luck,
>Peter
>
>-- 
>What would this sentence be like if pi were 3?

What?!? I actually have something to say?!? Something (hopefully) useful?!?

Anyway, here's what I've done, which works with my cable modem setup using
DHCP. Now, I don't reboot much, but it has always worked whenever it parses
the file, and their lease period is 4 hours, which means it automatically
renews the lease every two hours, but it has worked for me. [And if _I_
figured it out, then I figured _everyone_ knew how to do it!!!]

Here's my lines in rc.firewall:

    # set these to your outside interface network and netmask and ip
    oif="ex0"                # card name
    onet="24.129.15.0"       # whatever your assigned range will be
    omask="255.255.255.0"
    oip="`ifconfig ex0 | grep inet | awk '{ print $2 }'`"

Hope this helps. Let me (or the list) know how that works for you.

Dan
---------------------------------------------------------------------
God is real - unless declared integer.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20001013073440.009093f0>