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 01-08-2011, 02:03 AM   #1
deltamaster
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
I have some trouble while applying iptables firewall rules


As you can see in the operation below:
I've make some rules in iptables and have them saved.
Then, I restarted iptables but got the following error information.
Applying iptables firewall rules: [FAILED]
Obviously the rules are not loaded.
Then I tried restoring them from the saved file, and got a success.
What could be the reason of the failure?

OS: red hat enterprise linux 5

Thank you.

Code:
[root@station19 certs]# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
REJECT     tcp  -- !192.168.0.0/24       0.0.0.0/0           tcp dpt:995 reject-with icmp-port-unreachable 
REJECT     udp  -- !192.168.0.0/24       0.0.0.0/0           udp dpt:995 reject-with icmp-port-unreachable 
REJECT     udp  -- !192.168.0.0/24       0.0.0.0/0           udp dpt:993 reject-with icmp-port-unreachable 
REJECT     tcp  -- !192.168.0.0/24       0.0.0.0/0           tcp dpt:993 reject-with icmp-port-unreachable 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
[root@station19 certs]# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [FAILED]
[root@station19 certs]# iptables-restore < /etc/sysconfig/iptables
[root@station19 certs]# iptables -L -n
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
REJECT     tcp  -- !192.168.0.0/24       0.0.0.0/0           tcp dpt:995 reject-with icmp-port-unreachable 
REJECT     udp  -- !192.168.0.0/24       0.0.0.0/0           udp dpt:995 reject-with icmp-port-unreachable 
REJECT     udp  -- !192.168.0.0/24       0.0.0.0/0           udp dpt:993 reject-with icmp-port-unreachable 
REJECT     tcp  -- !192.168.0.0/24       0.0.0.0/0           tcp dpt:993 reject-with icmp-port-unreachable 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
 
Old 01-09-2011, 06:11 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by deltamaster View Post
As you can see in the operation below: I've make some rules in iptables and have them saved. (..) What could be the reason of the failure?
No, we can't see that. We only see 'iptables' output, not the exact contents of your /etc/sysconfig/iptables* files, so anything trying to address the issue will remain speculation.
 
Old 01-09-2011, 11:45 AM   #3
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Post the contents of /etc/sysconfig/iptables. It is easier to read then the output from the CLI.
 
  


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
Problem on applying iptables rules hdinn Programming 5 03-12-2010 10:50 AM
Applying iptables firewall rules failed ? eboy98 Linux - Security 11 02-19-2010 03:30 AM
[iptables] - Applying rules to a specific local IP? lew Linux - Networking 1 08-10-2009 01:55 AM
Applying iptables rules to multiple subnets eggi Linux - Networking 2 01-04-2006 10:29 PM
Applying firewall rules to user account Beerer Linux - Security 0 01-10-2005 03:42 PM

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

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