Virtual APs

I have two potentially separate requirements

1st - I want to be able to route to a network using the wireless as the WAN and DHCP server on the LAN. I wasn’t able to find anything in quickset that facilitated this, but I think I can figure this out on my own (but if anyone has a quick pointer to a wiki article, I’d be much obliged)

2nd - (different box) I want to be able to configure virtual access points that are either rate limited with regard to their WAN connection (wired ethernet port this time) or have a virtual access point be disabled/deleted after a certain amount of traffic has been passed over the virtual access point.

#1 is easy; #2, I don’t even know where to begin.

Thanks in advance…

2nd - (different box) I want to be able to configure virtual access points that are either rate limited with regard to their WAN connection (wired ethernet port this time) or have a virtual access point be disabled/deleted after a certain amount of traffic has been passed over the virtual access point.

I rate limit my home guest network (a virtual ap named wlan2) as follows:

/queue simple
add max-limit=256k/512k name=GuestNet queue=wireless-default/wireless-default target=wlan2 total-queue=wireless-default

If you absolutely must disable/delete the virtual ap , try the following:

/ip firewall filter
add action=passthrough chain=forward in-interface=wlan2 comment=wlan2in
add action=passthrough chain=forward out-interface=wlan2 comment=wlan2out

Additionally, create a scheduler script that runs at startup:

# set the following two values to the maximum MBs of data to trigger the disabling of the interface
:local maxMBin 100
:local maxMBout 500

:local maxBin ($maxMBin * 1000000)
:local maxBout ($maxMBout * 1000000)
:while (([:tonum value=[/ip firewall filter get [find comment=wlan2in] bytes]] < $maxBin) && ([:tonum value=[/ip firewall filter get [find comment=wlan2out] bytes]] < $maxBout)) do={}

The next part of the above script depends on wether you want to delete or disable the virtual ap. To delete, append the following:

/interface wireless remove [find name=wlan2]
/ip firewall filter remove [find comment=wlan2in]
/ip firewall filter remove [find comment=wlan2out]

To disable, append the following instead of the previous code snippet:

/interface wireless set [find name=wlan2] disabled=yes
/ip firewall filter set [find comment=wlan2in] disabled=yes
/ip firewall filter set [find comment=wlan2out] disabled=yes
/ip firewall filter reset-counters  [find comment=wlan2in]
/ip firewall filter reset-counters  [find comment=wlan2out]

If you are trying to do all this just to kick a user off after a certain data transfer, perhaps you could examine hotspot for it’s built in capabilities to disable or rate limit users based on data transfer.