使用batman-adv协议在Raspberry Pi上进行无线网状网络 [英] Wireless mesh networking on Raspberry Pi using batman-adv protocol
问题描述
因此,我正在尝试使用Raspberry Pi的Edimax EW-7811Un WLAN适配器和batman-adv协议来建立无线网状网络.
我尝试遵循以下基本设置指南:
- http://www.open-mesh .org/projects/batman-adv/wiki/Quick-start-guide
- http://mindofdes.blogspot .co.uk/2013/02/raspberry-pi-raspbian-wireless-and.html
不幸的是,当我到达需要从另一个节点ping一个节点的位置时,我得到了
无法访问目标主机.
运行batctl o
命令显示
范围内没有蝙蝠侠节点"
但是,当运行iwconfig
时,两个节点似乎都与我已设置的网络相关联,而当运行iwlist wlan0 scan
时,我已设置的网络在这两个节点上均显示为单元格.
我现在对如何进行一无所知.我已经阅读了一些有关Linux WLAN适配器驱动程序的临时支持问题的文章.我的适配器正在使用RTL8192CU驱动程序.这可能是问题的原因吗?
P.S.我看过以下帖子,但不幸的是,这没有帮助.>
/etc/network/interfaces
的内容:
两个当前设置的节点具有相同的内容:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
两个节点的/etc/wpa_supplicant/wpa_supplicant.conf
内容:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ifconfig
,iwconfig
和两个节点的路由:
节点1
ifconfig
wlan0 Link encap: Ethernet HWaddr 80:1f:02:9b:bc:6c
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:1 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes: 0 (0.0 B)
iwconfig
wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" Nickname:"<WIFI@REALTEK>"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 02:11:87:A1:CD:FF
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=2/100 Signal level=2/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0
节点2
ifconfig
wlan0 Link encap:Ethernet HWaddr 80:1f:02:da:2e:ee
inet addr:192.168.2.3 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
iwconfig
wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" Nickname:"<WIFI@REALTEK>"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 02:11:87:2F:D6:FF
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=2/100 Signal level=2/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0
我刚刚在Raspbian上使用两个Raspberry和相同的Wifi适配器(Edimax EW-7811Un)检查了您的配置.长话短说:我得到的结果与您相同.
我的发现如下
- 按照上述说明为adhoc设置一个Raspberry,并从iPad或Notebook ...连接正常
- 在Notebook上创建临时连接并让一个Raspberry加入...可以正常工作
- 为接入点设置一个Raspbery并从iPad或Notebook连接...可以正常工作
- 但是,在临时模式或访问点模式下设置两个Raspberry时,它们将无法彼此连接...不起作用!
- 如您所见,此处这些适配器的可用模式(rtl8192cu )不清楚.
- 其他来源可以通过类似的设置和上述的其他wifi adpater轻松创建临时连接.
似乎适配器驱动程序不允许这种连接.
请注意:使用这些适配器设置访问点需要特殊的已编译hostapd:http://www.open-mesh.org/projects/batman-adv/wiki/Quick-start-guide
Unfortunately, when I get to the point where I need to ping one node from the other, I get
Destination Host Unreachable.
Running the batctl o
command displays
'no batman nodes in range'
However, when running iwconfig
, both nodes appear to be associated with the network I've setup, and when running iwlist wlan0 scan
, the network I've setup appear as cells on both nodes.
I'm now at a loss as to how to proceed. I have read some articles on issues with ad-hoc support for Linux WLAN adapter drivers. My adapter is using the RTL8192CU driver. Could this be the cause of the issue?
P.S. I have looked at the following post, but this was no help, unfortunately.
Edit: contents of /etc/network/interfaces
:
Both currently setup nodes have the same contents:
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
Edit: contents of /etc/wpa_supplicant/wpa_supplicant.conf
for both nodes:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
Edit: ifconfig
, iwconfig
, and route for both nodes:
Node 1
ifconfig
wlan0 Link encap: Ethernet HWaddr 80:1f:02:9b:bc:6c
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:1 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes: 0 (0.0 B)
iwconfig
wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" Nickname:"<WIFI@REALTEK>"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 02:11:87:A1:CD:FF
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=2/100 Signal level=2/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0
Node 2
ifconfig
wlan0 Link encap:Ethernet HWaddr 80:1f:02:da:2e:ee
inet addr:192.168.2.3 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
iwconfig
wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" Nickname:"<WIFI@REALTEK>"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 02:11:87:2F:D6:FF
Bit Rate:54 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=2/100 Signal level=2/100 Noise level=0/100
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0
I just checked your configuration with two Raspberries and the same Wifi Adapters (Edimax EW-7811Un) on Raspbian. Long story short: I get the same results as you do.
My findings are as follows
- Setting up one Raspberry for adhoc as described and connecting from IPad or Notebook ... works fine
- Creating an adhoc connection on the Notebook and let one Raspberry join ... works fine
- Setting up one Raspbery for accesspoint and connecting from IPad or Notebook ... works fine
- However when setting up two Raspberries either in adhoc mode or accesspoint mode wont connect to each other ... doesnt work!
- As you figured out by this source here the available modes of these adapters (rtl8192cu) are unclear.
- Other sources create adhoc connections easily with similar setup and other wifi adpater like described.
It pretty much seems like the adapters drivers won't allow this connection.
Please note: setting up an accesspoint with these adapters requires a special compiled hostapd: read here to find out how
这篇关于使用batman-adv协议在Raspberry Pi上进行无线网状网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!