LinuxQuestions.org
Help answer threads with 0 replies.
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 08-18-2003, 03:01 AM   #1
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Rep: Reputation: 15
No one can ping me, but I cannot ping them!


Hello, I'll make it short and sweet.

I have this firewall rule setup on my computer, but for some strange reason I cannot ping outside of my network. It was designed to stop people pinging me but instead I find I'm having trouble pinging out.

Here is the rule I'm using:
------------------<snipet>-------------------
iptables --append INPUT --protocol icmp --in-interface ppp0 --jump REJECT --reject-with icmp-net-unreachable
------------------<snipet>-------------------

Any help is greatly appreciated
 
Old 08-18-2003, 03:19 AM   #2
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
this rule will also block the ping reply, i.e., you can send ECHO REQUEST, but can't receive the ECHO REPLY because the rule is blocking inbound ICMP.

Therefore, in effect, you can't ping outside your network with that rule in place.
 
Old 08-18-2003, 03:27 AM   #3
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Original Poster
Rep: Reputation: 15
Ahhh I understand now. Takes awhile for me to grasp these networking concepts. Could any perhaps suggest a more sensible rule?
 
Old 08-18-2003, 03:35 AM   #4
jalal
Member
 
Registered: Aug 2003
Location: .bh
Distribution: Gentoo
Posts: 188

Rep: Reputation: 30
hmm, you can try adding this instead:

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

and setting the input policy to drop.

iptables -P INPUT DROP

this will allow replies to any request you send, while not allowing any request to get to your machine.
 
Old 08-19-2003, 01:35 AM   #5
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Original Poster
Rep: Reputation: 15
That last rule you gave me prevented ethernet connections, and I want those so here is a rule that prevents ppp0 but allows everything else to make new connections...

# Create chain which blocks new connections, except if coming from inside
iptables --new-chain block
iptables --append block --match state --state ESTABLISHED,RELATED --jump ACCEPT
iptables --append block --match state --state NEW --in-interface ! ppp0 --jump ACCEPT
iptables --append block --jump DROP

# Jump to that chain from INPUT and FORWARD chains.
iptables --append INPUT --jump block
iptables --append FORWARD --jump block

This so far seems to work fine.
 
Old 08-20-2003, 02:42 AM   #6
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Original Poster
Rep: Reputation: 15
Hrrm!

That last rule I posted works with everything but a few IRC servers, namely austnet. Why would this be? Can anybody suggest a better rule?
 
Old 08-20-2003, 05:39 PM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
What you could do is add a LOG target rule before making "final verdicts" in a chain. This will help you troubleshoot what gets DROPped instead of ACCEPTed. Like ident requests (TCP/113) most IRC servers need a response for, for example.
 
Old 08-21-2003, 03:23 AM   #8
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Original Poster
Rep: Reputation: 15
You are probably right, would you have any practical examples of how this is achieved?
 
Old 08-21-2003, 04:29 AM   #9
danielw
Member
 
Registered: Jul 2003
Location: Australia
Distribution: CRUX
Posts: 35

Original Poster
Rep: Reputation: 15
I added this exception to my previous firewall rule (quoted below)

* iptables --append block --match state --state NEW --protocol tcp --destination-port 113 --jump ACCEPT

Quote:
# Create chain which blocks new connections, except if coming from inside
iptables --new-chain block
iptables --append block --match state --state ESTABLISHED,RELATED --jump ACCEPT
iptables --append block --match state --state NEW --in-interface ! ppp0 --jump ACCEPT
iptables --append block --jump DROP

# Jump to that chain from INPUT and FORWARD chains.
iptables --append INPUT --jump block
iptables --append FORWARD --jump block
I'm happy to say that it seems to be working now.
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
Any idea why this time I can not ping my LAN pc but can PING for ex. www.yahoo.com vakia Debian 5 09-28-2005 06:42 PM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
I can ping google.com successfully,but ping client(in my intranet) failed.Why? whepin Linux - Newbie 4 12-30-2001 04:54 AM

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

All times are GMT -5. The time now is 06:46 AM.

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