So, I got around replacing my old Airport Express when a good deal for a Asus AC68U came around.
I have a server at home that is functioning as Firewall, DNS, DHCP etc. My DHCP server only accept DHCP requests from known clients and I also have a MAC filter for connecting to my wireless network.
With my old solution, whenever someone new wanted to connect to my wireless network, I'd have to add them first in the DHCP server and then to the MAC filter on the AirPort Express.
Being able to run Linux on the AP I thought I could automate the second part of the process, e.g. adding the client MAC to the MAC filter on the AP.
I created a script that every 10 minute login to the DHCP server and parses the host and MAC address for the clients it accepts.
If nothing has changed, then nothing is changed on the AP.
I didn't find much information of people already have done this, so I'd thought I share. I went through the web guy code (which is really, really ugly) to find out what was done when changing the MAC filter.
The script assumes that you want to have the same MAC addresses both for 2.4 and 5 GHz filters. It also assumes that the user you're connecting with has a public key that has been added to ~/.ssh/authorized_keys on the DHCP server.
If you don't want the script, but want to know how it's done, in short:
https://github.com/mgor/asuswrt-scripts
I have a server at home that is functioning as Firewall, DNS, DHCP etc. My DHCP server only accept DHCP requests from known clients and I also have a MAC filter for connecting to my wireless network.
With my old solution, whenever someone new wanted to connect to my wireless network, I'd have to add them first in the DHCP server and then to the MAC filter on the AirPort Express.
Being able to run Linux on the AP I thought I could automate the second part of the process, e.g. adding the client MAC to the MAC filter on the AP.
I created a script that every 10 minute login to the DHCP server and parses the host and MAC address for the clients it accepts.
If nothing has changed, then nothing is changed on the AP.
I didn't find much information of people already have done this, so I'd thought I share. I went through the web guy code (which is really, really ugly) to find out what was done when changing the MAC filter.
The script assumes that you want to have the same MAC addresses both for 2.4 and 5 GHz filters. It also assumes that the user you're connecting with has a public key that has been added to ~/.ssh/authorized_keys on the DHCP server.
If you don't want the script, but want to know how it's done, in short:
Code:
maclist="<mac1>client1<mac2>client2"
nvram set wl_maclist_x=$maclist
nvram set wl0_maclist_x=$maclist
nvram set wl1_maclist_x=$maclist
nvram set x_Setting=1
nvram set w_Setting=1
nvram commit
service restart_wireless
https://github.com/mgor/asuswrt-scripts