Solved

iptables 3306 rules not saving

Posted on 2014-09-04
9
461 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Are you sitting there reading this and wondering how to get started with Linux? It almost seems like picking the right Linux distribution is about like picking the right college or buying a new car if you read some of the article out there. Relax… l…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

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