Solved

iptables 3306 rules not saving

Posted on 2014-09-04
9
464 Views
Last Modified: 2014-09-06
I am inserting the rule property :: saving :: restarting and the rule is not committed. I am doing the following:

Step 1:

iptables -A INPUT -i eth0 -p tcp -m tcp --dport 3306 -j ACCEPT

Step 2:

service iptables save

Step 3:

service iptables restart

Step 4:

I simply rebooted the machine.

When I do:

iptables --list-rules
I don't see the rule committed and I cannot connect from the outside.

Note:
I saw a complex version of this rule: iptables -I INPUT -i eth0 -p tcp -s 1.1.1.2 -d 1.1.1.1 --destination-port 3306 -j ACCEPT
0
Comment
Question by:Starquest321
[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
  • 5
  • 4
9 Comments
 

Author Comment

by:Starquest321
ID: 40305169
Running a CENT OS 7 Box
0
 

Author Comment

by:Starquest321
ID: 40305175
Note: When I tried to use the setup system-config I got the following error:

ERROR: FirewallD is active, please use firewall-cmd.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40305701
iptables/system-config-firewall-tui are now replaced by firewalld.
to get old behaviour disable and stop firewalld (chkconfig firewalld off ; service firewalld stop)
enable and start ip(6)tables
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

Author Comment

by:Starquest321
ID: 40305744
so how do I use the firewalld - is that easier?
0
 

Author Comment

by:Starquest321
ID: 40305749
What are the exact commands to enable iptables?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40305808
firewalld is managed by firewall-config (both have manual pages)

iptables:
yum install system-config-firewall-tui
now run system-config-firewall-tui and allow at least SSH protocol (press once OK, it saves config, but fails, then cancel to exit, without this you lose remote access to system)
chkconfig iptables on ; service iptables start
chkconfig ip6tables on ; service ip6tables start

(between the lines you will learn something about how RHEL7 is different from RHEL6)
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 40305856
0
 

Author Comment

by:Starquest321
ID: 40306011
when I install iptables -- does that mean I am turning off firewalld?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40306030
No, you have to explicitly switch it off and stop
Then configure rule for SSH (http, ... etc to allow extant service)
And then start and enable iptables
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

726 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