https://www.cyberciti.biz/faq/how-to-add-comments-to-iptables-rules-on-linux/
파일로 iptables rule을 관리하다보면 사용용도 및 목적에 따라 주석이 필요할 경우가 있는데 commnet 모듈을 활용하면 관리하기 용이하다.
물론 대부분의 경우 iptable rule을 파일형태로 운영하더라도 파일내 "#" 주석처리해서 관리하게 되는데 이럴경우 iptables-save 시 파일을 덮어씌워버리기에 추천드리는 방법은 아니다.
comment 모듈을 활용하여 주석으로 규칙관리
iptables 규칙 주석관리 모듈 comment
# iptables -I INPUT -m comment --comment "ALL INPUT TRAFFIC"
# iptables -vnL
pkts bytes target prot opt in out source destination
4 184 all -- * * 0.0.0.0/0 0.0.0.0/0 /* ALL INPUT TRAFFIC */
...............................
man iptables-extensions
comment
Allows you to add comments (up to 256 characters) to any rule.
--comment comment
Example:
iptables -A INPUT -i eth1 -m comment --comment "my local LAN"
현재 운영중인 규칙에 주석을 추가하는 방법
-R replace 활용
iptables -R <chain> <rulenum> <rule-specification>
-R, --replace chain rulenum rule-specification
Replace a rule in the selected chain.
If the source and/or destination names resolve to multiple addresses, the command will fail.
Rules are numbered starting at 1.
참고 URl