naobe @ ウィキ
iptable
最終更新:
Bot(ページ名リンク)
-
view
Linuxセキュリティに戻る
ルールのリスト
#iptables -L [root@athlon4 ~]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain RH-Firewall-1-INPUT (2 references) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp any ACCEPT esp -- anywhere anywhere ACCEPT ah -- anywhere anywhere ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns ACCEPT udp -- anywhere anywhere udp dpt:ipp ACCEPT tcp -- anywhere anywhere tcp dpt:ipp ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
ルールの追加
指定したネットワークからポートAに対するアクセスを許可する
- /etc/sysconfig/iptablesに以下を追加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport ポート番号 -s ネットワーク -j ACCEPT
ネットワークは"999.999.999.0/24"の形式で設定。
設定の反映
# /etc/init.d/iptables restart