OK
copy & paste to your device & reboot
edit:
vlan1 is untagged on all LAN
LAN4 is trunk
since we still using "fantasy name" 'lan', dhcp server on vlan1 will work out of box
for other vlan's, you will need to setup dhcp server from LuCI
/etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config device
option name 'lan1'
option macaddr 'e8:9f:80:a2:c6:fa'
config device
option name 'lan2'
option macaddr 'e8:9f:80:a2:c6:fa'
config device
option name 'lan3'
option macaddr 'e8:9f:80:a2:c6:fa'
config device
option name 'lan4'
option macaddr 'e8:9f:80:a2:c6:fa'
config device
option name 'wan'
option macaddr 'e8:9f:80:a2:c6:f9'
config device
option type 'bridge'
option vlan_filtering '1'
option name 'br-lan'
list ports 'lan1'
list ports 'lan2'
list ports 'lan3'
list ports 'lan4'
config bridge-vlan
option device 'br-lan'
option vlan '1'
list ports 'lan1:u*'
list ports 'lan2:u*'
list ports 'lan3:u*'
list ports 'lan4:u*'
config bridge-vlan
option device 'br-lan'
option vlan '10'
list ports 'lan4:t'
config bridge-vlan
option device 'br-lan'
option vlan '20'
list ports 'lan4:t'
config bridge-vlan
option device 'br-lan'
option vlan '30'
list ports 'lan4:t'
config bridge-vlan
option device 'br-lan'
option vlan '40'
list ports 'lan4:t'
config interface 'lan'
option device 'br-lan.1'
option proto 'static'
option ipaddr '192.168.5.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'vlan10'
option device 'br-lan.10'
option proto 'static'
option ipaddr '192.168.10.1'
option netmask '255.255.255.0'
config interface 'vlan20'
option device 'br-lan.20'
option proto 'static'
option ipaddr '192.168.20.1'
option netmask '255.255.255.0'
config interface 'vlan30'
option device 'br-lan.30'
option proto 'static'
option ipaddr '192.168.30.1'
option netmask '255.255.255.0'
config interface 'vlan40'
option device 'br-lan.40'
option proto 'static'
option ipaddr '192.168.40.1'
option netmask '255.255.255.0'
config interface 'wan'
option device 'wan'
option proto 'dhcp'
config interface 'wan6'
option device 'wan'
option proto 'dhcpv6'
/etc/config/wireless
config wifi-iface 'wifinet0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option ssid 'AP24G'
option encryption 'psk2'
option key 'Vlan1Pass'
option wmm '1'
option short_preamble '1'
option disassoc_low_ack '0'
option max_inactivity '120'
option isolate '1'
option disabled '0'
option ifname 'wlan0'
option multicast_to_unicast_all '1'
config wifi-iface 'wifinet1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option ssid 'AP58G'
option encryption 'psk2'
option key 'Vlan1Pass'
option wmm '1'
option short_preamble '1'
option disassoc_low_ack '0'
option max_inactivity '120'
option isolate '1'
option disabled '0'
option ifname 'wlan1'
option multicast_to_unicast_all '1'
config wifi-vlan
option name 'vl10'
option network 'vlan10'
option vid '10'
config wifi-station
option key 'Vlan10Pass'
option vid '10'
config wifi-vlan
option name 'vl20'
option network 'vlan20'
option vid '20'
config wifi-station
option key 'Vlan20Pass'
option vid '20'
config wifi-vlan
option name 'vl30'
option network 'vlan30'
option vid '30'
config wifi-station
option key 'Vlan30Pass'
option vid '30'
config wifi-vlan
option name 'vl40'
option network 'vlan40'
option vid '40'
config wifi-station
option key 'Vlan40Pass'
option vid '40'