使用 batman-adv 协议在 Raspberry Pi 上进行无线网状网络 [英] Wireless mesh networking on Raspberry Pi using batman-adv protocol

查看:18
本文介绍了使用 batman-adv 协议在 Raspberry Pi 上进行无线网状网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在尝试使用 Raspberry Pi 和 Edimax EW-7811Un WLAN 适配器和 batman-adv 协议设置无线网状网络.

我已尝试遵循以下来源的基本设置指南:

不幸的是,当我需要从另一个节点 ping 一个节点时,我得到 <块引用>

目标主机无法访问.

运行 batctl o 命令显示

<块引用>

'范围内没有蝙蝠侠节点'

但是,当运行 iwconfig 时,两个节点似乎都与我设置的网络相关联,而当运行 iwlist wlan0 scan 时,我设置的网络在两个节点上都显示为单元格.

我现在不知该如何进行.我已经阅读了一些关于 Linux WLAN 适配器驱动程序的临时支持问题的文章.我的适配器使用的是 RTL8192CU 驱动程序.这可能是问题的原因吗?

附言我查看了以下帖子,但不幸的是,这没有帮助.>

/etc/network/interfaces的内容:

两个当前设置的节点具有相同的内容:

auto loiface lo inet环回iface eth0 inet dhcp允许热插拔 wlan0iface wlan0 inet 手册wpa-roam/etc/wpa_supplicant/wpa_supplicant.confiface 默认 inet dhcp

两个节点的/etc/wpa_supplicant/wpa_supplicant.conf的内容:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev更新配置=1

ifconfigiwconfig 和两个节点的路由:

节点 1

ifconfigwlan0 链路封装:以太网 HWaddr 80:1f:02:9b:bc:6cinet 地址:192.168.2.1 广播:192.168.2.255 掩码:255.255.255.0上行广播运行多播 MTU:1500 公制:1RX 数据包:0 错误:0 丢弃:1 溢出:0 帧:0TX 数据包:0 错误:0 丢弃:0 超限:0 载波:0碰撞:0 txqueuelen:1000RX 字节:0 (0.0 B) TX 字节:0 (0.0 B)配置文件wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" 昵称:"<WIFI@REALTEK>"模式:Ad-Hoc 频率:2.412 GHz Cell:02:11:87:A1:CD:FF比特率:54 Mb/s 灵敏度:0/0Retry:off RTS thr:off 片段 thr:off加密密钥:关闭电源管理:关闭链路质量=2/100 信号电平=2/100 噪声电平=0/100Rx 无效 nwid:0 Rx 无效 crypt:0 Rx 无效 frag:0Tx 重试次数过多:0 无效的 misc:0 错过的信标:0路线内核IP路由表目标网关 Genmask Flags Metric Ref Use Iface192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0

节点 2

ifconfigwlan0 链接封装:以太网 HWaddr 80:1f:02:da:2e:eeinet 地址:192.168.2.3 广播:192.168.2.255 掩码:255.255.255.0上行广播运行多播 MTU:1500 公制:1RX 数据包:0 错误:0 丢弃:0 溢出:0 帧:0TX 数据包:6 错误:0 丢弃:0 超限:0 载波:0碰撞:0 txqueuelen:1000RX 字节:0 (0.0 B) TX 字节:0 (0.0 B)配置文件wlan0 IEEE 802.11bg ESSID:"pi-ad-hoc" 昵称:"<WIFI@REALTEK>"模式:Ad-Hoc 频率:2.412 GHz Cell:02:11:87:2F:D6:FF比特率:54 Mb/s 灵敏度:0/0Retry:off RTS thr:off 片段 thr:off加密密钥:关闭电源管理:关闭链路质量=2/100 信号电平=2/100 噪声电平=0/100Rx 无效 nwid:0 Rx 无效 crypt:0 Rx 无效 frag:0Tx 重试次数过多:0 无效的 misc:0 错过的信标:0路线内核IP路由表目标网关 Genmask Flags Metric Ref Use Iface192.168.2.0 * 255.255.255.0 U 0 0 0 wlan0

解决方案

我刚刚在 Raspbian 上用两个 Raspberries 和相同的 Wifi 适配器 (Edimax EW-7811Un) 检查了您的配置.长话短说:我得到的结果和你一样.

我的发现如下

  1. 按照描述为临时设置一个 Raspberry 并从 iPad 或 Notebook 连接...工作正常
  2. 在 Notebook 上创建临时连接并让一个 Raspberry 加入...工作正常
  3. 为接入点设置一个 Raspbery 并从 iPad 或 Notebook 连接...工作正常
  4. 但是,当在 adhoc 模式或接入点模式下设置两个树莓派时,它们无法相互连接......不起作用!
  5. 正如您通过此来源发现的此处这些适配器的可用模式 (rtl8192cu) 不清楚.
  6. 其他来源使用类似的设置和其他 wifi 适配器(如所述)轻松创建临时连接.

适配器驱动程序似乎不允许这种连接.

请注意:使用这些适配器设置接入点需要特殊编译的 hostapd:阅读此处了解如何

So I'm trying to setup a wireless mesh network using Raspberry Pi's, with the Edimax EW-7811Un WLAN Adapter and the batman-adv protocol.

I've tried following the basic setup guides from:

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

  1. Setting up one Raspberry for adhoc as described and connecting from IPad or Notebook ... works fine
  2. Creating an adhoc connection on the Notebook and let one Raspberry join ... works fine
  3. Setting up one Raspbery for accesspoint and connecting from IPad or Notebook ... works fine
  4. However when setting up two Raspberries either in adhoc mode or accesspoint mode wont connect to each other ... doesnt work!
  5. As you figured out by this source here the available modes of these adapters (rtl8192cu) are unclear.
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