本文主要是介绍iptv和宽带双线合一,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
家里弱电箱到卧室只有一根线,如何才能同时满足iptv和宽带同时使用呢?
买2台vlan交换机,其中一个vlan交换机用支持openwrt的路由器代替:
拓扑如下(借用购买的sucom交换机图):
弱电箱交换机配置如下:
卧室openwrt配置如下:
[root@PandoraBox_DF50:/]#swconfig dev switch0 show
Global attributes:enable_vlan: 1
Port 0:pvid: 2link: port:0 link:down
Port 1:pvid: 3link: port:1 link:down
Port 2:pvid: 0link: port:2 link:down
Port 3:pvid: 0link: port:3 link:down
Port 4:pvid: 1link: port:4 link:up speed:100baseT full-duplex
Port 5:pvid: 0link: port:5 link:down
Port 6:pvid: 0link: port:6 link:up speed:1000baseT full-duplex
Port 7:pvid: 0link: port:7 link:down
VLAN 1:vid: 1ports: 0 1 4 6t 7t
VLAN 2:vid: 2ports: 0 4t 6t 7t
VLAN 3:vid: 3ports: 1 4t 6t 7t
[root@PandoraBox_DF50:/]#cat /etc/config/networkconfig 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 'fdcc:4b25:9dd1::/48'config interface 'vp1'option type 'bridge'option _orig_ifname 'eth0.1'option _orig_bridge 'true'option proto 'dhcp'option ifname 'eth0.1 eth0.2'config device 'lan_dev'option name 'eth0.1'option macaddr '20:76:93:20:df:50'config device 'wan_dev'option name 'eth0.2'option macaddr '20:76:93:20:df:51'config switchoption name 'switch0'option reset '1'option enable_vlan '1'config switch_vlanoption device 'switch0'option vlan '1'option vid '1'option ports '0 1 4 6t 7t'config switch_vlanoption device 'switch0'option vlan '2'option vid '2'option ports '0 4t 6t 7t'config switch_vlanoption device 'switch0'option vlan '3'option vid '3'option ports '1 4t 6t 7t'config interface 'pc'option type 'bridge'option proto 'none'option ifname 'eth0.2'option auto '1'[root@PandoraBox_DF50:/]#
结果:iptv和宽带在卧室只要一根线就可以了
这篇关于iptv和宽带双线合一的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!