i using linksys e1200 with openwrt. i set the router to static ip and i am using mac address filter .
now can i use IP filter by implement iptables rules ?
i thought about something like this
this will work ?
iptables -P FORWARD 192.168.1.5 -j ACCEPT
iptables -A INPUT -s 192.168.1.5 -j ACCEPT
iptables -A OUTPUT -d 192.168.1.5 -j ACCEPT
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
No. These rules will lock you out from internet.
The INPUT chain is for incoming connections from internet to lan.
The OUTPUT chain is for outgoing connection from lan to internet
iptables -A INPUT -d 192.168.1.5 -j ACCEPT
iptables -A OUTPUT -s 192.168.1.5 -j ACCEPT
will work
However I am not sure about this one:
iptables -P FORWARD -d 192.168.1.5 -j ACCEPT
Please also check first the iptables -L command before typing any of the commands.
These rules should be before your default drop rule. Use iptables insert command to insert them into the table. The -A is append and it appends the rule as last in the table.
The INPUT handles connections from any interface to the device itself. Likewise the OUTPUT handles egress traffic originating from the device. All transit traffic from one interface to another (or zone if you prefer) is handled in FORWARD.