Bananian

Setting up wlan0 as an access point in BPI-R1

43 20554
schasch  
Edited by schasch at Wed Apr 15, 2015 08:20

hi and thanks for the link,

but this doen't solve my problem.
(https://docs.google.com/document ... Arf_TZA/edit?pli=1#)
auto lo br0
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
iface br0 inet dhcp
   bridge_ports eth0 wlan0
   bridge_waitport 0

and...
those iptable -rules don't work too,

I want to use my R1 without DHCP-Server and VLAN.
Only an Access-Point for WLAN-Clients with integrated eth-switch for eth-clients.
I want to replace an old second router only used as  Wlan-AP with and with using an other
router(with dhcp-server) in my homenetwork does the router-stuff.


Everything worked in my previous config, only the connected eth-clients are not reachable/pingable outside my R1...


any ideas?
I think it is just an iptable-problem, but I tried 1000's of rules...
;-(

Tido  
Edited by Tido at Wed Apr 15, 2015 20:32

This document is not your solution, obviously, but I shall give you hints.
Look at the slide to understand the technic and SW. Also read in the document the 'Information'.

Delete all your IPtables, your router should take care for that.
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -t raw -F
iptables -t raw -X

schasch  
Edited by schasch at Thu Apr 16, 2015 02:48

Hi Tido,

thanks for help,
...but cleaning th tables doesn't help too...
Like I wrote, my wlan client works perfectly as it schoul be,
but connected eth-clients don't get out of the router
and can't be ping'd outside the router...
I tested connecting the external network to the  4port-switch and to the single-on...

ifconfig
br0       Link encap:Ethernet  HWaddr 02:xyz::09  
          inet addr:10.1.6.19  Bcast:10.1.255.255  Mask:255.255.0.0
          inet6 addr: fb40::44yxvbnm34 Scopeink
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12307 errors:0 dropped:0 overruns:0 frame:0
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:863360 (843.1 KiB)  TX bytes:20031 (19.5 KiB)

eth0      Link encap:Ethernet  HWaddr 02:xyz::09  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14471 errors:0 dropped:0 overruns:0 frame:0
          TX packets:436 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1313861 (1.2 MiB)  TX bytes:54376 (53.1 KiB)
          Interrupt:117 Base address:0xc000

lo        Link encapocal Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:740 (740.0 B)  TX bytes:740 (740.0 B)

wlan0     Link encap:Ethernet  HWaddr 02:xyzxy::09  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:428 errors:0 dropped:2 overruns:0 frame:0
          TX packets:11897 errors:0 dropped:7 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:40427 (39.4 KiB)  TX bytes:1365545 (1.3 MiB)


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

#---------------------------#
# 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:
exit 0

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 1
swconfig dev eth0 vlan 101 set ports '3 8t'
swconfig dev eth0 vlan 102 set ports '4 0 1 2 8t'
swconfig dev eth0 set apply 1

unfortunately I#m totally new to vlan, iptables,.... and all
pi-tutorials do not have integrated switches
:-(

Tido  
you should have as minimal settings as possible, so delete IPtables. Do it !

Try this for interfaces:

auto lo eth0 wlan0
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp

schasch  
Edited by schasch at Thu Apr 16, 2015 07:59

Hi,
I deleted everytime all tableslike you showed me  and tested with cleaned and after cleaning with  1000's of variations....

I just again deleted, tested with your interfaces and build an exit to the /etc/network/if-pre-up.d/swconfig
can't get it to work as an simple AP-with_eth_switch to work with another router in network.
did yo realize  it? maybe it should be in you docs?
interfaces,swconfig,iptables...

I think this is maybe  the same problem:
Create a switch and bridge ports on BPI-R1 :
http://forum.lemaker.org/forum.p ... amp;page=1#pid65352
with this config I can get to my eth-clients, but not to the R1 itselfs  anymore
;-(

igorpec  
This is my config and it's working just fine. Not that wlan in this configuration is bridged to "wan" ...
  1. auto lo
  2. iface lo inet loopback

  3. auto eth0.101
  4. iface eth0.101 inet manual
  5.     pre-up swconfig dev eth0 set reset 1
  6.     pre-up swconfig dev eth0 set enable_vlan 1
  7.     pre-up swconfig dev eth0 vlan 101 set ports '3 8t'
  8.     pre-up swconfig dev eth0 set apply 1

  9. auto eth0.102
  10. iface eth0.102 inet manual
  11.     pre-up swconfig dev eth0 vlan 102 set ports '0 1 2 4 8t'
  12.     pre-up swconfig dev eth0 set apply 1

  13. allow-hotplug wlan0
  14. iface wlan0 inet manual

  15. auto br0
  16. iface br0 inet dhcp
  17. bridge_ports eth0.101 wlan0
Copy the Code

schasch  
Edited by schasch at Mon Apr 20, 2015 03:51

Hi igorpec,

this interfaces-config works for my wlan-eth-AP used with other main-router in my network!
I only had to change the bridged ports to get to the 4-port-switch-devices::
  bridge_ports eth0.101 eth0.102 wlan0

thanks!!!

schasch replied at Mon Apr 20, 2015 03:50
Hi igorpec,

this interfaces-config works for my wlan-eth-AP used with other main-router in my netwo ...

Thanks a lot for the effort and help provided by you folks.
I used the information (especially manual) to make my installation running finally
  
Wifi works with following 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. # Most modern wireless drivers in the kernel need driver=nl80211
  7. #driver=nl80211
  8. driver=rtl871xdrv
  9. max_num_sta=8
  10. beacon_int=100
  11. wpa_group_rekey=86400
  12. device_name=RTL8192CU
  13. manufacturer=Realtek


  14. # set proper interface
  15. interface=wlan0
  16. bridge=br0
  17. hw_mode=g
  18. # best channels are 1 6 11 14 (scan networks first to find which slot is free)
  19. channel=3
  20. # this is the network name
  21. ssid=BPI-R1

  22. # 802.11n related stuff
  23. #ieee80211n=1
  24. ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40]
  25. wme_enabled=1

  26. ### adjut to fit your location
  27. country_code=AT
  28. # let your AP briadcast the settings that agree with the above-mentioned regulatory requirements per country
  29. ieee80211d=1

  30. #WPA2 settings
  31. wpa=2
  32. wpa_key_mgmt=WPA-PSK
  33. wpa_pairwise=CCMP
  34. wpa_passphrase=testtest

  35. #  debugging output - uncomment them to activate; issue  hostapd -d /etc/hostapd/hostapd.conf
  36. #  to get debugging info in visible/real-time form
  37. #logger_syslog=-1
  38. #logger_syslog_level=2
  39. #logger_stdout=-1
  40. #logger_stdout_level=2
Copy the Code
Problem: Wlan is working in g-mode only. --> #ieee80211n=1   is a must. Network is stable (much better than with Openwrt)
With activ line (= without # at the begining, the daemon is not starting.
Any idea?
Harry

Tido  
Edited by Tido at Tue Apr 21, 2015 20:33

Hi Harry,

I don't want to make it complicated but,

follow 15.01 manual, go to section 'hostapd'  read carefully, make changes to your config file /etc/init.d/hostapd - at the moment it works with reboot.
ieee80211n=1

Keep reading to   Boot order control   that is needed as well.  Then...

For the     nano /etc/hostapd/hostapd.conf    Go To choose hostapd 02 - Quick_Start_Guide_for_SoftAP.doc

I am using right now Jens Segers   hostapd hostapd_cli and the RealTek v4.0.2 driver.

let me know if you had success.

Tido replied at Wed Apr 15, 2015 05:44
Yes, try this

http://forum.lemaker.org/forum.php?mod=viewthread&tid=13877&fromuid=72927

Hi!

Thanks Tido for his advice. In the meantime BPR1 is working as WLAN client, router and axcess point (port3 is connection to the rest of the intranet).
Results basd on manual in google docs - great work.
Only ieee80211n=1 is not working. hostapd is working only if this line is just a comment.
But I will continue with your next advice in http://forum.lemaker.org/forum.p ... 7&fromuid=72927
Greetings
Harry

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

Points Rules