block all IPs except one how in my setup??
hello,
How to prevent my RH9 linux machine to send packets to any internal private 10.0.*.* host ips? I have one LAN in which all machines connected to switch and ther are may LANs in my Organisation. Now i want traffic from pc should only be given to an other pc in my same LAN where i know that require me crossover cable but is that possible??? In simple words, Block all IPs except one which is allowed to communicate to my pc |
/sbin/iptables -I INPUT -s ! 10.0.0.1 -j DROP
change 10.0.0.1 to the ip of the machine allowed to communicate |
hello,
Ok how to modify iptables -I INPUT -s ! 10.0.0.1 -j DROP to allow only 10.0.0.1 to have communication with me as 10.0.0.100 with condition that any other ips excluding 10.0. network? That mean if i ping 172.16.*.* and 192.168.*.* from my 10.0.0.100 its must be allowed but in 10.*.*.* range only 10.0.0.1 alllowed How to do that? |
You mean you want to only limit connect to the 10.0.0.1 host in the 10.x.x.x network, while all hosts from other networks such as 172.16.x.x/192.168.x.x are unrestricted?
ok simple, add these 2 rules on top: Code:
iptables -I INPUT -s 172.16.0.0/16 -j ACCEPT |
All times are GMT -5. The time now is 11:57 AM. |