LinuxQuestions.org
Visit Jeremy's Blog.
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 05-07-2011, 02:23 AM   #1
krlos07
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Iptables Drop Icmp


Hi People Forum,

I have one machine with deux address ip's in eth1.

address ip 1 10.10.10.10
address ip 2 20.20.20.20

How i can only pcs with address 10.0.0.0/24 can ping 10.10.10.10 and pcs with address 20.0.0.0/24 can ping only 20.20.20.20.

par example
Quote:
#iptables -A INPUT 10.0.0.0/24 10.0.0.0/24 ACCEPT
#iptables -A INPUT 10.0.0.0/24 20.0.0.0/24 DROP
Quote:
#iptables -A OUTPUT 10.0.0.0/24 10.0.0.0/24 ACCEPT
#iptables -A OUTPUT 10.0.0.0/24 20.0.0.0/24 DROP
Thanks in Advance
 
Old 05-07-2011, 02:49 AM   #2
systemlordanubis
Member
 
Registered: Jun 2010
Distribution: Debian, Ubuntu, Win
Posts: 143

Rep: Reputation: 16
If I'm reading your question correctly you want to block users in 10.0.0.0/24 from being able to ping the address 20.0.0.0/24. If this is the case, the code below should do what you need.

Iptables -I INPUT -s 10.0.0.0/24 -d 10.0.0.0/24 -j ACCEPT
Iptables -I INPUT -s 10.0.0.0/24 -d 20.0.0.0/24 -j DROP

Hope this helps
Anubis.
 
Old 05-09-2011, 11:01 AM   #3
krlos07
LQ Newbie
 
Registered: May 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by systemlordanubis View Post
If I'm reading your question correctly you want to block users in 10.0.0.0/24 from being able to ping the address 20.0.0.0/24. If this is the case, the code below should do what you need.

Iptables -I INPUT -s 10.0.0.0/24 -d 10.0.0.0/24 -j ACCEPT
Iptables -I INPUT -s 10.0.0.0/24 -d 20.0.0.0/24 -j DROP

Iptables -I OUTPUT -s 10.0.0.0/24 -d 10.0.0.0/24 -j ACCEPT
Iptables -I OUTPUT -s 10.0.0.0/24 -d 20.0.0.0/24 -j DROP

Hope this helps
Anubis.


Thanks!
 
  


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
[SOLVED] Iptables: icmp and fragmented icmp rule matching Cenobite Linux - Networking 2 02-03-2011 03:37 AM
how to drop incomming icmp request sunlinux Linux - Networking 5 12-01-2006 06:26 AM
iptables - drop all -> allow needed OR allow all -> drop specific lucastic Linux - Security 5 12-21-2004 02:07 AM
iptables DROP icmp applied, still being pinged linuxistan Linux - Networking 3 10-18-2004 10:26 PM
iptables icmp limits dunkyb Linux - Security 0 05-08-2003 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:38 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration