Block an IP for a subnet by iptables

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Block an IP for a subnet by iptables
# 1  
Old 04-25-2014
RedHat 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 from Lab should be access to this incomming IP.



Block IP=10.20.50.xx
Subnet=10.30.40.xx
............................
...........................
Subnet=10.40.50.xx

can anyone explain how to do this by linux Iptables?

Thanks in Advance
# 2  
Old 04-25-2014
Although I've not used this yet, but will be doing so shortly, I would think that the logic should be to deny everything as default then just allow what you want to come in.



Robin
# 3  
Old 05-21-2014
Code:
iptables -A INPUT -s 10.20.50.0/24 -j DROP


Last edited by Franklin52; 05-22-2014 at 03:57 AM.. Reason: Please use code tags, thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Linux

How to block only one IP using iptables?

Hi friends, I have a linux machine without iptables running and we have a new requirement to block a remote machine ( IP = 172.1.1.1 ) completely accessing our linux machine in both directions. So I need to allow "everything" except that IP address. So i tried below: If I set the below in... (3 Replies)
Discussion started by: magnus29
3 Replies

2. IP Networking

Migrating existing Subnet to a new subnet and changing ip addresses in UNIX

Hi, My project needs to migrate the existing Subnet (255.255.255.0) to a new subnet and change the ipaddresses (currently C class). How can I do that. I need some information. John (0 Replies)
Discussion started by: johnmarsh
0 Replies

3. Cybersecurity

iptables: block/allow ftp

I have 2 LAN's, seperated by a firewall, running iptables on it. I want only allow ftp access from one to the other LAN. Server 1 in LAN 1 should have ftp access to Server 2 in LAN 2 Server 2 in LAN 2 should not have ftp access to Server 1 in LAN 1. Can someone tell me how to set up the... (5 Replies)
Discussion started by: sTorm
5 Replies
Login or Register to Ask a Question