LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 01-18-2006, 01:50 PM   #1
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Rep: Reputation: 15
iptables disappeared


hi,

today i wanted to open a port in my server.....and after doing that and saving the changes using the following two commands

Code:
/sbin/iptables -I INPUT -p tcp --destination-port 22671 -j ACCEPT
Code:
/sbin/iptables-save > /etc/sysconfig/iptables
and after issuing this command to check the rule

Code:
/sbin/iptables -L
I saw the rule....but all the rules that I previously made just disappeared!!! yet everything works OK!!!! Now After a reboot and issuing the previous command....now this is what I see

Code:
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Empty!!!! Previously I opened port 33100 for bittornado....and it is still opened since i can leech/seed...

So how come i cant list the rules....

ThnX


*EDIT*
This is the contents of /etc/sysconfig/iptables

Code:
# Generated by iptables-save v1.3.0 on Wed Jan 18 19:00:02 2006
*filter
:FORWARD ACCEPT [0:0]
:INPUT ACCEPT [67:5916]
:OUTPUT ACCEPT [74:10200]
-A INPUT -p tcp -m tcp --dport 22671 -j ACCEPT 
COMMIT
# Completed on Wed Jan 18 19:00:02 2006
yet I dont see "-A INPUT -p tcp -m tcp --dport 22671 -j ACCEPT " when I list the rules!!!

Last edited by piforever; 01-18-2006 at 02:20 PM.
 
Old 01-19-2006, 06:57 AM   #2
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Seems like a distro specific problem. Is there an option in the bootscript configs that enables or disables firewalls?
 
Old 01-19-2006, 12:55 PM   #3
sam5550
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Rep: Reputation: 0
You can preserve your firewall settings during shut-downs and restarts by editing the settings in /etc/sysconfig/iptables-config. Particularly:

IPTABLES_SAVE_ON_STOP="yes"
IPTABLES_SAVE_ON_RESTART="yes"

That should allow you to keep rules when you shut down/reboot.
 
Old 01-19-2006, 04:31 PM   #4
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ugenn
Seems like a distro specific problem. Is there an option in the bootscript configs that enables or disables firewalls?

sorry i dont know!!! i'm a total n00b!
 
Old 01-19-2006, 04:36 PM   #5
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by sam5550
You can preserve your firewall settings during shut-downs and restarts by editing the settings in /etc/sysconfig/iptables-config. Particularly:

IPTABLES_SAVE_ON_STOP="yes"
IPTABLES_SAVE_ON_RESTART="yes"

That should allow you to keep rules when you shut down/reboot.

thnx for the hints....very useful indeed...does it mean whenever i setup a new rule it will be saved automatically when i reboot my machine so I don't need to save the changes???


Another thing to add:

I just remembered that I did install Firestarter few weeks ago but did not run/configure it although i see the service start when i restart my machine....so I just removed it using yum and now when i list the rules i see my latest update -port 22671- but nothing else....although everything works OK...so now i'm really worried!!! what does this mean??? how am I going to change the *hidden* rules???

Code:
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:22671 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Last edited by piforever; 01-19-2006 at 04:38 PM.
 
Old 01-19-2006, 09:44 PM   #6
sam5550
LQ Newbie
 
Registered: Jan 2006
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by piforever
thnx for the hints....very useful indeed...does it mean whenever i setup a new rule it will be saved automatically when i reboot my machine so I don't need to save the changes???
It should ... I haven't tried it though.
 
Old 01-21-2006, 07:50 AM   #7
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
is there any way to check the rules in the iptables other than "iptables -L" ??? I still can not see all the opened ports...

thnx
 
Old 01-21-2006, 08:17 PM   #8
ugenn
Member
 
Registered: Apr 2002
Posts: 549

Rep: Reputation: 30
Are you root?
 
Old 01-21-2006, 09:20 PM   #9
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
yes i am....
 
  


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
/etc disappeared Fonk Linux - Software 7 11-18-2008 05:34 PM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Gnome Disappeared tauceti38 Linux - Software 1 03-12-2005 06:24 PM
Drive Disappeared NanoFxJ Linux - Hardware 0 11-24-2004 05:03 PM
Iptables daemon script disappeared hbrandao Linux - Security 1 08-04-2004 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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