Solved

error in ip tables configuration

Posted on 2009-04-11
7
715 Views
Last Modified: 2013-11-16
somehow I managed to mess up my ip-tables config. I get this error when I try to restart iptables,


[root@tktdgt ~]# service iptables restart
: command not foundbles-config: line 7:
: command not foundbles-config: line 14:
: command not foundbles-config: line 20:
: command not foundbles-config: line 26:
: command not foundbles-config: line 33:
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: mangle filter             [  OK  ]
[root@tktdgt ~]#

My file is below, it looks fine to me.


# Load additional iptables modules (nat helpers)
#   Default: -none-
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
# are loaded after the firewall rules are applied. Options for the helpers are
# stored in /etc/modules.conf.
IPTABLES_MODULES=""
 
# Unload modules on restart and stop
#   Value: yes|no,  default: yes
# This option has to be 'yes' to get to a sane state for a firewall
# restart or stop. Only set to 'no' if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="no"
 
# Save current firewall rules on stop.
#   Value: yes|no,  default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
# (e.g. on system shutdown).
IPTABLES_SAVE_ON_STOP="no"
 
# Save current firewall rules on restart.
#   Value: yes|no,  default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
# restarted.
IPTABLES_SAVE_ON_RESTART="no"
 
# Save (and restore) rule and chain counter.
#   Value: yes|no,  default: no
# Save counters for rules and chains to /etc/sysconfig/iptables if
# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
# SAVE_ON_RESTART is enabled.
IPTABLES_SAVE_COUNTER="no"
 
# Numeric status output
#   Value: yes|no,  default: yes
# Print IP addresses and port numbers in numeric format in the status output.
IPTABLES_STATUS_NUMERIC="yes"

Open in new window

0
Comment
Question by:JPERKS1985
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 78

Accepted Solution

by:
arnold earned 500 total points
ID: 24122672
Post the contents of /etc/sysconfig/iptables*
0
 
LVL 7

Expert Comment

by:Morne Lategan
ID: 24123080
Did you edit the file in dos? If so, run

dos2unix -p /path/to/file

It seems its complaining about all the blank lines
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 24123817
no more errors but it will not start




Setting chains to policy ACCEPT: mangle filter             [  OK  ]
[root@tktdgt ~]# service iptables start
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: mangle filter             [  OK  ]
[root@tktdgt ~]# service iptables status
Firewall is stopped.
[root@tktdgt ~]#
0
Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

 
LVL 78

Expert Comment

by:arnold
ID: 24124004
run iptables -L
chkconfig --list iptables

What do you have for the above?
0
 
LVL 1

Author Comment

by:JPERKS1985
ID: 24124090
[root@tktdgt ~]# run iptables -L
-bash: run: command not found
[root@tktdgt ~]# chkconfig --list iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
0
 
LVL 78

Expert Comment

by:arnold
ID: 24124353
iptables -L
0
 
LVL 30

Expert Comment

by:Kerem ERSOY
ID: 24568308
Remove run execute only iptables -L

If seems that you're running over RedHAT / CentOS . The default configuration is in /etc/sysconfig/iptables

If the code sniipet belongs to this file it is normal that you have nothing because your file does not contain any rules for firewall.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question