Bananian

Bananian not switching eth ports

5 3736
Edited by nerdyscout at Mon Mar 30, 2015 12:52

Hi guys,

a few weeks ago I bought my BPI-R1 and I am quit happy... it took me quit long to install all packages I wanted and everything is just fine now. But unfortunately I noticed the board does not switch any longer between the 4 ethernet ports. I don't know if I crashed this function during my installations or if it never worked.
I use my ISPs router as DHCPServer, the BPI-R1 is dhcp client and gets its IP. Devices connected to to BPI-R1 can not connect to the Internet, as they don't see the router they never get an ip.

A very long time i tried to setup wifi in AP+Bridge mode, compiled my own hostapd, tried different drivers, played a bit with vlan.... now it is fine, but most likey while trying the portswitching broke appart.
Do you have any idea how I can fix it?

All instructions I found so far explain switching via vlan which seems dump as hardwareswichting should be more performant. Other instructions explain a configuration as router with different networks what I don't want.


regards
nerdysout

using: Bananian 15.01 r01
  1. Linux router 3.4.104+ #1 SMP PREEMPT Thu Jan 8 15:40:40 CET 2015 armv7l GNU/Linux
Copy the Code
/etc/network/interfaces

  1. auto lo
  2. iface lo inet loopback
  3. iface default inet dhcp

  4. # eth0 dynamic connection
  5. auto eth0
  6. allow-hotplug eth0
  7. iface eth0 inet dhcp

  8. # WLAN Interface
  9. auto wlan0
  10. allow-hotplug wlan0
  11. iface wlan0 inet dhcp

  12. # Bridge
  13. auto br0
  14. iface br0 inet dhcp
  15. bridge_ports eth0 wlan0
  16. bridge_fd 0
  17. bridge_stp no
Copy the Code
/etc/hostapd/hostapd.conf
  1. ctrl_interface=/var/run/hostapd
  2. ctrl_interface_group=0
  3. macaddr_acl=0
  4. auth_algs=3
  5. ignore_broadcast_ssid=0
  6. # 802.11n related stuff
  7. #ieee80211n=1
  8. #ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40]
  9. #WPA2 settings
  10. wpa=2
  11. wpa_key_mgmt=WPA-PSK
  12. wpa_pairwise=TKIP
  13. rsn_pairwise=CCMP
  14. # CHANGE THE PASSPHRASE
  15. wpa_passphrase=xxx
  16. # Most modern wireless drivers in the kernel need driver=nl80211
  17. #driver=nl80211
  18. driver=rtl871xdrv
  19. max_num_sta=8
  20. beacon_int=100
  21. wme_enabled=1
  22. wpa_group_rekey=86400
  23. device_name=RTL8192CU
  24. manufacturer=Realtek
  25. # set proper interface
  26. interface=wlan0
  27. bridge=br0
  28. hw_mode=g
  29. # best channels are 1 6 11 14 (scan networks first to find which slot is free)
  30. channel=6
  31. # this is the network name
  32. ssid=SSID
Copy the Code
Are you edit your /etc/network/if-pre-up.d/swconfig file and comment the "exit 0" line ?

Tido  
Edited by Tido at Tue Mar 31, 2015 06:59

The BPi-R1 is a special version in the family of Banana's and to make use of its router functionality you have to configure this first.

The A20's uses the BCM53125 as PHY so physically SoC and all 5 external PHYs are interconnected through a simple switch.
Switch port 0, 1, 2 and 4 will be the LAN, port 3 the WAN. This needs SWCONFIG

Therefore you have to create a virtual-LAN (VLAN) and a bridge (br0) to connect the VLAN's.
more information here: manual for the setup

/etc/network/if-pre-up.d/swconfig
  1. #!/bin/sh

  2. #---------------------------#
  3. # BPI-R1 VLAN configuration #
  4. #---------------------------#
  5. #
  6. # This will create the following ethernet ports:
  7. # - eth0.101 = WAN (single port)
  8. # - eth0.102 = LAN (4 port switch)
  9. #
  10. # You have to adjust your /etc/network/interfaces
  11. #
  12. # Comment out the next line to enable the VLAN configuration:
  13. exit 0

  14. ifconfig eth0 up

  15. # The swconfig port number are:
  16. # |2|1|0|4|  |3|
  17. # (looking at front of ports)

  18. swconfig dev eth0 set reset 1
  19. swconfig dev eth0 set enable_vlan 1
  20. swconfig dev eth0 vlan 101 set ports '3 8t'
  21. swconfig dev eth0 vlan 102 set ports '4 0 1 2 8t'
  22. swconfig dev eth0 set apply 1
Copy the Code
As far as I understand this is ok. The file will not be parsed.

@Tido: I think you did understand me wrong: I would like to have the default switching function, therefore I do NOT create vlan.
I just don't understand what happend why my board doesn't switch (anymore).

you need to comment the "exit 0" line otherwise the script stops at this line

THANK YOU melursus!
this did it, I just dont understand why. All the time I suspected i have not to configure vlan.

Anyway... perfect... now I just have to figure out why the bpi-r1 doest not get an IP assigned anymore.

You have to log in before you can reply Login | Sign Up

Points Rules