Can anybody tell me how to create a switch between all five ports on a BPI-R1 and bridge them?
Basically, I want devices on any of the 5 ports to be able to connect to each other on the same network and I need to be able to sniff all traffic between them.
I was able to make the BPI-R1 communicate with the network using any port by using the following if-pre-up swconfig script:
root@appliance:~# cat /etc/network/if-pre-up.d/swconfig
# BPI-R1 VLAN configuration #
# This will create the following ethernet ports:
# - eth0.101 = WAN (single port)
# - eth0.102 = LAN (4 port switch)
# You have to adjust your /etc/network/interfaces
# Comment out the next line to enable the VLAN configuration:
ifconfig eth0 up
# The swconfig port number are:
# |2|1|0|4| |3|
# (looking at front of ports)
swconfig dev eth0 set reset 1
swconfig dev eth0 set enable_vlan 0
swconfig dev eth0 port 0 set pvid 0
swconfig dev eth0 port 1 set pvid 0
swconfig dev eth0 port 2 set pvid 0
swconfig dev eth0 port 3 set pvid 0
swconfig dev eth0 port 4 set pvid 0
swconfig dev eth0 set apply 1
I can connect to any port and eth0 is, apparently, able to communicate just fine.
What I now want to do is be able to get traffic from one port to flow to the other ones (e.g. if there's a cable coming from my network connecting to port 0 on the BPI-R1, I want devices connected to port 1 on the BPI-R1 to be able to connect to that network too).
In other words, if one of the devices hooked to one of the ports is answering dhcp replies, I expect dhcp requests from the other ports to be forwarded so the devices can get a dynamic ip address.
I assumed that, now that I have all ports switched, I should be able to create a bridge between all the ports.
brctl addbr br0
brctl addif br0 eth0.1
brctl addif br0 eth1.2
But I can't get dedicated access to each of the ports on eth0...
Any thoughts on how I do what I need? This is my first time using a multi port NIC so I'm really lost here \