Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

What is RH-Firewall-1-INPUT for iptables (Linux Centos 5.9)?

Hi,

1) I'm wondering what this is:
RH-Firewall-1-INPUT

http://www.cyberciti.biz/faq/linux-open-iptables-firewall-port-22-23/

This is the code. The page says to vim and edit:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

Open in new window


How is that different than using something like (example):
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT

at the command line?

2) Also, I have this:

root@ip-184-168-116-73 [/etc/sysconfig]# vim iptables
# Generated by iptables-save v1.3.5 on Mon Jan 27 12:38:23 2014
*mangle
:PREROUTING ACCEPT [162046:22599185]
:INPUT ACCEPT [162046:22599185]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [172917:32155415]
:POSTROUTING ACCEPT [172917:32155415]
COMMIT
# Completed on Mon Jan 27 12:38:23 2014
# Generated by iptables-save v1.3.5 on Mon Jan 27 12:38:23 2014
*filter
:INPUT ACCEPT [162043:22599033]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [172914:32155295]
:acctboth - [0:0]
-A INPUT -j acctboth
-A INPUT -p tcp -m tcp --dport 9000 -j ACCEPT
-A OUTPUT -j acctboth
-A OUTPUT -p tcp -m tcp --sport 9000 -j ACCEPT

Open in new window


Just wondering what does this part mean:
-A INPUT -j acctboth

before:
-A INPUT -p tcp -m tcp --dport 9000 -j ACCEPT

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura

ASKER

@_jesper@, ok, thanks.
So for FORWARD you can just name it so it's kind of like a comment to let you know what the rule is, right?

Also, I'm wondering what does this part mean:
-A INPUT -j acctboth

before:
-A INPUT -p tcp -m tcp --dport 9000 -j ACCEPT

Thanks!
there should be more to the ruleset that includes 'acctboth'.
when I run cat /etc/sysconfig/iptables
it's in my output.

See my initial post, (2) point or question to see the output
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@gheist, Ok, thanks!

So it's needed like so?

-A INPUT -j acctboth
-A INPUT -p tcp -m tcp --dport 9000 -j ACCEPT

Just wondering if it's omitted, what would happen? I guess I'm not clear about what it means "open port numbers selection screens". Can you expound?

I'm trying to learn the firewall rules. Still very new to me. Thanks!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial