Hello all!
I found configuration that meets my needs. I have asked about:
- to divert VoIP traffic coming to WAN in vlan15 - to LAN4 untagged
- (in future) to divert IPTV traffic (let's say, VLAN 17) - to LAN3 untagged
- to divert Internet traffic (VLAN 14) - to NAT (router) and then to LAN1-2 untagged
Thanks to Zanzani and his post at https://forum.openwrt.org/viewtopic.php … 28#p222528 - it helped me to understand the structure of this device.
Part 1. Default configuration:
WAN -> {p5 -> p6 in vlan2 (these VLAN's are internal in switch)} -> eth0 -> CPU-> eth1 -> {p0 -> p1-p4 in vlan1}. This is the default "router" mode.
________________________________
| CPU |
|eth1 eth0|
|________________________________|
| |
_________________|____________________________|__
switch port | p0 | p1 | p2 | p3 | p4 | p5 | p6 |
______________|____|____|____|____|____|____|____|
router port | - |lan4|lan3|lan2|lan1|wan | - |
______________|____|____|____|____|____|____|____|
vlan1 | u | u | u | u | u | x | x |
______________|____|____|____|____|____|____|____|
vlan2 | x | x | x | x | x | u | u |
______________|____|____|____|____|____|____|____|
t = tagged
u = untagged
x = not used
Part 2. My configuration at this moment:
My ISP gives me internet in vlan14 and VoIP in vlan15.
For VoIP, I need to make a bridge between tagged WAN port p5 and LAN4 port p1 (my IP adapter is connected to LAN4).
vlan15 -> WAN -> p5 -> p1 untagged
For internet traffic:
vlan14 -> WAN -> p5 -> p6 untagged -> eth0 -> CPU -> eth1 -> p0 -> p2-p4 in vlan1
________________________________
| CPU |
|eth1 eth0|
|________________________________|
| |
_________________|____________________________|__
switch port | p0 | p1 | p2 | p3 | p4 | p5 | p6 |
______________|____|____|____|____|____|____|____|
router port | - |lan4|lan3|lan2|lan1|wan | - |
______________|____|____|____|____|____|____|____|
vlan1 (lan) | u | x | u | u | u | x | x |
______________|____|____|____|____|____|____|____|
vlan14 (inet) | x | x | x | x | x | t | u |
______________|____|____|____|____|____|____|____|
vlan15 (voip) | x | u | x | x | x | t | x |
______________|____|____|____|____|____|____|____|
t = tagged
u = untagged
x = not used
Configuration file /etc/config/network is:
config 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 'fdfb:87a3:5dc2::/48'
config interface 'lan'
option ifname 'eth1'
option type 'bridge'openwrt
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
option ifname 'eth0'
option proto 'static'
option ipaddr '172.21.41.45'
option netmask '255.255.0.0'
option gateway '172.21.0.1'
option dns '8.8.8.8 8.8.4.4'
config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0 2 3 4'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5t 6'
option vid '14'
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '15'
option ports '1 5t'
Part 3. For configuration as above, plus IPTV in vlan17 (let's say, IPTV goes to LAN3) is necessary:
a. exclude LAN3 (p2) from vlan1 to release this port for IPTV vlan17
b. add vlan17 to config and make a bridge between tagged WAN port p5 and LAN3 port p2.
________________________________
| CPU |
|eth1 eth0|
|________________________________|
| |
_________________|____________________________|__
switch port | p0 | p1 | p2 | p3 | p4 | p5 | p6 |
______________|____|____|____|____|____|____|____|
router port | - |lan4|lan3|lan2|lan1|wan | - |
______________|____|____|____|____|____|____|____|
vlan1 (lan) | u | x | x | u | u | x | x |
______________|____|____|____|____|____|____|____|
vlan14 (inet) | x | x | x | x | x | t | u |
______________|____|____|____|____|____|____|____|
vlan15 (voip) | x | u | x | x | x | t | x |
______________|____|____|____|____|____|____|____|
vlan17 (iptv) | x | x | u | x | x | t | x |
______________|____|____|____|____|____|____|____|
t = tagged
u = untagged
x = not used
So now vlan part of /etc/config/network will looks as following:
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0 3 4'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '5t 6'
option vid '14'
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '15'
option ports '1 5t'
config switch_vlan
option device 'switch0'
option vlan '4'
option vid '17'
option ports '2 5t'
Note: IPTV config in part 3 was not tested, but config in part 2 is working perfectly for me.
Hope, this information helps somebody.
p.s. Sorry for my poor English :-(
(Last edited by arcd on 29 May 2014, 18:49)