回答編集履歴

1

追記 ( iptables の -n オプションについて )

2018/04/11 06:56

投稿

CHERRY
CHERRY

スコア25171

test CHANGED
@@ -35,3 +35,47 @@
35
35
  webcache 8080/udp http-alt # WWW caching service
36
36
 
37
37
  ```
38
+
39
+
40
+
41
+
42
+
43
+ ----
44
+
45
+ (追記)
46
+
47
+ ポートが「サービス名」で表示されてわかりにくい場合は、`iptables -L -n` と数字で表示するようにして確認して見てください。
48
+
49
+
50
+
51
+ (実行例)
52
+
53
+ ```
54
+
55
+ # iptables -L -n
56
+
57
+
58
+
59
+ Chain IN_public_allow (1 references)
60
+
61
+ target prot opt source destination
62
+
63
+ ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
64
+
65
+ ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:53 ctstate NEW
66
+
67
+ ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:53 ctstate NEW
68
+
69
+ ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8000 ctstate NEW
70
+
71
+ ```
72
+
73
+
74
+
75
+ [man of iptables(8)](https://linuxjm.osdn.jp/html/iptables/man8/iptables.8.html) 参照
76
+
77
+
78
+
79
+ > -n, --numeric
80
+
81
+ > 数値による出力を行う。 IP アドレスやポート番号を数値によるフォーマットで表示する。 デフォルトでは、iptables は (可能であれば) IP アドレスやポート番号をホスト名、ネットワーク名、サービス名で表示しようとする。