CentOS 6 IPTABLES-Listenregeln

355
user99201

Ich habe in Centos 6 einige Regeln in IPtables eingetragen. Wenn ich jedoch 'service iptables status' starte, bekomme ich ein anderes Ergebnis als bei 'iptables -L'.

Ich muss Port 1270 auf dieser Maschine öffnen.

Das ist es, was ich sehe, wenn ich 'Dienst iptables Status' gehe.

[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 

Und das sehe ich, wenn ich iptables -L gehe

[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 

Ist Port 120 auf diesem Computer also offen oder nicht? Warum sehe ich einen Unterschied zwischen den beiden Befehlen?

0

1 Antwort auf die Frage

1
mjb2kmn

Ich sehe keinen Unterschied, vielleicht sprechen Sie über die Namensauflösung von IPs und Portnummern?
Wenn ja, benötigen Sie die -nOption für die "numerische" Ausgabe.

iptables -L -n

Hallo danke. Ja, genau das meine ich. Ich verstand nicht, dass iptables den DNS-Namen der IP-Adressen in der Ausgabe von iptables -L auflöste. Warum macht es das? Vielen Dank user99201 vor 6 Jahren 0
Viele Netzwerktools tun dies standardmäßig, um menschlicher zu sein. Zum Glück unterstützen sie in der Regel auch eine Option, um es ebenfalls auszuschalten, und normalerweise ist es -n. mjb2kmn vor 6 Jahren 0
OK Cool. Danke für die Information! :) user99201 vor 6 Jahren 0