Solved

iptables 3306 rules not saving

Posted on 2014-09-04
9
447 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
  • 5
  • 4
9 Comments
 

Author Comment

by:Starquest321
Comment Utility
Running a CENT OS 7 Box
0
 

Author Comment

by:Starquest321
Comment Utility
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 61

Expert Comment

by:gheist
Comment Utility
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
 

Author Comment

by:Starquest321
Comment Utility
so how do I use the firewalld - is that easier?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Starquest321
Comment Utility
What are the exact commands to enable iptables?
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
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 61

Accepted Solution

by:
gheist earned 500 total points
Comment Utility
0
 

Author Comment

by:Starquest321
Comment Utility
when I install iptables -- does that mean I am turning off firewalld?
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now