Mi4C vlan switch config

Any owners of Mi 4C able to config VLAN on the switch or even through bridge filter and willing to show me their network config? All I want is to create a VLAN 10 but any configuration changes to the switch menu or bridge VLAN filtering just crashes the router and locks me out requiring a hard reset.

Without any specifics, it is hard to know if you are creating an invalid configuration or if something else is happening.

If you share your default network config file, we can guide you through the necessary edits.

this is the default config for the Mi 4C at first boot

If I simply add a new VLAN 10 to the switch config the router will not boot.

config device                                  
        option name 'br-lan'                   
        option type 'bridge'                   
        list ports 'eth0.1'                    
config interface 'lan'                         
        option device 'br-lan'                 
        option proto 'static'                  
        option netmask ''         
        option ip6assign '60'         
        option ipaddr ''   
        option gateway ''  
        list dns ''        
config device                         
        option name 'eth0.2'          
        option macaddr '5c:02:14:8f:66:93'
config interface 'wan'                    
        option device 'eth0.2'            
        option proto 'dhcp'               
        option auto '0'                   
config interface 'wan6'                   
        option device 'eth0.2'            
        option proto 'dhcpv6'             
        option auto '0'                   
        option reqaddress 'try'
        option reqprefix 'auto'
config switch                  
        option name 'switch0'  
        option reset '1'       
        option enable_vlan '1' 
config switch_vlan             
        option device 'switch0'
        option vlan '1'        
        option ports '4 2 6t'  
config switch_vlan             
        option device 'switch0'
        option vlan '2'        
        option ports '1 6t'    

What vlan id? What port? Tagged or untagged?

tagged on all LAN ports

It looks like the device is being used as a dumb AP.

You could assign a management IP address to the wan interface and move it to the lan zone to avoid resetting the router every time something goes wrong with the vlan configuration.

Try the following:

uci set network.@device[0].ports='eth0.10'
uci set network.@switch_vlan[0].vlan='10'
uci set network.@switch_vlan[0].vid='10'
uci set network.@switch_vlan[0].ports='4 2t 6t'
/etc/init.d/network restart

The configuration is not saved, so rebooting the device will restore the previous settings.

One of the lan ports is intentionally left untagged so you should be able to use it to access the device at

If everything is OK, save the configuration using uci commit network

1 Like

did not add any vlan 10 to the switch config. I think it's a bug in the firmware.

Commit the changes and refresh the page.

before I do that adding VLAN 10 via LUCI shows me these commands

uci add network switch_vlan # =cfg0e1ec7
uci set network.@switch_vlan[-1].device='switch0'
uci set network.cfg0b1ec7.ports='2 4 6t'

should I still commit your commands?

After running the suggested commands you shouldn't change anything using LuCI. If you didn't lose access to the device after restarting the network service, just commit the changes.

result after commit my VLAN 1 has gone missing.

This one is not winnable. The firmware is screwed up. I tried every firmware version and they are all the same result...strange behavior when configuring the switch.

Thanks for your help anyhow.

Sorry, I didn't understand that you wanted to keep vlan 1, but by doing that you are trying to mix tagged and untagged frames on the same physical interface, which is most likely the reason for the strange behavior...

how do I add an additional VLAN to the switch using uci set ?

nevermind...I had to add in the VLAN into the /etc/config/network first then use your UCI commands to tag the ports. It worked out in the end.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.