$ iptables [-t <table>] [<action>] [<chain>] [<match>] [-j <target>]
netfilter 홈페이지
(http://www.netfilter.org/)를 참고하세요.

'PREROUTING' : pre-routing
'INPUT' : Incoming (Local-In)
'FORWARD' : Forward
'OUTPUT' : Outgoing (Local-Out)
'POSTROUTING' : post-routing
'-t, --table <table>'
'filter'
'-t <table>' 옵션이 주어지지 않으면 기본적으로 '-t filter' 옵션이 주어졌다고 가정하게 됩니다. 즉, 'filter'는 기본 table 입니다.
'nat'
'mangle'
'raw'
'security'
'-A, --append <chain> <rule-specification>' : APPEND (정책 추가)
'-C, --check <chain> <rule-specification>' : CHECK (정책 검사)
'-D, --delete <chain> <rule-specification or rulenum>' : DELETE (정책 삭제)
'-I, --insert <chain> [<rulenum(default:1)>] <rule-specification>' : INSERT (정책 삽입)
'-R, --replace <chain> <rulenum> <rule-specification>' : REPLACE (정책 교체)
'-L, --list [<chain>]' : LIST (정책 나열)
'-v, --verbose' 옵션과 함께 사용하면 좀 더 자세한 정보가 나열됩니다.
'-n, --numeric' 옵션과 함께 사용하면 주소와 포트를 해석된 문자열이 아닌 숫자 형태로 표시합니다.
'--line-numbers' 옵션과 함께 사용하면 순번이 함께 표시됩니다.
'-F, --flush [<chain>]' : FLUSH (모든 선택된 chain 정책 삭제)
'-N, --new-chain <chain>' : 새로운 chain 생성
'-P, --policy <chain> <target>' : POLICY (기존 정책 설정)
'-E, --rename-chain <old-chain> <new-chain>' : chain 변경
'-m, --match <match>' : 확장된 매치/일치 조건 (적절한 확장 모듈 필요)
'-s, --src, --source <address>[/<mask>][,<...>]' : 출발지
'-d, --dst, --destination <address>[/<mask>][,<...>]' : 목적지
'-p, --proto <protocol>' : 프로토콜
'-j, --jump <target>' : 매치되는 패킷을 처리하는 target
'-g, --goto <chain>' : 매치되는 패킷을 처리하는 chain
'-i, --in-interface <name>' : 인입 인터페이스
'-o, --out-interface <name>' : 출력 인터페이스
'ACCEPT' : 허용 (패킷을 통과)
'DROP' : 거부 (패킷을 버림)
'REJECT' : 거부 및 적절한 응답 ('DROP' 과 더불어서 도달하지 못한다는 적절한 응답을 출발지로 반향함, '--reject-with <reject종류>')
'LOG' : 로깅 ('--log-level <log-level>', '--log-prefix <string>', '--log-tcp-sequence', '--log-tcp-options', '--log-ip-options')
'SNAT' : 출발지 변환 ('--to <변환주소>' 또는 '--to-source <변환주소>')
'DNAT' : 목적지 변환 ('--to <변환주소>' 또는 '--to-destination <변환주소>')
'REDIRECT' : 재지향 ('--to-ports <변환할 포트>')
'MASQUERADE' : 출발지 변환 ('--to-ports <변환할 포트 범위>')
'RETURN' : 현재 chain 순회를 중지하고 이전 호출한 Chain 에서 이어서 진행
$ iptables -L
$ iptables -v -n --line-numbers -L
$ iptables -P INPUT DROP
$ iptables -P INPUT REJECT
$ iptables -P FORWARD ACCEPT
$ iptables -A INPUT -i lo -j ACCEPT
$ iptables -A INPUT -m state -–state ESTABLISHED,RELATED -j ACCEPT
$ iptables -A INPUT -p tcp –dport 80 -j ACCEPT
$ iptables -A INPUT -d 192.168.0.2 -p tcp –dport 22 -j DROP
$ iptables -A OUTPUT -s 192.168.0.2 -p tcp –dport 80 -j ACCEPT
$ iptables -t nat -A POSTROUTING -p TCP -j MASQUERADE --to-ports 1024-31000
$ iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
$ iptables -A FORWARD -p tcp -j LOG --log-level debug --log-prefix "TCP-FORWARD-PACKET "
$ iptables -F
$ iptables -F INPUT
$ iptables -F FORWARD
$ iptables -F OUTPUT
https://en.wikipedia.org/wiki/Iptables
https://www.netfilter.org/
https://ipset.netfilter.org/iptables.man.html
https://www.linux-india.org/linux-firewall/
Iptables Tutorial - Oskar Andreasson
(https://www.frozentux.net/iptables-tutorial/chunkyhtml/index.html)
Acceleration of IPTABLES Linux Packet Filtering using GPGPU
(https://www.researchgate.net/publication/261550748_Acceleration_of_IPTABLES_Linux_Packet_Filtering_using_GPGPU)
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/configuring_complex_firewall_rules_with_the_rich-language_syntax
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_and_managing_networking/using-and-configuring-firewalld_configuring-and-managing-networking
https://stuffphilwrites.com/2014/09/iptables-processing-flowchart/
: iptables Processing Flowchart (Updated Often)
| 참고 영상 |
| 참고 영상 |
| 참고 영상 |