一根网线同时用IPTV和上网的方法

您所在的位置:网站首页 联通光猫没有iptv接口 一根网线同时用IPTV和上网的方法

一根网线同时用IPTV和上网的方法

#一根网线同时用IPTV和上网的方法| 来源: 网络整理| 查看: 265

家里现在用上海电信的光纤宽带,一根光纤同时能够提供 IPTV、上网、电话的功能。从光猫出来一共有 4 个网口,其中只有 1 个能够用 IPTV。而我家光猫所在的弱电箱到客厅只拉了一根网线,如果只用普通的家用交换机,客厅的小米电视上网功能、NAS、IPTV 就不能同时使用。

网上搜了一下,光猫使用了 VLAN 技术对 IPTV 和上网的流量进行区分。所以,客厅需要个支持 VLAN 的交换机,才能实现有线上网、IPTV 同时使用。

支持 VLAN 的交换机有很多:

企业级交换机;部分家用路由器刷 openwrt 固件,如 Netgear 的 WNDR4300。简单网管交换机,如 Netgear 的 GS105E。

第 1 种成本太高,不考虑。第 2 种方案的优点是能沿用已有的设备,我一开始用的就是这种,但用了一段时间后发现,刷的 openwrt 不太稳定,经常碰到 IPTV 不能用的情况。后来,在网上找到了第 3 种方案,目前用下来没出现问题,果然还是用专业的设备比较靠谱。

GS105E 是 5 口交换机,还有个 8 口的版本:GS108E。两个型号功能一样,只是端口数量的差别,价格差 100 块左右。

我家的网络拓扑大概是这样:

稍微解释一下:

光猫负责拨号、充当主路由分配房内所有设备的 IP。光猫的一个非 IPTV 口连接卧室的 WNDR 4500,后者配置成无线 AP,提供无线网络。光猫的 IPTV 口连接 GS105E 的 1 号口;GS105E 的 2 号口连接 IPTV 机顶盒;其余口连接其它网络设备,如 NAS、小米电视。

上海电信的 IPTV 用到了 ID 为 51、85 的两个 VLAN。所以,交换机上的 VLAN 需要这样划分:

VLAN 1,包含所有端口,类型为 Untag。这是默认 VLAN ID。VLAN 51,只包含端口 1 和 2,类型为 Tag。VLAN 85,只包含端口 1 和 2,类型为 Tag。

GS105E上配置 VLAN 的入口在 管理页面 -> VLAN -> 802.1Q -> Advanced,几个关键页面的配置如下:

添加51、85两个VLAN配置VLAN 1配置VLAN 51配置VLAN 85

Port PVID 页面配置每个端口的默认 VLAN ID,保持默认的全部为 1 即可。

GS105E 配置好后,IPTV 就能正常使用了,大功靠成。

配置 VLAN 的关键在选择端口类型,是 Tag 还是 Untag,这会影响交换机收到数据包后怎么转发。这方面网上没有比较易懂的资料,我只找到 Netgear 官网的一篇文章《How does a VLAN work on a smart switch?》讲得比较清楚,这里摘录一下原文:

A smart switch treats incoming packets in the following way:

If an untagged packet enters a port, it is automatically tagged with the port’s default VLAN ID. Each port has a default VLAN ID that is you can configure. The default setting is 1.If a tagged packet enters a port, the tag for that packet is unaffected by the default VLAN ID. The packet proceeds to the VLAN that is specified by the VLAN ID in the packet.If a packet enters through a port that is a member of the VLAN that is specified by the VLAN ID in the packet, the packet can be sent to other ports with the same VLAN ID.If a packet enters through a port that is not a member of the VLAN that is specified by the VLAN ID in the packet, the packet is dropped.Packets that leave the switch are either tagged (“T”) or untagged (“U”), depending on the VLAN to which the port belongs.



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3