Bug 176503 - [ipfw] ipfw layer2 problem
Summary: [ipfw] ipfw layer2 problem
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-28 14:10 UTC by Robert Heron
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Heron 2013-02-28 14:10:00 UTC
I use ipfw firewall with settings:

In Kernel:
options IPDIVERT
options IPFIREWALL
options IPFIREWALL_FORWARD

sysctl:
net.inet.ip.forwarding=1
net.link.ether.ipfw=1

The problem:

I have a rule in my firewall: 

1000 allow ip from any to any layer2 in MAC any any

and when an incoming packet matches this rule it is passed further to the next rule.
'ipfw show' shows, that the packet was matched by this rule and then passed to the next rule.
As described in 'man ipfw' the packet should be accepted by this rule and the search should be terminated, but this doesn't happen.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-02-28 14:10:39 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-ipfw

Over to maintainer(s).
Comment 2 Ian Smith 2013-06-18 16:34:58 UTC
  > net.link.ether.ipfw=1

  > 1000 allow ip from any to any layer2 in MAC any any

You don't show the next rule mentioned, but with net.link.ether.ipfw=1 
(and not bridging) the packet traverses the ruleset up to four times. 
Your rule 1000 accepts the packet when invoked from ether_demux.  When 
the packet (thus) gets to ip(6)_input the ruleset is run again at layer 
3 (IP), which rule 1000 does not match.  It may match any next rule that 
is not explicitly layer2.  You'll similarly need to pass layer2 packets 
going 'out', after passing them at layer3.

man ipfw
/PACKET FLOW

cheers, Ian
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:58:53 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped