找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: spicahan

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

[复制链接]
 楼主| 发表于 2011-11-20 07:38:51 | 显示全部楼层
chmjiong 发表于 2011-11-19 23:12
请教:如果我想把lan2单独配给IPTV该怎么写?
现在我用H618C刷openwrt
/etc/config/network内容如下: ...

最后一行不对,应该是这样的:
option ifname 'eth0.51 eth0.85 eth1.2'

记得还要在 /etc/rc.local 里设一句
echo 0 > /sys/devices/virtual/net/eth0.85/brport/multicast_router
发表于 2011-11-20 18:14:14 | 显示全部楼层
今天下午试了一下
悲剧的是,IPTV既没连上,openwrt的无线不能上网了
那个IPTV口继续能够有线上网,看来是vlan没起作用,反而把wifi和CPU连接的port5给占用了
即使删掉后来加进去的vlan,无线也没有恢复,只好恢复默认配置重新配了一遍openwrt
 楼主| 发表于 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.
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2026-1-23 05:58 , Processed in 0.022181 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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