找回密码
 注册

QQ登录

只需一步,快速开始

楼主: spicahan

关于用软件VLAN处理IPTV的方法

[复制链接]
 楼主| 发表于 2011-11-20 19:47:09 | 显示全部楼层
chmjiong 发表于 2011-11-20 18:14
今天下午试了一下
悲剧的是,IPTV既没连上,openwrt的无线不能上网了
那个IPTV口继续能够有线上网,看来是 ...

我想起来了,你要这样玩的话应该还要改一些设置。我手头没设备了,只能跟你说个大概。你想让 port 1 用 VLAN 2 来处理IPTV, 那么就还要再建个 VLAN ID, 比如 3,来处理 LAN, 然后端口里面要排除掉 port 1.
根据59楼你贴的配置文件,应该改成下面这样的:
第二段不再用eth1, 而是 eth1.3 同时增加 VLAN 3 的端口配置,最后IPTV VLAN那里稍微改一下,最后是这样的(loopback 和 wan 省略了):

config switch_vlan eth1_3
        option device   "eth1"
        option vlan     3
        option ports    "0u* 2u* 3u* 5*"

config switch_vlan eth1_2
        option 'device' 'eth1'
        option 'vlan' '2'
        option 'ports' '1u* 5*'

config interface iptv
       option type     bridge
       option proto    none
       option ifname   'eth0.51 eth0.85 eth1.2'

config interface lan
        option type     bridge
        option ifname   "eth1.3"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

祝好运!
发表于 2011-11-20 20:06:01 | 显示全部楼层
wifi失灵的问题,我想是因为和这张图有关:

eth2默认是给wifi用的,结果我划给了iptv

本帖子中包含更多资源

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

×
 楼主| 发表于 2011-11-20 20:12:59 | 显示全部楼层
chmjiong 发表于 2011-11-20 20:06
wifi失灵的问题,我想是因为和这张图有关:

eth2默认是给wifi用的,结果我划给了iptv

呵呵,那就说明你没仔细看我的回帖,我在60楼里写了:
“最后一行不对,应该是这样的:
option ifname 'eth0.51 eth0.85 eth1.2'”
你原来写的是 eth2.51 和 eth2.85, 我已经让你改成 eth0.51 和 eth0.85 了。
发表于 2011-11-21 08:06:50 | 显示全部楼层
继续杯具中,network如下:
这次是有线全完,无线能用
悲催的intel无线网卡还不能打开web界面,还好有一只USB无线网卡,插台式机连上去恢复了备份的配置
config switch_vlan eth1_3
        option device   "eth1"
        option vlan     3
        option ports    "0u* 2u* 3u* 5*"

config switch_vlan eth1_4
        option 'device' 'eth1'
        option 'vlan' '4'
        option 'ports' '1u* 5*'

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

config interface iptv
       option type     bridge
       option proto    none
       option ifname   'eth0.51 eth0.85 eth1.3'

config interface lan
        option type     bridge
        option ifname   "eth1.3"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

config 'interface' 'wan'
        option 'ifname' 'eth0'
        option 'proto' 'pppoe'
        option 'username' 'XXXXX'
        option 'peerdns' '1'
        option 'defaultroute' '1'
        option 'password' 'XXXXX'

 楼主| 发表于 2011-11-21 10:01:40 | 显示全部楼层
chmjiong 发表于 2011-11-21 08:06
继续杯具中,network如下:
这次是有线全完,无线能用
悲催的intel无线网卡还不能打开web界面,还好有一只 ...

config interface iptv那段,最后的 option ifname 'eth0.51 eth0.85 eth1.3',
eth1.3既然你已经分配给LAN用了,这里就不能分配给IPTV用了啊。。。
你的IPTV端口用了交换机硬件的VLAN 4, 所以那里要改成
option ifname 'eth0.51 eth0.85 eth1.4'

这里要完全解释清楚是比较费劲的,因为同时涉及了交换机芯片的硬件VLAN处理和Linux的软件VLAN处理,还有软件实现的以太网桥接,还有TAG, UNTAG, Default PVID之类的概念。
发表于 2011-11-22 22:21:41 | 显示全部楼层
这两天各种配置各种失败{:soso_e149:}
最惨的一次所有端口统统失灵,只好靠TTL救回来
典型的network如下,vlan号各种组合都试过了


config switch eth1
          option reset 1
          option enable_vlan 1

config switch_vlan
          option device eth1
          option vlan 1
          option ports "0 2 3 5t"

config switch_vlan
          option device eth1
          option vlan 2
          option ports "1 5t"

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

config interface lan
          option ifname "eth1.1"
          option proto static
          option type bridge
          option ipaddr 192.168.1.15
          option netmask 255.255.255.0

config interface iptv
          option ifname "eth0.51 eth0.85 eth1.2"
          option proto static
          option type bridge
          option ipaddr 192.168.1.15
          option netmask 255.255.255.0
IPTV那段,none也试过,反正有线统统失灵,要么干脆分不到IP,要么分到IP但是连不到外网

我要抓狂了
 楼主| 发表于 2011-11-22 22:41:01 | 显示全部楼层
chmjiong 发表于 2011-11-22 22:21
这两天各种配置各种失败
最惨的一次所有端口统统失灵,只好靠TTL救回来
典型的network如下, ...

先问一个问题,你能肯定eth0是WAN口,eth1是接交换机的口吗?最好把dmesg的输出贴上来。

我手头已经没有H618C了,不然倒是可以试验一下。你贴出来的配置里面,option ports 里的星号应该是不能省略的。假设LAN用VID 2, IPTV用VID 3.  我上面给的写法有个错误,5*不应该有两个。你按照下面的来写:
config switch_vlan eth1_2
        option device   "ether"
        option vlan     2
        option ports    "0u* 2u* 3u* 5*"

