设为首页收藏本站

宽带技术网

 找回密码
 注 册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 724|回复: 4

求助啊rtl8366s(WNDR3700 V1/V2/WNDR3800)在OPENWRT下划分VLAN的问题

[复制链接]
本帖最后由 ziranww 于 2014-4-24 08:29 编辑

折腾好几个月搞不定,谷歌百度了好多未果
感觉tl8366s比较特殊,和其他路由在OP下不一样,依葫芦画不出瓢,囧

如何设置VLAN,不通过电信交换机可上网,同时IPTV又可以播放?关于电信iptv有几点不解:
1.光纤和adsl是否完全不同?看到网友设置时需要pvid参数,另外的只需设置两个vlan即可
2.我这边adsl猫出来网线通过交换机后路由器和iptv都可正常工作,是否我不需要设置pvid参数直接划分vlan即可?





这个是查到的资料,openwrt的Wiki上也有类似说明
http://blog.sina.com.cn/s/blog_6f31085901017u9n.html
------------------------------------------------------------------------------
1) WNDR3700 Switch Ports (for VLANs)
Numbers 0-3 are Ports 4 to 1 as labeled on the unit, 5 is the internal connection to the router itself. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on.
PortSwitch Port
CPU(eth0)5
No port4
Lan 13
Lan 22
Lan 31
Lan 40


WAN port is a gigabit port. VLANs can be configured to work on both LAN and WAN.
To create a VLANx on WAN port (eth1) declare an interface as "eth1.x". It can be further bridged with one of the switch ports if necessary.
For the LAN interface two actions are needed:
  • Declare "eth0.x" interface
  • Define switch_vlan configuration for each of the switch ports.

When vlans are defined on the switch ports VLAN0 cannot be used on eth0 any more. So the default router configuration must be changed, otherwise traffic stops on the switch ports and hard reset is needed.

2) Solution I: VLAN + Bridge
GUI: For further reference:
1) Go to Switch VLAN, set the port which is used to Off in VLAN 1
2) Add another VLAN (2), set the port used to untagged and CPU to tagged
3) Go to WAN, go to physical settings, enable bridge and select eth1 and the VLAN interface you just created (eth0.2)
4) Reboot by removing power and putting it back on.
5) Enjoy

CLI: (Edit /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 interface 'lan'
        option ifname 'eth0.1'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.1.1'
config interface 'wan'
        option proto 'dhcp'
        option type 'bridge'
        option ifname 'eth0.2 eth1'
config switch
        option name 'rtl8366s'
        option reset '1'
        option enable_vlan '1'
        option blinkrate '2'
        option max_length '3'
        option enable_vlan4k '1'
config switch_vlan
        option device 'rtl8366s'
        option vlan '1'
        option ports '0 1 2 5t'
config switch_vlan            
        option device 'rtl8366s'
        option vlan '2'      
        option ports '3 5t'

3) Solution II: Switch LAN and WAN to use hardware VLAN
CLI: (Edit /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 'interface' 'lan'
        option 'ifname' 'eth1'
        option 'proto' 'static'
        option 'type' 'bridge'
        option 'netmask' '255.255.255.0'
        option 'ipaddr' '192.168.25.1'
config 'interface' 'wan'
        option 'ifname' 'eth0.1'
        option 'proto' 'dhcp'
config 'interface' 'digitv'
        option 'proto' 'dhcp'
        option 'ifname' 'eth0.2'
config 'switch'
        option 'name' 'rtl8366s'
        option 'reset' '1'
        option 'enable_vlan' '1'
        option 'blinkrate' '2'
config 'switch_vlan'
        option 'device' 'rtl8366s'
        option 'vlan' '1'
        option 'ports' '0 1 3 5t'
config 'switch_vlan'
        option 'device' 'rtl8366s'
        option 'vlan' '2'
        option 'ports' '2 5t'

=== Reference ===

本帖子中包含更多资源

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

x
 楼主| 发表于 2014-4-24 08:25:28 | 显示全部楼层
http://www.chinadsl.net/forum.php?mod=viewthread&tid=74463
还有这个兄弟帖子中的方法也不行

  1. config interface 'loopback'
  2.         option ifname 'lo'
  3.         option proto 'static'
  4.         option ipaddr '127.0.0.1'
  5.         option netmask '255.0.0.0'

  6. config interface 'lan'
  7.         option ifname 'eth0.1'
  8.         option type 'bridge'
  9.         option proto 'static'
  10.         option netmask '255.255.255.0'
  11.         option ipaddr '192.168.1.1'

  12. config interface 'wan'
  13.         option proto 'pppoe'
  14.         option username 'ad******'
  15.         option password '******'
  16.         option _orig_ifname 'eth0.81'
  17.         option _orig_bridge 'false'
  18.         option ifname 'eth0.81'

  19. config switch
  20.         option name 'rtl8366s'
  21.         option reset '1'
  22.         option enable_vlan '1'
  23.         option enable_vlan4k '1'

  24. config switch_vlan
  25.         option device 'rtl8366s'
  26.         option vlan '1'
  27.         option ports '0 1 5t'

  28. config switch_port
  29.         option device 'rtl8366s'
  30.         option port '1'
  31.         option led '6'

  32. config switch_port
  33.         option device 'rtl8366s'
  34.         option port '2'
  35.         option led '9'

  36. config switch_port
  37.         option device 'rtl8366s'
  38.         option port '5'
  39.         option led '2'

  40. config switch_vlan
  41.         option device 'rtl8366s'
  42.         option vlan '81'
  43.         option ports '3 5t'

  44. config switch_vlan
  45.         option device 'rtl8366s'
  46.         option ports '2 3t'
  47.         option vlan '85'

  48. config switch_vlan
  49.         option device 'rtl8366s'
  50.         option ports '2 3t'
  51.         option vlan '51'
复制代码



发表于 2014-4-24 12:37:00 | 显示全部楼层
全是英文 看不懂哦 可惜我这边的IPTV是需要在光猫里设置后才能上的 跟你们这边不一样 要不我可以试试你说的方法

点评

XD也是WNDR3700或3800吗?  详情 回复 发表于 2014-4-24 13:30
 楼主| 发表于 2014-4-24 13:30:26 | 显示全部楼层
keboy520 发表于 2014-4-24 12:37
全是英文 看不懂哦 可惜我这边的IPTV是需要在光猫里设置后才能上的 跟你们这边不一样 要不我可以试试你说的 ...

XD也是WNDR3700或3800吗?
 楼主| 发表于 2014-4-26 13:30:19 | 显示全部楼层
周末再顶起来一下
您需要登录后才可以回帖 登录 | 注 册

本版积分规则

QQ|Archiver|手机版|小黑屋|宽带技术网 ( 粤ICP备15054574号  

粤公网安备 44152102000001号

GMT+8, 2017-1-21 10:17 , Processed in 0.498561 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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