Android Hotspot with MAC Filtering.

I use Wifi Hotspot where I like to filter certain devices from my access point. The best way is through MAC filtering. I used the code to output the device from the kernel using

try {
                String mac=macfilter.getText().toString();
                proc1 = Runtime.getRuntime().exec("/sbin/iptables -A INPUT -p tcp --dport PORT -m mac ! --mac-source "+mac+" -j DROP");
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

where mac is the line that I used to store the MAC address of the device that I want to remove from my hotspot. But the code does not give an answer. Can someone help me find the right solution

+3
source share

All Articles