?
Solved

iptables 3306 rules not saving

Posted on 2014-09-04
9
Medium Priority
?
468 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
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 

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 2000 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
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…
Suggested Courses

741 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