LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-13-2013, 11:44 PM   #1
tris_halo
LQ Newbie
 
Registered: Jul 2013
Posts: 5

Rep: Reputation: Disabled
block ping from host to host using iptables (I am the wireless access point)


I'm really new to networking and linux system. So please help me in this:
- I have my phone acted as the wireless access point, and other devices like all my LAPTOPs connected to it to create a LAN network. How can I use iptables to block (for example ping request, reply) from host to host.

P/s: I also try to block forward chain using
iptables -A FORWARD -j DROP
But it doesn't work. Host A can still ping to Host B. The blocking forward chain only helps me to block them (hosts in LAN) access the internet.
 
Old 07-14-2013, 11:43 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
IPtables is capable of working specifically with ICMP commands such as ping. For example, this will accept ping:
Code:
-A INPUT -p icmp -m icmp --icmp-type 8 -m state --state NEW,RELATED,ESTABLISHED -j accept
You can change the rules as desired. For example you can add a -s or -d to specify the source and/or destination, or you can specify an interface with -i (your modem probably uses a pseudo interface like ppp0).

See the following for more detailed information: http://www.cyberciti.biz/tips/linux-...icmp-ping.html
 
  


Reply



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] ping reply unknown host but dig and host return correct IP kathy_lo Linux - Networking 6 11-18-2012 07:12 PM
Why does NMAP report â??Host seems downâ? despite host responding to ping? android-eve Linux - Networking 5 11-21-2011 02:35 PM
Forwarding ping packets from one 1st host to 2nd host via 2rd host sachee Linux - Networking 1 09-25-2011 01:51 PM
[SOLVED] Ping from Vmware host to Virtual Box host greatcyrus Linux - Virtualization and Cloud 7 03-09-2011 02:03 AM
Bind9 ,host does reslove a dns name but ping says unknown host Byenary Linux - Networking 10 01-12-2011 01:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:41 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