config switch_vlan eth1_3
        option 'device' 'eth1'
        option 'vlan' '3'
        option 'ports' '1u* 5'

config interface iptv
          option type bridge
          option proto static
          option ifname "eth0.51 eth0.85 eth1.3"

config interface lan
        option type     bridge
        option ifname   "eth1.2"
        option proto    static
        option ipaddr   192.168.1.1
        option netmask  255.255.255.0

第二个问题,IPTV那段proto设none是完全可以的;如果设成static的话,一定不能和LAN设相同的网段,更加不能设相同的IP地址。。
发表于 2011-11-23 07:20:06 | 显示全部楼层
本帖最后由 chmjiong 于 2011-11-23 07:47 编辑

dmesg相关内容如下:
br-lan: port 1(eth1) entering disabled state
device eth1 left promiscuous mode
br-lan: port 1(eth1) entering disabled state
eth1: link forced UP - 100/full - flow control off/off
eth1: link forced UP - 100/full - flow control off/off
device eth1 entered promiscuous mode
br-lan: port 1(eth1) entering forwarding state
bcm63xx_enet bcm63xx_enet.0: attached PHY at address 1 [Broadcom BCM63XX (2)]
bcm63xx_enet bcm63xx_enet.0: attached PHY at address 1 [Broadcom BCM63XX (2)]
eth0: link UP - 100/full - flow control off
br-lan: port 1(eth1) entering disabled state
device eth1 left promiscuous mode
br-lan: port 1(eth1) entering disabled state
eth1: link forced UP - 100/full - flow control off/off
eth1: link forced UP - 100/full - flow control off/off
device eth1 entered promiscuous mode
br-lan: port 1(eth1) entering forwarding state
bcm63xx_enet bcm63xx_enet.0: attached PHY at address 1 [Broadcom BCM63XX (2)]
bcm63xx_enet bcm63xx_enet.0: attached PHY at address 1 [Broadcom BCM63XX (2)]
eth0: link UP - 100/full - flow control off
看样子eth0\1没错,但是这两句是什么意思?
roboswitch: Probing device eth0: Failed to enable switch
roboswitch: Probing device eth1: found a 5325! It's a 5350.
发表于 2011-11-23 08:35:41 | 显示全部楼层
本帖最后由 chmjiong 于 2011-11-23 08:36 编辑
spicahan 发表于 2011-11-22 22:41
先问一个问题,你能肯定eth0是WAN口,eth1是接交换机的口吗?最好把dmesg的输出贴上来。

我手头已经没 ...


刚才又按照您的设置重新编写了network,这次终于成功了{:7_211:}
万分感谢!!!!
看来问题确实出在两个5*上面
要在6358上实现IPTV,除了正确的设置,那个96个vlan的驱动也很重要
我把那个修改版驱动换成原版的,IPTV立刻不行了

完整的network如下:
onfig switch eth1
          option reset 1
          option enable_vlan 1

config switch_vlan eth1_2
        option device   'eth1'
        option 'vlan'  '2'
        option ports    '0u* 2u* 3u* 5*'

config switch_vlan eth1_3
        option 'device' 'eth1'
        option 'vlan' '3'
        option 'ports' '1u* 5'

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

config 'interface' 'lan'
          option 'ifname' 'eth1.2'
          option 'proto' 'static'
          option 'type' 'bridge'
          option 'ipaddr' '192.168.1.1'
          option 'netmask' '255.255.255.0'
        option 'nat' '1'
        option 'defaultroute' '0'
        option 'peerdns' '0'

config interface iptv
          option 'ifname' 'eth0.51 eth0.85 eth1.3'
       option 'type' 'bridge'
       option 'proto' 'none'
config 'interface' 'wan'
        option 'ifname' 'eth0'
        option 'proto' 'pppoe'
        option 'username' 'XXXXX'
        option 'peerdns' '1'
        option 'defaultroute' '1'
        option 'password' 'XXXXX'

点评

怎么开启4096个 Vlan啊 enable_vlan 4K 好像没用 96个也行啊,现在的机器就16个vlan  详情 回复 发表于 2012-10-14 08:10
 楼主| 发表于 2011-11-23 10:35:17 | 显示全部楼层
chmjiong 发表于 2011-11-23 08:35
刚才又按照您的设置重新编写了network,这次终于成功了
万分感谢!!!!
看来问题确实出在 ...

呵呵,恭喜恭喜!
先说上面的dmesg:
roboswitch: Probing device eth0: Failed to enable switch
这句话的意思就是 eth0 上没有连着交换机,所以 eth0 是直接出去的,也就是 WAN 口
roboswitch: Probing device eth1: found a 5325! It's a 5350.
这句就是说 eth1 上有一个 BCM5325E 的交换机,所以 eth1 上是可以弄 VLAN 的,四个LAN口可以分别控制。

然后你说96个VLAN那个驱动很重要,这点我不同意。你这个方法是用Linux软件来处理VLAN的,所以那个驱动是不涉及到的。事实上,硬件(BCM5325E)用到的VLAN只有2和3而已,那是用来把端口1和0, 2, 3区别开来的,原版驱动支持16个VLAN, 已经足够了。VLAN 51和85是软件实现的,并且只通过eth0走。至于为什么换掉就不行了,我不太清楚。。不过无所谓了,能用就先用着吧,呵呵。
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|宽带技术网 |网站地图

粤公网安备 44152102000001号

GMT+8, 2024-4-29 09:53 , Processed in 0.026919 second(s), 4 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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