我在路由器上刷了OpenWrt + Open Vswitch:TP-link AC1750
我想在路由器上添加一个控制器(泛光灯)监听,并且可以在泛光灯上看到连接到无线网络的所有设备。
我已阅读openwrt.org上的文档,了解有关配置文件的条款:/ etc / config / network。但我仍有一些基本问题希望有人能帮助我。谢谢!
因为只有ovs桥可以被控制器监听,我相信我必须使用ovs-vsctl创建一个桥来替换br-lan的功能。但我不知道从哪里开始。除了上面的问题,任何人都可以告诉我这样做的方向吗?感谢。
ifconfig输出:
br-lan Link encap:Ethernet HWaddr A4:2B:B0:DC:64:34
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fd40:41e7:b9c0::1/60 Scope:Global
inet6 addr: fe80::a62b:b0ff:fedc:6434/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:151654 errors:0 dropped:0 overruns:0 frame:0
TX packets:236631 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:15601422 (14.8 MiB) TX bytes:251291293 (239.6 MiB)
eth0 Link encap:Ethernet HWaddr A4:2B:B0:DC:64:35
inet addr:192.168.0.106 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::a62b:b0ff:fedc:6435/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1083749 errors:0 dropped:0 overruns:0 frame:0
TX packets:150544 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:433298836 (413.2 MiB) TX bytes:18665423 (17.7 MiB)
Interrupt:4
eth1 Link encap:Ethernet HWaddr A4:2B:B0:DC:64:34
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:9727 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:335 (335.0 B) TX bytes:676714 (660.8 KiB)
Interrupt:5
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:905 errors:0 dropped:0 overruns:0 frame:0
TX packets:905 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:85370 (83.3 KiB) TX bytes:85370 (83.3 KiB)
wlan0 Link encap:Ethernet HWaddr A4:2B:B0:DC:64:33
inet6 addr: fe80::a62b:b0ff:fedc:6433/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:153653 errors:0 dropped:0 overruns:0 frame:0
TX packets:223631 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:17983679 (17.1 MiB) TX bytes:256128206 (244.2 MiB)
默认的/ 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 'fd40:41e7:b9c0::/48'
config interface 'lan'
option ifname 'eth1'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option ifname 'eth0'
option proto 'dhcp'
config interface 'wan6'
option ifname 'eth0'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1 2'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 2 3 4 5'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '1 6'
路由器的结构:
答案 0 :(得分:-1)
我明白了。以下是步骤:
我通过
创建了一座新桥ovs-vsctl add-br mybridge
然后我比较了/ etc / config / wireless和/ etc / config / network,我发现无线设备连接到接口'lan'和'eth1',就像我上面攻击的图一样。所以我认为界面'lan'在某种程度上可以等于'br-lan'。然后在/ etc / config / network中,我修改了:
config interface 'lan'
option ifname 'eth1 mybridge'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
通过以下方式在'mybridge'上设置控制器:
ovs-vsctl set-controller mybridge tcp:ip:port
最后,我可以看到连接到控制器端路由器的设备,并推送设备周围的流量。