TSW202/212 Allow VLAN Range

Hi,

Is it possible to allow a range of VLANs through a switchport on the TSW202/212 without defining each VLAN in the config? For example, VLANs 200-300 should be allowed to pass through port 1. I don’t want to configure 100 VLANs, which at the moment appears to be the only way to do it, at least on the GUI.

On a related note, is there any documentation for changing the config via SSH? I can’t seem to find anything?

Thanks

Hello,

Our managed switches TSW202 and TSW212 don‘t have such a functionality, but I spent a little time developing a script that could do it.

Before that, please note that scripting is beyond the scope of the technical assistance we normally provide and this is only a testing example, which I tested myself.

Follow these steps:

Unzip and copy vlan.sh script file to the switch device using WinSCP.
vlan.zip (1.4 KB)

https://wiki.teltonika-networks.com/view/Upload_%26_Download_Files_from_RutOS

Access the router’s CLI using SSH, then navigate to the directory where you saved the script file.

Run the command: ‘chmod 777 ’ to make the script executable on your end.

If done accordingly, ls -la command should show that the script file is executable and now can be used.

Whilst in the script directory, execute the script by using command ./vlan.sh



Please let me know if this worked for you.

Best regards,

1 Like

Hi @LukasV,

Thanks very much for your reply and the detailed script. I’ve passed it on to a colleague for testing. I believe he may have scripted something himself and whilst it seemed to work, he had concerns when the WebGUI took about 5 minutes to load the list of configured VLANs.

I understand the function isn’t officially supported and it may be difficult to answer these questions but:

  1. Aside from the GUI loading slowly (which is completely acceptable from our point of view), do you expect there to be any issues with layer 2 switching performance?
  2. Is an official implementation of this feature on the roadmap or will it not be possible due to contraints of the underlying OS?

Thanks again!

Hey there again,

I did some testing regarding the Web UI loading time after a fresh factory reset to see if the script had any impact on my switch. From what I can see on my end, everything works smoothly even after running the script, so the issue might be caused by something else.

Now, regarding your points:

  1. This shouldn’t directly affect Layer 2 performance unless the switch is overwhelmed due to hardware limitations. Testing is needed to determine the actual impact, as it depends on the type of traffic and other factors. The script mainly retrieves VLAN IDs using the “uci show” command and then uses another uci command to update the configuration file. Additionally, the number of supported VLANs is defined by the VLAN ID range, which is a characteristic of the VLAN system.
  2. Currently, there are no plans to introduce this functionality. Although it’s not restricted by the OS, developing new features requires resources. Customers needing custom functionality can request a “Custom Development Project” (CDP) by contacting us: Teltonika Networks - LTE Routers, Gateways & Modems for IoT.

Kind regards,

1 Like

Thanks again, Lukas.

I’m still waiting for feedback from my colleague but I’ve passed on the factory reset information.

We’ll submit a CDP if needed but as far as I’m aware, we’ll only need to configure this many VLANs for a single project.

Hey Lukas,

I just tested the above script. The script skips the VLAN instances that are not existing on the switch.

Our Use case is:
We need to create ~500 VLANs on Teltonika TSW202.
The Switch is new out of the box so all of the VLANs need to be configured as instances.

I managed to edit the /etc/config/network file in the Backup Tarball. I added all of the VLANs in the backup and used that to restore the switch.
All of the 500 VLANs carry traffic as expected and show up on the GUI. But since the GUI has to load a very long list, it gets sluggish and only responds after 3-4 minutes.

I also tried this:
config bridge-vlan ‘VLAN_Range’
option device ‘br0’
option vlan ‘3005-3300’
list ports ‘port1:t’
list ports ‘port2:t’

This shows up on GUI with no issues but does not carry the VLAN traffic. Perhaps we could ask for a new firmware that can allow us to use a range as above.
I believe the Switch is capable enough (as tested) to carry those VLANs but just need some syntax changes so the GUI doesn’t list every VLAN as a single instance.

If you have any other recommendations, I’m keen to test that out too.

Hello again,

If you want a range of VLANs to be created and listed within a single instance instead of separate instances in the WebUI, it would likely require changes to the WebUI source code.

Although our SDKs (Software Development Kits) for configuring the OS are available online, the required frontend source code modifications involve proprietary elements of our product. As a result, this source code is not publicly accessible, CDP is necessary and can be requested by contacting us: https://teltonika-networks.com/about-us/contacts

Kind regards,

Got it.

I am intrigued how it didn’t cause any sluggishness in your lab scenario. How many VLANs did you test it with?

I am wanting to test out your script and try adding the VLANs using it.
I can see that there is a check if the VLAN isnt existing, it would skip it.

Could you please edit the script so that it creates the range of VLANs that user is prompted to input?
The scenario would be a fresh config of a switch with no existing VLANs.

Thanks.

Hello again,

As requested, I have updated the script to include functionality for both adding and deleting VLANs, giving you full control over VLAN management.

vlan_v2.zip (1.9 KB)

I also tried adding 100 VLANs to see how switch performs. I noticed that this significantly slowed down the device and increased the WebUI load time, but it still functions correctly.

I look forward to your feedback and hope this script proves useful for your needs.

Best regards,

This topic was automatically closed after 17 days. New replies are no longer allowed.