I want to know what is the command to open the firewall
I found this command in the doc but for fedora:
Code: Select all
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
Code: Select all
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
Code: Select all
Inserting the rule into the top of RH-Firewall-1-INPUT chain -I RH-Firewall-1-INPUT
using TCP ports -p tcp
match TCP protocol -m tcp
setting the destination port as 5666 –dport 5666
telling IPtables to accept not reject the packet -j ACCEPT
Code: Select all
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
Code: Select all
Bad argument `5666'
Try `iptables -h' or `iptables --help' for more information.
I have tested with this command :sreinhardt wrote:I believe you will need to change -dport to --dport. That should resolve the 5666 error.
Code: Select all
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp --dport 5666 -j ACCEPT
Code: Select all
iptables: No chain/target/match by that name.
Code: Select all
[root@CentOS-x86-64 nagiosxi]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTAB
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:s
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:h
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:h
REJECT all -- anywhere anywhere reject-with icmp-ho
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-ho
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Code: Select all
iptables -I INPUT -p tcp -m tcp --dport 5666 -j ACCEPT