LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-02-2011, 07:55 AM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 266

Rep: Reputation: 19
Unhappy firewall script - problem with resolving


Hi Gurus,

I have a problem with my firewall script.

Code:
#!/bin/sh

# Flushing all rules
iptables -F
iptables -X

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

iptables -P INPUT DROP
iptables -P OUTPUT DROP

iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT


# OPEN PORTS

#SMTP port 25
iptables -A INPUT -p tcp --dport 25 -j ACCEPT

#SMTP port 993
#iptables -A INPUT -p tcp --dport 993 -j ACCEPT

#SMTP port 995
#iptables -A INPUT -p tcp --dport 995 -j ACCEPT

#SMTP port 110
iptables -A INPUT -p tcp --dport 110 -j ACCEPT

#SMTP port 143
iptables -A INPUT -p tcp --dport 143 -j ACCEPT

#HTTP port 80
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p udp --dport 80 -j ACCEPT

iptables -A INPUT -p tcp --dport 443 -j ACCEPT
Could You please tell me why ping google.com(from command line) doesnt work ?
It looks like my firewall blocking something which is responsible for name resolving. What should I change to have possibility for pinging ?



Dlugasx
 
Old 02-02-2011, 09:44 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

Well it simply does not work because you told your firewall to drop every outgoing and incoming packets by default and you have never setup a rule like:
Code:
iptables -A OUTPUT -p icmp --icmp-type 8 -s $SERVER_IP -d 0/0 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 0 -s 0/0 -d $SERVER_IP -m state --state ESTABLISHED,RELATED -j ACCEPT
to enable ICMP requests.

Regards,

Oliv'
 
  


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
Firewall` script problem in RHEL 4 s_hcl Red Hat 1 06-05-2008 09:31 AM
Resolving hardware issues faster with a script? marsm LQ Suggestions & Feedback 1 06-17-2006 12:50 AM
Resolving URL script irfanhab Programming 1 12-08-2005 07:38 AM
slackware's /etc/rc.d/rc.firewall equivalent ||| firewall script startup win32sux Debian 1 03-06-2004 09:15 PM
/etc/hosts resolving before DNS resolving ? markraem Linux - Networking 4 11-02-2003 04:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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