Re: confusion with the pf filter rule syntax

From: Marco S Hyman (marc_at_snafu.org)
Date: 11/24/03


Date: 24 Nov 2003 13:36:51 -0800


"Sameer" <ssnewsgroups@hotmail.com> writes:

> i'm a bit confused here. personally, i'm having issue with this "on int"
> and "from src_addr". to me this seems to be a redundancy, and, not matter
> how i tried to read it, i really can't see otherwise.

Assume le0 is an interface on a web server. I expect to receive
packets from the entire world on that interface, i.e packets with all
possible source addresses. Further assume it is directly connected
to the internet. That means I'd only expect to receive packets with
routable source addresses. To filter unroutable addresses I might
do something like:

        block in on le0 inet from 10.0.0.0/8 to any

Syntactically the "on le0" isn't required. If left off it will block
packets with a source of 10.0.0.0/8 regardless of the interface.
But now assume interface le1 is an internal network using net 10. I
don't want to block from 10.0.0.0/8 on that interface, just le0. The
above rule does just that.

Does that help? Or did I misunderstand the question?

// marc



Relevant Pages

  • [UPDATE] Possible solaris 8 use dynamic ip address ?
    ... configuring IPv4 interfaces: le0 qfe0. ... starting DHCP on primary interface le0 ... starting rpc services: rpcbind done. ... Setting default IPv4 interface for multicast: add net 224.0/4: gateway psi ...
    (SunManagers)
  • bridge issues with pf rules on OpenBSD/Sparc
    ... I bridge two interfaces, wherein one interface has an IP address ... bridging causes pf to mis-apply frames to the wrong interface. ... @4 pass out log-all quick on le0 all ... packets that TRAVERSE the router from one host on le0 to another on le2, ...
    (comp.unix.bsd.openbsd.misc)
  • Re: if_le unit number change?
    ... recent update of 8-current changed the unit number of the virtual network ... interface name mismatching that in rc.conf. ... I think the reason is that since r185059 the isahints (in this ... case the default one for le0) are now also applied to acpi. ...
    (freebsd-current)
  • Re: Why cant ping
    ... This is your interface - le0. ... inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 ...
    (freebsd-questions)
  • Terminal Server Setup
    ... description GRE Tunnel Source Interface ... input packets with dribble condition detected ... output buffer failures, ... Serial1/0 is up, line protocol is up ...
    (comp.dcom.sys.cisco)