OK, you sent me to the right track searching through this forum. I was able to find lots of articles and tips and finally understood how this can be done. I wrote the following script and got it working. Just thought to share it here.
/jffs/scripts/dnsmasq.conf.add
except-interface=vlan20
/jffs/scripts/nat-start
#!/bin/sh
# /jffs/scripts/nat-start
#
#
https://github.com/RMerl/asuswrt-merlin.ng/wiki/User-scripts
#
https://github.com/RMerl/asuswrt-merlin.ng/wiki
# Excellent info on internals of AC-RT68U
https://coertvonk.com/sw/networking/dd-wrt-heading-two-networks-asus-rt-ac68u-11717
#
# nvram show | grep vlan.*ports | sort
# vlan1ports=1 2 3 4 5*
# vlan2ports=0 5
#
# robocfg show # shows VLAN information
# ...
# vlan1: 1 2 3 4 5t
# vlan2: 0 5
# vlan56: 1t 5t 7 8t
# vlan57: 0t 2t 5t 8t
# vlan58:
# vlan59: 2t 8t
# vlan60: 0 1t 7t 8t
# vlan61: 4t 8t
# vlan62: 0t 1 7t 8t
#
# brctl show # Shows bridge information
# bridge name bridge id STP enabled interfaces
# br0 8000.e03f49280ad8 yes vlan1
# eth1
# eth2
# tap21
#
# Port 0 = WAN
# Port 1-4 = LAN
# Port 5 = CPU: connects the VLAN trunk from the switch to interface eth0 on the CPU
# VLAN 1 = LAN Ports 1-4 + CPU
# VLAN 2 = WAN + CPU
# br0 = LAN bridge, including AP radio
# eth0 - LAN
# eth1 - 2.4G Wifi
# eth2 - 5G Wifi
#
# The switch tags incoming frames with a VLAN identifier. Frames arriving on the WAN port are tagged as VLAN2,
# while frames from the LAN ports are tagged as VLAN1. The frames destined for the CPU are sent on CPU internal
# port 5.
# The CPU receives the frames over port eth0. Frames with a VLAN2 tag are treated as WAN traffic. Frames with a
# VLAN1 tag are combined (bridged) with frames from the wireless module (eth1) and treated as LAN traffic.
#
# Log everything within ()
/usr/bin/logger "================== NAT START ==================="
# Checks if VLAN20 already exists within robocfg and then only executes if it's not already there
# Useful for starting and stopping services manually to test
robocfg show | grep -i vlan20 > /dev/null 2>&1 || \
(
/usr/bin/logger "========= ROBOCFG"
# Remove Port 2 from vlan1
robocfg vlan 1 ports "1 3 4 5t"
# Assign Port 2 to vlan20 and tag with the CPU
robocfg vlan 20 ports "2 5t"
/usr/bin/logger "====== VCONFIG"
# Create VLAN20
vconfig add eth0 20 || /usr/bin/logger "VLAN 20 already exists"
/usr/bin/logger "====== IFCONFIG"
# Bring VLAN20 up (note that dnsmasq has already been configured for this address)
ifconfig vlan20 up
# Use the following if wanting to assign IP range
#ifconfig vlan20 up 192.168.11.0 netmask 255.255.255.0 up
/usr/bin/logger "====== BRCTL"
# Add the interface to the bridge
brctl addif br0 vlan20
# if wanting complete separation of port 2, establish a separate bridge
# brctl addbr br1
# brctl addif br1 vlan20
# ifconfig br1 up
# Restart services, do this if changing nvram settings
#killall eapd
#eapd
)
/usr/bin/logger "=================== NAT DONE ==================="