LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-20-2017, 08:15 AM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
iptables: No config file.


How do I add a iptables config file to Centos 6.8? Thanks

Code:
[Michael@vps2 ~]$ sudo /etc/init.d/iptables status
Table: mangle
Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination

Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
num  target     prot opt source               destination

Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

[Michael@vps2 ~]$ sudo /etc/init.d/iptables start
iptables: No config file.                                  [WARNING]
[Michael@vps2 ~]$ sudo cat /etc/sysconfig/iptables
cat: /etc/sysconfig/iptables: No such file or directory
[Michael@vps2 ~]$
 
Old 02-20-2017, 08:24 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
It is default for iptables to be empty in CentOS 6. Instead you should add yours rules to iptables and then do a "service iptables save" to save the configuration to file. That would be the recommended way to create any such file.

This is the default, so that if you install iptables remotely, you don't instantly blackhole yourself out the server. As you could imagine that would be rather problematic.

Last edited by r3sistance; 02-20-2017 at 08:25 AM. Reason: the reason
 
1 members found this post helpful.
Old 02-20-2017, 11:14 AM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks r3sistance, that did the trick!
 
  


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
[SOLVED] iptables: No config file. [WARNING] postcd Linux - General 5 12-06-2018 12:19 PM
How to convert iptables to config file Chriswf Linux - Newbie 3 08-23-2015 05:49 AM
Where is iptables config file satimis Ubuntu 4 09-12-2007 10:25 PM
Where is the iptables config file? huxflux SUSE / openSUSE 4 06-20-2006 05:24 AM
location of iptables config file munisp Linux - Networking 1 12-13-2001 06:37 PM

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

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