Bookmark

Adding a VLAN to Guest Wi-Fi on Xiaomi AX9000 Stock Firmware

  • I am using a Xiaomi AX9000. Xiaomi's stock firmware has many limitations. I tried several custom firmware options, from official OpenWrt builds to Qualcomm-based QSDK versions, but none of the AX9000 builds I tested was stable enough. The stock firmware remains the most practical choice for this setup.
  • Xiaomi firmware is also based on OpenWrt, although it has been heavily customized. This makes it possible to configure some functions directly in the system without using Xiaomi's normal web interface.
  • After reading the wiki and other references, I successfully configured a VLAN on the Xiaomi AX9000.
  • This guide is not intended for beginners.

I. Overview

  • SSH is enabled on the Xiaomi AX9000.
  • The Xiaomi AX9000 is running in AP mode.
  • The main router is RouterOS (MikroTik), with VLAN 10 configured for Guest using 10.0.3.0/24 and the main LAN using 10.0.0.1/23.
  • The AX9000 WAN port is connected to the MikroTik router. The remaining AX9000 ports are used by a PC and a TV on the main LAN.
  • The guest Wi-Fi added to the AX9000 is assigned to VLAN 10. Clients connected to it receive addresses from 10.0.3.0/24 through the main router.
These values depend on your network. Other Xiaomi routers may use a similar approach, but the exact configuration is not guaranteed because the CPU, switch, and vendor changes can affect the commands.

II. Configuration

The two main files to edit are /etc/config/network and /etc/config/wireless.

After editing, the relevant contents are as follows. The added VLAN configuration is highlighted in the original structure.

/etc/config/network

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config switch
	option name 'switch0'

config interface 'lan'
	option force_link '1'
	option type 'bridge'
	option proto 'static'
	option multicast_querier '0'
	option igmp_snooping '0'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option ipaddr '10.0.0.3'
	option netmask '255.255.254.0'
	option gateway '10.0.0.1'
	option mtu '1500'
	option ifname 'eth0 eth1 eth2 eth3 eth4'

config interface 'eth0'
	option ifname 'eth0'

config interface 'eth1'
	option ifname 'eth1'

config interface 'eth2'
	option ifname 'eth2'

config interface 'eth3'
	option ifname 'eth3'
	option keepup '1'

config interface 'eth4'
	option ifname 'eth4'
	option keepup '1'

config device
	option type '8021q'
	option ifname 'eth4'
	option vid '10'
	option name 'eth4.10'

config interface 'vlan10'
	option type 'bridge'
	option ifname 'eth4.10'
	option proto 'static'
	option ipaddr '10.0.3.2'
	option netmask '255.255.255.0'
	option gateway '10.0.3.1'
	list dns '10.0.0.4'

  • Explanation:
    • Lines 40-44: tag VLAN ID 10 on eth4, the 2.5G port on the router.
    • Lines 46-53: assign the static address 10.0.3.2, gateway 10.0.3.1, and netmask 255.255.255.0 (/24) to the VLAN interface. The main MikroTik router uses 10.0.3.0/24 for Guest. DNS is 10.0.0.4, the AdGuard Home server used across the LAN; the DNS line can be removed if it is not needed.

/etc/config/wireless

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
config wifi-device 'wifi0'
	option type 'qcawificfg80211'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option hwmode '11axa'
	option htmode 'HT80'
	option country 'CN'
	option disabled '0'
	option txpwr 'max'
	option txbf '3'
	option ax '1'
	option bw '0'
	option channel '0'
	option autoch '2'

config wifi-iface
	option device 'wifi0'
	option ifname 'wl0'
	option network 'lan'
	option mode 'ap'
	option wpsdevicename 'XiaoMiRouter'
	option channel_block_list '36,40,44,48,52,56,60,64,165'
	option macfilter 'disabled'
	option miwifi_mesh '0'
	option disabled '0'
	option bsd '0'
	option rrm '0'
	option wnm '0'
	option ssid 'Xiaomi AX9000_5G'
	option encryption 'psk2'
	option key 'xxxxxxxx'
	option wscconfigstatus '2'
	option hidden '0'

config wifi-device 'wifi1'
	option type 'qcawificfg80211'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option hwmode '11axg'
	option htmode 'HT40'
	option country 'CN'
	option disabled '0'
	option txpwr 'max'
	option txbf '3'
	option ax '1'
	option channel '0'
	option autoch '2'
	option bw '0'

config wifi-iface
	option device 'wifi1'
	option ifname 'wl1'
	option network 'lan'
	option mode 'ap'
	option wpsdevicename 'XiaoMiRouter'
	option intop '1'
	option vht_mcs_10_11 '1'
	option amsdu '2'
	option macfilter 'disabled'
	option bsd '0'
	option rrm '0'
	option wnm '0'
	option ssid 'Xiaomi AX9000'
	option encryption 'psk2'
	option key 'xxxxxxxx'
	option wscconfigstatus '2'
	option disabled '0'
	option hidden '0'

config wifi-iface
	option device 'wifi1'
	option ifname 'wl10'
	option network 'vlan10'
	option mode 'ap'
	option ssid 'WIFI Khach - Free WIFI'
	option encryption 'none'
	option disabled '0'
	option hidden '0'

config wifi-device 'wifi2'
	option type 'qcawificfg80211'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option hwmode '11axa'
	option htmode 'HT80'
	option country 'CN'
	option disabled '0'
	option txpwr 'max'
	option txbf '3'
	option ax '1'
	option channel '0'
	option autoch '2'
	option disabled '1'

config wifi-iface
	option device 'wifi2'
	option ifname 'wl2'
	option network 'lan'
	option mode 'ap'
	option wpsdevicename 'XiaoMiRouter'
	option channel_block_list '52,56,60,64,149,153,157,161,165'
	option macfilter 'disabled'
	option miwifi_mesh '0'
	option bsd '0'
	option rrm '0'
	option wnm '0'
	option ssid 'Xiaomi_4DC5_5G_Game'
	option encryption 'psk2'
	option key 'xxxxxxxx'
	option wscconfigstatus '2'
	option disabled '1'
	option hidden '0'

config wifi-device 'wifi3'
	option type 'qcawificfg80211'
	option channel 'auto'
	option macaddr 'xx:xx:xx:xx:xx:xx'
	option hwmode '11ac'
	option htmode 'HT20'
	option country 'CN'
	option disabled '0'
	option txpwr 'max'
	option txbf '3'
	option ax '0'
	option dbglog_disable '1'
	option disabled '1'

config wifi-iface
	option device 'wifi3'
	option ifname 'wl3'
	option mode 'sta'
	option ssid 'MIIOT_DEV'
	option encryption 'none'
	option wpsdevicename 'XiaoMiRouter'
	option disabled '1'

config wifi-iface 'miot_2G'
	option ifname 'wl33'
	option network 'miot'
	option encryption 'none'
	option device 'wifi1'
	option mode 'ap'
	option hidden '1'
	option maxsta '20'
	option ssid '25c829b1922d3123_miwifi'
	option bsd '0'
	option disabled '1'
	option ap_isolate '1'

  • Explanation:
    • Lines 68-76 create a new open Wi-Fi network named WIFI Khach - Free WIFI, using wifi1, which corresponds to the 2.4 GHz radio.

After editing both files, run:

1
/etc/init.d/network reload

The configuration should survive a reboot. Avoid reopening the Xiaomi web-management interface, because it may overwrite the manual configuration and force you to repeat the work.

Source

OpenWrt Wiki — Switch configuration


0 Bình luận

Góp Ý / Bình Luận / Đánh giá