CentOS 6 regras da lista IPTABLES

0

Eu inseri algumas regras no IPtables no CentOS 6. Mas quando eu executo 'status do iptables de serviço' eu recebo um resultado diferente do que quando vou 'iptables -L'.

Eu preciso abrir a porta 1270 nesta máquina.

Isto é o que eu vejo quando vou 'status do iptables de serviço'

[root@server01 sysconfig]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
1    REJECT     icmp --  0.0.0.0/0            0.0.0.0/0           /* 000 reject all icmp requests */ reject-with icmp-port-unreachable
2    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           /* 001 accept all to lo interface */
3    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           /* 002 accept related established rules */ state RELATED,ESTABLISHED
4    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           multiport ports 22 /* 100 allow ssh access */
5    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           multiport ports 443,8443 /* 110 allow https access */
6    ACCEPT     tcp  --  10.1.190.65          0.0.0.0/0           tcp dpt:1556
7    ACCEPT     tcp  --  10.1.190.65          0.0.0.0/0           tcp dpt:13782
8    ACCEPT     tcp  --  10.1.190.65          0.0.0.0/0           tcp dpt:13724
9    ACCEPT     tcp  --  10.48.131.220        0.0.0.0/0           tcp dpt:1556
10   ACCEPT     tcp  --  10.48.131.220        0.0.0.0/0           tcp dpt:13782
11   ACCEPT     tcp  --  10.48.131.220        0.0.0.0/0           tcp dpt:13724
12   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
13   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:443
14   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:5222
15   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:5269
16   ACCEPT     tcp  --  10.36.16.25          0.0.0.0/0           tcp dpt:1270
17   ACCEPT     tcp  --  10.36.16.26          0.0.0.0/0           tcp dpt:1270
18   ACCEPT     tcp  --  10.36.16.37          0.0.0.0/0           tcp dpt:1270
19   ACCEPT     tcp  --  10.36.16.31          0.0.0.0/0           tcp dpt:1270

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination

E isso é o que eu vejo quando vou iptables -L

[root@server01 sysconfig]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
REJECT     icmp --  anywhere             anywhere            /* 000 reject all icmp requests */ reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             anywhere            /* 001 accept all to lo interface */
ACCEPT     all  --  anywhere             anywhere            /* 002 accept related established rules */ state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            multiport ports ssh /* 100 allow ssh access */
ACCEPT     tcp  --  anywhere             anywhere            multiport ports https,pcsync-https /* 110 allow https access */
ACCEPT     tcp  --  10.1.190.65          anywhere            tcp dpt:veritas_pbx
ACCEPT     tcp  --  10.1.190.65          anywhere            tcp dpt:bpcd
ACCEPT     tcp  --  10.1.190.65          anywhere            tcp dpt:vnetd
ACCEPT     tcp  --  uawscdap0000.us.companyworld.company.com  anywhere            tcp dpt:veritas_pbx
ACCEPT     tcp  --  uawscdap0000.us.companyworld.company.com  anywhere            tcp dpt:bpcd
ACCEPT     tcp  --  uawscdap0000.us.companyworld.company.com  anywhere            tcp dpt:vnetd
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:xmpp-client
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:xmpp-server
ACCEPT     tcp  --  abckpap6181.us.companyworld.company.com  anywhere            tcp dpt:opsmgr
ACCEPT     tcp  --  abckpap6182.us.companyworld.company.com  anywhere            tcp dpt:opsmgr
ACCEPT     tcp  --  abcepap6782.us.companyworld.company.com  anywhere            tcp dpt:opsmgr
ACCEPT     tcp  --  abcepap6783.us.companyworld.company.com  anywhere            tcp dpt:opsmgr

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Então, a porta 120 está aberta nesta máquina ou não? Por que vejo uma diferença entre os dois comandos?

    
por user99201 15.11.2017 / 16:41

1 resposta

1

Eu não vejo nenhuma diferença, talvez você esteja falando sobre a resolução de nomes de IPs e números de porta?
Em caso afirmativo, você precisa da opção -n para a saída "numérica".

iptables -L -n

    
por 15.11.2017 / 19:05