LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 03-16-2005, 12:26 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
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
 
Old 03-16-2005, 02:38 AM   #2
Demonbane
Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
/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
 
Old 03-17-2005, 12:05 AM   #3
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Original Poster
Rep: Reputation: 30
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?
 
Old 03-20-2005, 03:24 PM   #4
Demonbane
Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
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
iptables -I INPUT -s 192.168.0.0/24 -j ACCEPT
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
block ips in valknut kb_ganesh Linux - Networking 0 12-01-2005 10:36 AM
want to block some prots on some IPs......? shahg_shahg Linux - Networking 1 07-01-2005 12:38 PM
How to block specific IPs? cranium2004 Linux - Networking 3 04-01-2005 09:02 AM
howto block IPs from my machine totaly w0lv3rin3 Linux - Software 4 02-22-2005 06:49 PM
Block list of IPs with SuSEFIREWALL2 mephitic Linux - Security 1 12-05-2004 01:50 AM


All times are GMT -5. The time now is 12:55 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration