iptable rules not blocking
Posted
by
psychok7
on Server Fault
See other posts from Server Fault
or by psychok7
Published on 2012-10-19T02:59:32Z
Indexed on
2012/10/19
5:06 UTC
Read the original article
Hit count: 121
iptables
so i am trying to allow ssh access to a certain range of ips (from 192.168.1.1 to 192.168.1.24) and block all the rest but since i am new to iptables i can't seem to figure, i have :
iptables -A INPUT -s 192.168.1.0/24 -p udp --dport ssh -j ACCEPT
iptables -A INPUT -s 192.168.1.0/24 -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -p tcp --dport ssh -j REJECT
iptables -A INPUT -p udp --dport ssh -j REJECT
but this does not work, with a vm set with 192.168.1.89 i can still access through ssh. can someone help?
© Server Fault or respective owner