找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888广告投放联系QQ68610888
广告投放联系QQ68610888广告投放联系QQ68610888
查看: 924|回复: 0

[N1盒子] 大神们帮帮忙,Openwrt relayd 桥接eth0和wlan0无法通信问题

[复制链接]
50 币恩山币 回复本帖可获得 5 币恩山币奖励! 每人限 2 次
发表于 2024-9-20 15:13 | 显示全部楼层 |阅读模式
本帖最后由 syj0925 于 2024-9-21 00:15 编辑

硬件设备:N1盒子
操作系统:Armbian 20.10 Bullseye with Linux 5.9.0-arm-64
需求描述:把N1作为一个无线桥接器,N1的WiFi连接到路由器,N1的以太网口连接PC,为PC提供上网服务,PC、N1和路由器处于同一个局域网

设计方案:移植OpenWrtrelayd开源组件到N1盒子。运行relayd,命令:<relayd -I wlan0 -I eth0 -D -B -d -d>,把 eth0 wlan0 加入到realyd实现伪桥接。
  1. git clone https://git.openwrt.org/project/libubox.git     # relayd 依赖 libubox
  2. git clone https://git.openwrt.org/project/relayd.git       # 编译成功,生成可执行文件:relayd
复制代码
问题描述:WiFi连接到路由器,DHCP成功,运行"relayd -I wlan0 -i eth0 -D -B"后,PC DHCP成功,从路由器分配到IP地址,但是PC无法上网,ping <网关IP> 也失败。
问题分析:relayd的Log信息查看,ARP请求成功,但是PC又定期发起ARP请求,猜测是路由设置问题,导致eth0 没有转发到 wlan0。
以上,麻烦帮忙看下什么原因导致的无法上网,非常感谢!

relayd的部分Log信息:
MAC地址:

PC:        e8:6a:64:80:97:9b
eth0:     f2:d3:33:cd:c8:09
wlan0:   b8:27:eb:74:f2:6c
router:  90:de:80:91:a4:51

  1. $ ./relayd
  2. Usage: ./relayd <options>

  3. Options:
  4.         -d              Enable debug messages
  5.         -i <ifname>     Add an interface for relaying
  6.         -I <ifname>     Same as -i, except with ARP cache and host route management
  7.                         You need to specify at least two interfaces
  8.         -G <ip>         Set a gateway IP for clients
  9.         -R <gateway>:<net>/<mask>
  10.                         Add a static route for <net>/<mask> via <gateway>
  11.         -t <timeout>    Host entry expiry timeout
  12.         -p <tries>      Number of ARP ping attempts before considering a host dead
  13.         -T <table>      Set routing table number for automatically added routes
  14.         -B              Enable broadcast forwarding
  15.         -D              Enable DHCP forwarding
  16.         -P              Disable DHCP options parsing
  17.         -L <ipaddr>     Enable local access using <ipaddr> as source address
复制代码
eth0: ARP who-has 192.168.137.1, tell 192.168.137.24 (e8:6a:64:80:97:9b)
wlan0: sending ARP who-has 192.168.137.1, tell 192.168.137.24 (b8:27:eb:74:f2:6c)
wlan0: received ARP reply for 192.168.137.1 from 90:de:80:91:a4:51, deliver to 192.168.137.24
eth0: sending gratuitous ARP: 192.168.137.1 is at (f2:d3:33:cd:c8:09)
eth0: sending ARP reply to 192.168.137.24, 192.168.137.1 is at (f2:d3:33:cd:c8:09)

eth0: sending ARP who-has 192.168.137.24, tell 1.1.1.1 (f2:d3:33:cd:c8:09)
wlan0: sending ARP who-has 192.168.137.24, tell 192.168.137.47 (b8:27:eb:74:f2:6c)
eth0: received ARP reply for 192.168.137.24 from e8:6a:64:80:97:9b, deliver to 1.1.1.1
wlan0: sending gratuitous ARP: 192.168.137.24 is at (b8:27:eb:74:f2:6c)

eth0: ARP who-has 192.168.137.1, tell 192.168.137.24 (e8:6a:64:80:97:9b)
wlan0: sending ARP who-has 192.168.137.1, tell 192.168.137.24 (b8:27:eb:74:f2:6c)
wlan0: received ARP reply for 192.168.137.1 from 90:de:80:91:a4:51, deliver to 192.168.137.24
eth0: sending gratuitous ARP: 192.168.137.1 is at (f2:d3:33:cd:c8:09)
eth0: sending ARP reply to 192.168.137.24, 192.168.137.1 is at (f2:d3:33:cd:c8:09)

eth0: ARP who-has 192.168.137.1, tell 192.168.137.24 (e8:6a:64:80:97:9b)
wlan0: sending ARP who-has 192.168.137.1, tell 192.168.137.24 (b8:27:eb:74:f2:6c)
wlan0: received ARP reply for 192.168.137.1 from 90:de:80:91:a4:51, deliver to 192.168.137.24
eth0: sending gratuitous ARP: 192.168.137.1 is at (f2:d3:33:cd:c8:09)
eth0: sending ARP reply to 192.168.137.24, 192.168.137.1 is at (f2:d3:33:cd:c8:09)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
只谈技术、莫论政事!(点击见详情) | 互相尊重、友善交流、切勿过度反应、玻璃心。胡乱输入灌水等操作将会被封禁ID。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /2 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2026-8-23 20:16

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 电话:13506125623

快速回复 返回顶部 返回列表