Ubiquiti ERX mit Gluon: Tuning der Switch Config

Ich habe das jetzt hier mal bei einem ERX gemacht.

grafik

in die /etc/rc.local habe ich vor das „exit 0“ eingefügt:

if ( ! batctl if|grep eth0.5 ) ; then 
  echo reinstalling mesh-lan-separation
  uci set network.@switch_vlan[0]=switch_vlan
  uci set network.@switch_vlan[0].device='switch0'
  uci set network.@switch_vlan[0].vlan='1'
  uci set network.@switch_vlan[0].ports='1 6t'
  
  uci set network.@switch_vlan[1]=switch_vlan
  uci set network.@switch_vlan[1].device='switch0'
  uci set network.@switch_vlan[1].vlan='2'
  uci set network.@switch_vlan[1].ports='0 6t'
  
  uci set network.@switch_vlan[2]=switch_vlan
  uci set network.@switch_vlan[2].device='switch0'
  uci set network.@switch_vlan[2].vlan='3'
  uci set network.@switch_vlan[2].ports='2 6t'
  
  uci set network.@switch_vlan[3]=switch_vlan
  uci set network.@switch_vlan[3].device='switch0'
  uci set network.@switch_vlan[3].vlan='4'
  uci set network.@switch_vlan[3].ports='3 6t'
  
  uci set network.@switch_vlan[4]=switch_vlan
  uci set network.@switch_vlan[4].device='switch0'
  uci set network.@switch_vlan[4].vlan='5'
  uci set network.@switch_vlan[4].ports='4 6t'
    
  uci set network.mesh_lan=interface
  uci set network.mesh_lan.igmp_snooping='0'
  uci set network.mesh_lan.ifname='eth0.1'
  uci set network.mesh_lan.index='4'
  uci set network.mesh_lan.proto='gluon_wired'
  uci set network.mesh_lan.transitive='1'
  uci set network.mesh_lan.macaddr=$(echo 1$(uci show network.bat0.macaddr)|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
  uci set network.mesh_lan.disabled='0'
  
  uci set network.mesh_lan2=interface
  uci set network.mesh_lan2.igmp_snooping='0'
  uci set network.mesh_lan2.ifname='eth0.3'
  uci set network.mesh_lan2.index='4'
  uci set network.mesh_lan2.proto='gluon_wired'
  uci set network.mesh_lan2.transitive='1'
  uci set network.mesh_lan2.macaddr=$(echo 1$(uci show network.bat0.macaddr)|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
  uci set network.mesh_lan2.disabled='0'
  
  uci set network.mesh_lan3=interface
  uci set network.mesh_lan3.igmp_snooping='0'
  uci set network.mesh_lan3.ifname='eth0.4'
  uci set network.mesh_lan3.index='4'
  uci set network.mesh_lan3.proto='gluon_wired'
  uci set network.mesh_lan3.transitive='1'
  uci set network.mesh_lan3.macaddr=$(echo 1$(uci show network.bat0.macaddr)|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
  uci set network.mesh_lan3.disabled='0'
  
  uci set network.mesh_lan4=interface
  uci set network.mesh_lan4.igmp_snooping='0'
  uci set network.mesh_lan4.ifname='eth0.5'
  uci set network.mesh_lan4.index='4'
  uci set network.mesh_lan4.proto='gluon_wired'
  uci set network.mesh_lan4.transitive='1'
  uci set network.mesh_lan4.macaddr=$(echo 1$(uci show network.bat0.macaddr)|md5sum|sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
  uci set network.mesh_lan4.disabled='0'
  
  uci set network.mesh_lan.ifname='eth0.1'
  uci set network.mesh_lan2.ifname='eth0.3'
  uci set network.mesh_lan3.ifname='eth0.4'
  uci set network.mesh_lan4.ifname='eth0.5'

  uci commit network
  echo switch separation complete
  sleep 2
  reboot 
 fi

warum so umständlich: Damit nach einem FW-Update das wiederhergestellt wird.

6 „Gefällt mir“