Omnia Switching Vlans and interfaces


#41

ˋ/etc/init.d/network restartˋ should cause a few seconds of disconnect.

Could you post the section wan of /etc/config/network after setting the vlan and the output of ip link?


#42

It says permission denied when I type /etc/config/network whether the VLAN is set or not.

Also, is there a reason why I have to run the uci set commands twice? The first time I try one of the two you’ve now posted, it just brings up all the potential commands and options that uci can use. Then I run it again and it just deletes the command (it doesn’t bring up the next command line in the interface like uci commit does).


#43

Stupid me, I missed one equals sign. It should be

uci set network.wan.ifname=eth1.201
uci commit
/etc/init.d/network restart

To undo the change replace eth1.201 with eth1 in the first line.

To get the file contents use cat /etc/config/network


#44

Great, thanks. I’ve fully disconnected the default ISP router now and I’m getting internet through the Omnia.


#45

I wanted to achieve the following in order to attach a bigger network switch to LAN 4:
Network1: name lan, physical ports LAN 1-4
Network2: name gast, physical port LAN 4

I therefore configured /etc/config/network as follows…


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 force_link '1'
	option ifname 'eth0.1 eth2.1 tap0'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option delegate '0'

config interface 'wan'
	option ifname 'eth1'
	option proto 'dhcp'
	option delegate '0'

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 ports '0 1 2 3 5'
	option vid '1'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4t 6t'
	option vid '2'

config switch_vlan
	option device 'switch0'
	option vlan '3'
	option vid '5'
	option ports '4t 6t'

config interface 'gast'
	option ifname 'eth2.5 gast_0 gast_1 gast_2'
	option type 'bridge'
	option proto 'static'
	option ipaddr '192.168.0.1'
	option netmask '255.255.255.0'

… whats proved to be wrong - none of the LAN-ports seems to be working… Can anyone help?


#46

Did you mean network lan with 0-3 or 0-4?
I assume tap0 is an OpenVPN device and gast_0, gast_1 and gast_2 are Virtual AP.

lan with 0-3 and gast on 4 would use the default switch config of TurrisOS. eth0 for lan, eth2 for gast.

I give only the changed parts for interfaces and the switch_vlans.

config interface 'lan'
	option ifname 'eth0 tap0'
	...
config interface 'gast'
	option ifname 'eth2 gast_0 gast_1 gast_2'
	...
...
config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0 1 2 3 5'
config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '4 6'

lan with 0-4 and gast on 4 would be a bit tricky and need full VLAN-support in your external switch.

Difference to above:

config switch_vlan
	option name 'switch0'
	option vlan '1'
	option ports '0 1 2 3 4 5'
config switch_vlan
	option name 'switch0'
	option vlan '2'
	option ports '4t 6'

This will but LAN 0-4 (untagged) on eth0 and LAN 4 with VLAN-Tag 2 on eth2.

If you want your lan packets on LAN 4 with VLAN-tag 1 then change option ports '0 1 2 3 4 5' to '0 1 2 3 4t 5'


#47

Sry for that, yes I meant LAN0-4.
I accidentally deleted out the openvpn ifs and gast_0 to gast_2 are belonging to wifi-SSIDs.

Your first example is what I’ve figured out yesterday evening after writing the first post and what is actually implemented without the additional smart switch in place. My question about that is: Is this fully VLAN compatible? If I propagate it that way (having to ethernet-cables connected to the switch with one on LAN4 (gast) and one on LAN0/LAN1/LAN2/LAN3 (lan)), would a set VID 1 on the smart switch be routed correctly to lan and VID 2 to gast respectively?

What I don’t understand in your second example: @miska mentioned something above that VID 1 is always attached to eth0 and VID 2 is always attached to eth2. And as LAN4 is eth2 I cannot be listed it in eth0?
And: Yes, my additional smart switch will be fully VLAN-capable.

I really wished, the Turris Development Team had implemented only 4 ethernet ports on eth0 without an additional eth2, that would have made things much more simple (at least for me…) :confused:


#48

So your external smart switch connected to LAN4 should be able to access lan and gast using VLANs?

interface lan would be on eth0, interface gast on eth2.
LAN0-3 are lan and without any VLAN.
LAN4 is connected to an external smart switch an expects VLAN tags for lan (1) and gast (2) and you select lan or gast per port on the external switch by assigning it to one of the two VLANs?

This would work if you change the switch_vlans like this:

config switch_vlan
	option name 'switch0'
	option vlan '1'
	option ports '0 1 2 3 4t 5'
config switch_vlan
	option name 'switch0'
	option vlan '2'
	option ports '4t 6'

This would give you pakets for gast always tagged with vlan id 2 like my second example but also the lan packets tagged with vlan id 1.

The interfaces (eth0 and eth2) are still without any VLAN ID set. The tagging is done by the switch.

Difference between my original second example is that there is always a tag (trunk for some vendors) and not only gast tagged.


#49

Ok, understood. I’ll test it later on!

Now two separate questions - partly out of curiousity, partly thinking about future scenarios:

  1. How would I have to extend this configuration if I wanted to have an aditional vlan on lan (assuming port 1 tagged VLAN ID 4)?
  2. How would I assing VLANs to WAN if (e.g. to assign another device/port directly to WAN)? I tested to set WAN ifname to ˋeth1.1ˋ but if I did so I would loose WAN network connection. My modem is not capable of setting VLANs (what is absolutely ok for me as I don’t use it for any other reason).

#50

If you change wan’s ifname to eth1.1 then eth1 with vlan tag 1 will be you wan. To get what you want add another interface and use ifname eth1.1 there. The same would be done for eth2.4 below.
You may still need some vlan capable switch on WAN or your device has to ignore every packet with any VLAN tag added. Not all provider modems ignore them. Some forward them depending on the tag used, e.g. VLAN7 and 8 are used in Germany on some providers.

Depending on how much traffic your eth0 and eth2 devices have and which ports should have this tagged VLAN4 there are 2 options.

VLAN 4 on LAN4 and eth2 (both tagged)

config switch_vlan
	option name 'switch0'
	option vlan '4'
	option ports '4t 6t'

and the vlan on eth2.4

VLAN 4 on LAN4 and eth0 (both tagged)

config switch_vlan
	option name 'switch0'
	option vlan '4'
	option ports '4t 5t'

and the vlan on eth0.4

other things

You could even use any other LAN-port for this. It is also possible to remove some ports from the lan and add it to the VLAN4.

The internal switch chip is fully VLAN capable like any other of these smart switches out there. In reality it can do even more but this is not in the driver for OpenWRT/LEDE.
The original Linux driver (dsa) supports a few more features but will cost you access to eth2 (or eth0 depending on who wrote the dts) currently. DSA does not support multiple cpu ports at the moment.


#51

Hi…i am a new user here. As per my knowledge from Linux point of view there are by default no VLANs at all. There are VLANs set on switch chip in a way that resembles your third picture. Except, as WASN is connected directly to CPU, there is no VLAN on it.

printed circuit board assembly