【问题标题】:Bridging two wireless interfaces with openwrt (LEDE)使用 openwrt (LEDE) 桥接两个无线接口
【发布时间】:2018-03-01 19:58:31
【问题描述】:

AP:AP121U(阿尔法) 外接 Wifi 卡:AR9271 (ALFA)

我正在尝试设置 wifi 扩展。 但是我现在被困住了: 设法将内部 Wifi 放入 Master(wlan0) 并将外部放入连接到我要重复的网络的 Client-mode(wlan1)。

setup:

wlan0 (router): Mastermode with dhcp server 192.168.44.1

wlan1 (external card): dhcpclientmode 192.168.0.19

两者都在工作并已连接。路由器有互联网连接。 kmod-ath0k_btc 模块已安装并正在运行。

我是通过SerialUSB + MasterWIFI (internal-ap)连接到路由器的。

root@LEDE:/# ifconfig
eth1      Link encap:Ethernet  HWaddr 00:C0:CA:6F:01:14  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 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)
          Interrupt:4 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:88 errors:0 dropped:0 overruns:0 frame:0
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:7415 (7.2 KiB)  TX bytes:7415 (7.2 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:C0:CA:6F:01:16  
          inet addr:192.168.44.1  Bcast:192.168.44.255  Mask:255.255.255.0
          inet6 addr: fe80::2c0:caff:fe6f:116/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8185 errors:0 dropped:0 overruns:0 frame:0
          TX packets:635 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:664774 (649.1 KiB)  TX bytes:206006 (201.1 KiB)

wlan1     Link encap:Ethernet  HWaddr 00:C0:CA:72:67:A2  
          inet addr:192.168.0.19  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::2c0:caff:fe72:67a2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7004 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:154433 (150.8 KiB)  TX bytes:686873 (670.7 KiB)

root@LEDE:/# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=57 time=16.095 ms
64 bytes from 8.8.8.8: seq=1 ttl=57 time=14.629 ms
64 bytes from 8.8.8.8: seq=2 ttl=57 time=15.680 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 14.629/15.468/16.095 ms


round-trip min/avg/max = 14.629/15.468/16.095 ms

root@LEDE:/# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdb8:507a:4e00::/48'

config interface 'lan'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option auto '0'

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth1'
        option proto 'dhcpv6'

config interface 'master'
        option _orig_ifname 'wlan0'
        option _orig_bridge 'false'
        option proto 'static'
        option ipaddr '192.168.44.1'
        option netmask '255.255.255.0'

config interface 'client'
        option proto 'dhcp'

现在我想要的只是 TCP 从外部适配器路由到我,客户端连接到主 AP。

在 GUI 的 Physical Settings 下,在 Client 和 Master 上,我检查了“在指定接口上创建网桥”并检查了 Client 和 Master。 不幸的是,这将我锁定在路由器之外,我最终重新闪烁 LEDE。

Bridge interfaces x creates a bridge over specified interface(s)
Interface
   Ethernet Adapter: "eth0" (lan)
   Ethernet Adapter: "eth1" (wan, wan6)
x Wireless Network: Master "b0x" (master)  
x Wireless Network: Client "manos222" (client)
   Custom Interface: 

现在我想要的只是 TCP 从外部适配器路由到我,客户端连接到主 AP。

在 GUI 的 Physical Settings 下,在 Client 和 Master 上,我检查了“在指定接口上创建网桥”并检查了 Client 和 Master。 不幸的是,这将我锁定在路由器之外,我最终重新闪烁 LEDE。

Bridge interfaces x creates a bridge over specified interface(s)
Interface
   Ethernet Adapter: "eth0" (lan)
   Ethernet Adapter: "eth1" (wan, wan6)
x Wireless Network: Master "b0x" (master)  
x Wireless Network: Client "manos222" (client)
   Custom Interface: 

我觉得我真的很亲近。如果有人能指出我正确的方向,将不胜感激。我觉得我真的很亲近。如果有人能指出我正确的方向,将不胜感激。

【问题讨论】:

标签: networking wifi embedded-linux openwrt


【解决方案1】:

无数小时后...

echo 1 > /proc/sys/net/ipv4/ip_forward

#Reset iptables
iptables -F
iptables -X

iptables -A FORWARD -o wlan1 -i br-lan -s 192.168.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE

成功了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-16
    • 2018-08-25
    • 2016-08-01
    相关资源
    最近更新 更多