Block an IP for a subnet by IPtables
Hi
I am looking to block an incomming IP for all the subnet in lab area. only single Ip should be access to this incomming IP. Block IP=10.20.50.xx Subnet=10.30.40.xx can anyone explain how to do this by linux Iptables? |
|
Its didn't help me what i was expecting. Ip calculating is different from Ip blocking.
Anyone has the comment on this? |
Quote:
Code:
ipcalc 10.20.50.00 Code:
for i in 10.20.50.0/24 ; do iptables -I INPUT -s $i -j DROP ; done |
Sorry for delayed responses.
My query is different rather below answered. for i in 10.20.50.0/24 ; do iptables -I INPUT -s $i -j DROP ; done My network(subnet) should be blocked to accessing the incomming rather than blocking the incommings. AnYone have any comment now? |
All times are GMT -5. The time now is 08:58 PM. |