このドキュメントで説明するソフトウェアは、Extended SupportまたはSustaining Supportのいずれかにあります。 詳細は、https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdfを参照してください。
Oracleでは、このドキュメントに記載されているソフトウェアをできるだけ早くアップグレードすることをお薦めします。

機械翻訳について

25.3.3 チェーンに対するルールの挿入および置換

チェーンにルールを挿入するには、iptables -Iコマンドを使用します。 たとえば、次のコマンドはINPUTチェーンにルールを挿入して、ポート80でのTCPによるアクセスを許可します。

# iptables -I INPUT 4 -p tcp -m tcp --dport 80 -j ACCEPT
# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source           destination         
1    ACCEPT     all  --  anywhere         anywhere        state RELATED,ESTABLISHED 
2    ACCEPT     icmp --  anywhere         anywhere            
3    ACCEPT     all  --  anywhere         anywhere            
4    ACCEPT     tcp  --  anywhere         anywhere        tcp dpt:http 
5    ACCEPT     tcp  --  anywhere         anywhere        state NEW tcp dpt:ssh 
6    ACCEPT     udp  --  anywhere         anywhere        state NEW udp dpt:ipp 
7    ACCEPT     udp  --  anywhere         224.0.0.251     state NEW udp dpt:mdns 
8    ACCEPT     tcp  --  anywhere         anywhere        state NEW tcp dpt:ipp 
9    ACCEPT     udp  --  anywhere         anywhere        state NEW udp dpt:ipp 
10   REJECT     all  --  anywhere         anywhere        reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
num  target     prot opt source           destination         
1    REJECT     all  --  anywhere         anywhere        reject-with icmp-host-prohibited 

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

iptables -Lからの出力は、新しいエントリがルール4として挿入され、古いルール4から9は位置5から10に下げられたことを示します。 TCP宛先ポート80はhttpで表され、/etc/servicesファイル内の次の定義に対応します(HTTPデーモンはポート80でクライアント・リクエストをリスニングします)。

http            80/tcp          www www-http    # WorldWideWeb HTTP

チェーンのルールを置換するには、iptables -Rコマンドを使用します。 たとえば、次のコマンドはINPUTチェーンのルール4を置換して、ポート443でのTCPによるアクセスを許可します。

# iptables -I INPUT 4 -p tcp -m tcp --dport 443 -j ACCEPT
# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
2    ACCEPT     icmp --  anywhere             anywhere            
3    ACCEPT     all  --  anywhere             anywhere            
4    ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https
...

TCP宛先ポート443はhttpsで表され、/etc/servicesファイル内のポート443のセキュアなHTTPに関する次の定義に対応します。

https           443/tcp                         # http protocol over TLS/SSL