From owner-freebsd-security Fri Oct 13 4:34:49 2000 Delivered-To: freebsd-security@freebsd.org Received: from mail2.cinci.rr.com (fe2.rdc-kc.rr.com [24.94.163.49]) by hub.freebsd.org (Postfix) with ESMTP id 46C2B37B502 for ; Fri, 13 Oct 2000 04:34:46 -0700 (PDT) Received: from kilimanjaro ([24.29.15.94]) by mail2.cinci.rr.com with Microsoft SMTPSVC(5.5.1877.357.35); Fri, 13 Oct 2000 06:34:41 -0500 Message-Id: <3.0.5.32.20001013073440.009093f0@pop-server.cinci.rr.com> X-Sender: mbloom@pop-server.cinci.rr.com X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Fri, 13 Oct 2000 07:34:40 -0400 To: Peter Pentchev From: Milo Bloom Subject: Re: Dynamic rc.firewall Cc: redwards@meccamediagroup.com, freebsd-security@FreeBSD.ORG 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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