게시물 1,376건
   
iptables/ufw comment
글쓴이 : 최고관리자 날짜 : 2018-06-28 (목) 13:23 조회 : 6316
글주소 :
                                
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 

이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

 



 
사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.