1c524 [Solved] FreeBSD bridge problem - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Networking

Networking Network related discussions (including general TCP/IP stuff, routing, etc).

Reply
 
Thread Tools Display Modes
  #1  
Old November 26th, 2010, 17:50
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default FreeBSD bridge problem

Hi, I am trying to get bridging to work on a two interface system using the following commands:

Code:
ifconfig bridge create
ifconfig bridge0 addm em0 addm em1 up           #interface names are em0 and em1
The problem is the bridge passes arp requests, but not arp replies.

I have tried this this with 8.1 stable, and also Frenzy 1.1 and 1.3 all with the same result. What simple thing am I missing?

Thanks,
David.

Last edited by DutchDaemon; November 27th, 2010 at 00:10. Reason: proper formatting: http://forums.freebsd.org/showthread.php?t=8816
Reply With Quote
  #2  
Old November 26th, 2010, 21:24
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Are you setting em0 and em1 up?
Reply With Quote
  #3  
Old November 27th, 2010, 01:06
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes - setting them both up with ifconfig.
Reply With Quote
  #4  
Old November 27th, 2010, 01:09
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,854
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

Before or after the bridge is set up? Should be after. In terms of /etc/rc.conf it's usually something like this:

Code:
cloned_interfaces="bridge0"
ifconfig_bridge0="addm em0 addm em1 up"
ifconfig_em0="up" (can also be IP/netmask declaration)
ifconfig_em1="up" (idem)
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #5  
Old November 27th, 2010, 01:15
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

After the bridge is set up. I am doing it manually from the shell.
ie,
Code:
ifconfig em0 up
ifconfig em1 up

Last edited by DutchDaemon; November 27th, 2010 at 01:30.
Reply With Quote
  #6  
Old November 27th, 2010, 01:25
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,854
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

Post the output of ifconfig -a if you will.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #7  
Old November 27th, 2010, 02:36
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Output of "ifconfig -a" attached in zip file. Thanks.
Attached Files
File Type: zip screenshot.zip (7.8 KB, 55 views)
Reply With Quote
  #8  
Old November 27th, 2010, 02:49
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,854
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

I see you have pflog0. Does that mean you're filtering on the bridge or its members with pf? Use tcpdump(1) on the bridge and both interfaces to see where traffic flow stops exactly. If you are filtering, you may have to set a skip rule somewhere (maybe on bridge0).
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
mecano (July 24th, 2011)
  #9  
Old November 27th, 2010, 03:16
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

The topology is:

a<->b<->c

where b is the bridge, with interfaces em0 pointing to a, and em1 pointing to c.
b also has bridge interface bridge0
a has ip address 10.1.1.1 netmask 255.255.255.0 and b has ip address 10.1.1.2 netmask 255.255.255.0

When I ping from 10.1.1.1 (a) to 10.1.1.2 (c), the arp request goes from a to b to c. c responds with an arp reply. however none of b's interfaces (em1, bridge0, em0) see the arp reply - yet they all see the arp request. When I reversed the test ( ie ping from c to a) I got a similar result, namely, a's arp reply was not seen at b.

