LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-14-2009, 03:21 AM   #1
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
Linux iptables status?


I have just started running :
Code:
#service iptables status
Firewall is stopped
Code:
# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 10.236.77.50
Code:
# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Code:
# service iptables status
Firewall is stopped.
any idea whats wrong with my iptables?
 
Old 12-14-2009, 03:33 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
any idea whats wrong with my iptables?
Commonly pebcac ...


What does /etc/sysconfig/iptables* look like?

Why are you trying to insert a rule why iptables is stopped?



Cheers,
Tink

Last edited by Tinkster; 12-14-2009 at 03:34 AM.
 
Old 12-14-2009, 09:31 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
while you are starting the iptables just check the message log, what is the output of "iptables -L"

Quote:
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 10.236.77.50
without saving if we restart iptables this rule will be erased

Last edited by kirukan; 12-14-2009 at 09:36 AM.
 
Old 12-14-2009, 09:25 PM   #4
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466

Original Poster
Blog Entries: 6

Rep: Reputation: 51
Here is the output:
Code:
# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.2.11 on Sat Dec 12 08:43:17 2009
*nat
:PREROUTING ACCEPT [7:980]
:POSTROUTING ACCEPT [3:210]
:OUTPUT ACCEPT [3:210]
-A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 10.209.47.241
COMMIT
# Completed on Sat Dec 12 08:43:17 2009
# Generated by iptables-save v1.2.11 on Sat Dec 12 08:43:17 2009
*filter
:INPUT ACCEPT [1671955:2251603990]
:FORWARD ACCEPT [444:117648]
:OUTPUT ACCEPT [871130:43232190]
COMMIT
# Completed on Sat Dec 12 08:43:17 2009
#
Code:
# service iptables status
Firewall is stopped.
Code:
# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
#
Code:
# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 10.209.47.241
#iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Code:
# iptables-save
# Generated by iptables-save v1.2.11 on Tue Dec 15 08:54:10 2009
*nat
:PREROUTING ACCEPT [14821:2087637]
:POSTROUTING ACCEPT [5465:488998]
:OUTPUT ACCEPT [5460:487590]
-A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 10.209.47.241
-A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth0 -j SNAT --to-source 10.209.47.241
COMMIT
# Completed on Tue Dec 15 08:54:10 2009
# Generated by iptables-save v1.2.11 on Tue Dec 15 08:54:10 2009
*filter
:INPUT ACCEPT [2716565380:3853194984145]
:FORWARD ACCEPT [16386:10601848]
:OUTPUT ACCEPT [1834504590:137399480879]
COMMIT
# Completed on Tue Dec 15 08:54:10 2009
Code:
# service iptables start
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: nat filter                [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Code:
[root@bangmediasrv1 ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Table: nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  192.168.0.0/24       0.0.0.0/0           to:10.209.47.241

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Should iptables status shows such output?

Last edited by your_shadow03; 12-14-2009 at 09:27 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
An error occured getting IPtables status from the command /etc/rc.d/init.d/iptables s CrazyMAzeY Linux - Newbie 10 08-12-2010 05:25 AM
Hello, This is my first post. - iptables status on RHel5 zapo Linux - Newbie 4 09-16-2009 06:47 PM
hdc: status timeout: status=0xd0 { Busy } bagra Linux - Newbie 6 06-12-2009 01:15 PM
hda:status timeout:status = 0xd0 {Busy} dahlinkj Linux - Newbie 2 05-27-2008 05:36 PM
Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58 fishsponge Linux - General 0 07-11-2006 09:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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