Allow more than one ip through specific port ?
Friends,
I can allow only one ip through specific port like the below way : iptables -I INPUT \! --src 192.168.0.1 -m tcp -p tcp --dport 3000 -j DROP But Now If I want to do the above restriction for more than one IP (like, 0.1, .0.2, 0.3) and reject all other ip , then how can I write the above rules . Plz help ... ... |
You can do it using the iprange module...
Quote:
|
...and another option could be to use the "recent" module and then echo IP addresses into /etc/proc/net/ipt_recent/${LISTNAME}. 'man iptables' (search for "recent") for details.
|
Block a port for specific ips!
Thx fukawi1...
I give the below command to enable a series of IP to nrowse using 3000 port : "iptables -A INPUT -m iprange --src-range 192.168.0.36-192.168.0.56 -p tcp --dport 3000 -j ACCEPT" But it is not working . using the above rules everybody can use 3000 port . But If I use below : "iptables -A INPUT -m iprange --src-range 192.168.0.36-192.168.0.56 -p tcp --dport 3000 -j REJECT" Then its working ,the above ip's are not connected with 3000 port for 36 to 56 ip range . Actually I want the above first one condition where I can give the acceptance some few ip (like 192.168.0.2,192.168.0.30,192.168.0.34) and reject all other ip . Would you plz help me giving example. I am grateful to u ... ... |
All times are GMT -5. The time now is 08:38 PM. |