I am not explicitly using pf. I am not familiar with it. However the web site I was looking at was giving a recipe to use ipfw/dummynet in a bridge config, which is also my goal. But I have not yet got the bridge part working, so the ipfw rules are also not being used (beyond the a default which allows ip from any to any.
Reply With Quote
  #10  
Old November 27th, 2010, 03:22
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sorry typo - not
a has ip address 10.1.1.1 netmask 255.255.255.0 and b has ip address 10.1.1.2 netmask 255.255.255.0
but
a has ip address 10.1.1.1 netmask 255.255.255.0 and c has ip address 10.1.1.2 netmask 255.255.255.0
Reply With Quote
  #11  
Old November 27th, 2010, 03:46
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,854
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

I advise you to make absolutely sure that no package filter (pf, ipfw) is active in any way before the bridge part is actually proven to work at its most basic level (arp, icmp). Check e.g. kldstat -v | grep -i pf and disable pf/ipfw/pflog etc. before doing more tests. Just to get test results that are attributable to a single cause.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #12  
Old November 27th, 2010, 14:16
aragon aragon is offline
Giant Locked
 
Join Date: Nov 2008
Location: Cape Town, South Africa
Posts: 2,031
Thanks: 68
Thanked 253 Times in 203 Posts
Default

Perhaps also setup these sysctls to ensure bridge traffic doesn't hit a packet filter:

Code:
net.link.bridge.pfil_member=0
net.link.bridge.pfil_bridge=0
net.link.bridge.pfil_local_phys=0
Even if just to test.
Reply With Quote
  #13  
Old November 27th, 2010, 14:22
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for all the replies. I am making progress. I have it working now on VMware VMs. Problem was the default security settings on the VMs prevented MAC address substitution. When I get back to my office, I will try it and make it work on a physical machine. Will post on my progress.

Thanks,
David.
Reply With Quote
  #14  
Old November 30th, 2010, 02:55
david_shur david_shur is offline
Junior Member
 
Join Date: Nov 2010
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bridge (and dummynet) works fine on my dell laptop. The problem was with the virtual machines, which has been fixed as posted previously. Thanks again for the help.

Last edited by DutchDaemon; March 26th, 2011 at 23:16.
Reply With Quote
  #15  
Old March 26th, 2011, 22:54
dcorsello dcorsello is offline
Junior Member
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by david_shur View Post
Problem was the default security settings on the VMs prevented MAC address substitution.
Did you get this to work in your VMs? If so, how?
Reply With Quote
  #16  
Old July 24th, 2011, 10:04
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default

Quote:
Originally Posted by DutchDaemon View Post
I see you have pflog0. Does that mean you're filtering on the bridge or its members with pf? Use tcpdump(1) on the bridge and both interfaces to see where traffic flow stops exactly. If you are filtering, you may have to set a skip rule somewhere (maybe on bridge0).
DD, just to be sure I'm on the right track, in case of "IP replication" (where em0 has IP/netmask and em1 has just been "up"ed) wouldn't it be easier to filter bridge0 and skip on em0, em1 to avoid jabbers in pf.conf?
Reply With Quote
  #17  
Old July 24th, 2011, 23:33
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,854
Thanks: 30
Thanked 1,892 Times in 1,335 Posts
Default

It depends on where your traffic originates and where you want to stop unwanted traffic, and which interface local services (on the firewall, like a DNS resolver) are bound to. E.g. you might want to shield some services on the server from your LAN, but not your WAN, or vice versa. One usually blocks closest to the side one wants to defend. If there are no local services whatsoever on the firewall (it is a pure bridge), one might as well filter on bridge0 and leave em0/1 skip'ed.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Administrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
mecano (July 25th, 2011)
  #18  
Old July 25th, 2011, 16:31
mecano mecano is offline
Junior Member
 
Join Date: Feb 2009
Location: France
Posts: 89
Thanks: 23
Thanked 7 Times in 5 Posts
Default

Thanks DD! I wanted to be sure there wasn't any pitfall by skipping real interfaces.
Yes I'm thinking about DNS resolver and specific lan/wan filtering later to harden things (because transparent bridge firewalling is not an option here).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD 8 Wpa on Bridge mih3y Networking 0 March 4th, 2010 11:46
Bridge FreeBSD, PF and transparent squid ozanus Networking 2 January 25th, 2010 18:50
pppoe+adsl bridge+freebsd. javid Networking 3 June 9th, 2009 12:39
problem with bridge + ipfw Aidaho Firewalls 2 April 10th, 2009 09:50
Bridge networking to vm problem tim-m89 Networking 0 April 8th, 2009 07:52


All times are GMT +1. The time now is 09:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0