30 ‐ Basics ‐ VLAN Config Gluon - freifunk-darmstadt/projects GitHub Wiki
To use to enable gluon based offloaders to support different VLANs, as it may be used at larger networks.
- Existing interface roles have to be removed if any of the assigned ports are remapped
- Example: When re-assigning
lan1, the role of the/lanpseudointerface have to be removed
- Example: When re-assigning
- This does only work for platforms who use DSA for the switch-driver
- To apply changed config, don't forget to save with
uci commitand apply withgluon-reconfigure- Check the resulting config in
/etc/config/networkand restart the network by executingrebootor/etc/init.d/network restart
- Check the resulting config in
There exist the following roles
-
uplinkfor the interface which the VPN is established with -
clientfor the client network in Gluon -
meshfor wired mesh
root@64295-hh36-c87f5420a1ee-offloader1:~# uci show gluon
[...]
gluon.iface_wan=interface
gluon.iface_wan.name='/wan'
gluon.iface_wan.role='uplink'
gluon.iface_lan=interface
gluon.iface_lan.name='/lan'
gluon.iface_lan_mesh50=interface
gluon.iface_lan_mesh50.name='lan1.50'
gluon.iface_lan_mesh50.role='mesh'
gluon.iface_lan_mesh60=interface
gluon.iface_lan_mesh60.name='lan1.60'
gluon.iface_lan_mesh60.role='mesh'
gluon.iface_lan_mesh70=interface
gluon.iface_lan_mesh70.name='lan1.70'
gluon.iface_lan_mesh70.role='mesh'
gluon.iface_lan_mesh80=interface
gluon.iface_lan_mesh80.name='lan1.80'
gluon.iface_lan_mesh80.role='mesh'
gluon.iface_lan_mesh90=interface
gluon.iface_lan_mesh90.name='lan1.90'
gluon.iface_lan_mesh90.role='mesh'
root@64295-hh36-c87f5420a1ee-offloader1:~#
Note the following:
-
gluon.iface_lanhas it'sroleproperty removed. See important Notes. -
lan1in this example is the interface name where the VLAN should be added to.- This name is not universal. It depends on the device, e.g. on x86 there might be
eth0oreth1. - Execute
ip lto get a list of all interfaces.
- This name is not universal. It depends on the device, e.g. on x86 there might be
In this configuration, lan1 has the VLANs 50 60 70 80 90 tagged assigned to it.
They are all treated as a single interface mesh-interface, thus not bridging the individual VLANs.
uci del gluon.iface_lan.role
uci set gluon.iface_lan_mesh50=interface
uci set gluon.iface_lan_mesh50.name='lan1.50'
uci set gluon.iface_lan_mesh50.role='mesh'
uci commit
gluon-reconfigure
/etc/init.d/network restart
Do not run this script in setup mode.
#!/bin/sh
# Check if VLAN ID is provided
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <INTERFACE> <VLAN_ID>"
exit 1
fi
INTERFACE="$1"
VLAN_ID="$2"
# Remove the role of the /lan pseudointerface
uci del gluon.iface_lan.role
# Add a new VLAN interface to the identified interface
uci set gluon.iface_lan_mesh${VLAN_ID}=interface
uci set gluon.iface_lan_mesh${VLAN_ID}.name="${INTERFACE}.${VLAN_ID}"
uci add_list gluon.iface_lan_mesh${VLAN_ID}.role='mesh'
# Commit the changes and reconfigure the network
uci commit
gluon-reconfigure
/etc/init.d/network restart
echo "VLAN ${VLAN_ID} added to ${INTERFACE} and network reconfigured."