메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


리눅스(Linux) 포트(port)  열기, 방화벽(firewall)  설정/해제 등 안내 
--------------------------------------
리눅스 port를 열기 위해서는  iptables를 통해서, 포트를 열고 막고를  할 수 있습니다.

아래의 예제 부분만 따라 하시면 해당 port에 대해 모두 열 수 있습니다.
Inbound (외부에서 서버로 들어오는) , Outbound( 서버에서 외부로 나가는 )  모두 port를 열기 위해서는 아래의 iptables로 INPUT, OUPUT 을 해주면 모두 열립니다.
권한은 root에서 해주시기 바랍니다.

iptables -I INPUT 1 -p tcp --dport 5900 -j ACCEPT 
iptables -I OUTPUT 1 -p tcp --dport 5900 -j ACCEPT 


예를 들면 ) FTP port 21번을 열고 싶다.
#iptables -I INPUT 1 -p tcp --dport 21 -j ACCEPT 
#iptables -I OUTPUT 1 -p tcp --dport 21 -j ACCEPT 

#service iptables save로 저장한 후에 
#/etc/init.d/iptables restart 명령을 실행해준다.


혹은 /etc/sysconfig/iptables을 열어 직접수정도 가능하다.
-A INPUT -p tcp -m state --state NEW -m tcp --dport 33590 -j ACCEPT 를 추가한 후 "/etc/init.d/iptables restart"를 실행해주면
된다.
-> iptables파일을 직접 수정하는 경우 "service iptables reload" -> "service iptables restart"를 실행해줘야 반영된다.

*방화벽 적용되는 포트 확인 : iptables -nL        

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로