질문&답변
클라우드/리눅스에 관한 질문과 답변을 주고 받는 곳입니다.
리눅스 분류

iptables에서 ip와 그 포트를 열었는데

작성자 정보

  • 길가빛나는별 작성
  • 작성일

컨텐츠 정보

본문

xmanager에 접속하기 위해 iptables에서 ip와 그 포트를 열었는데,

[root@remote ~]# netstat -na | grep 177
[root@remote ~]#

라고 나옵니다.

iptables는 이렇게 작성했는데요.

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6000:6010 -s xxx.xxx.xxx.xx -j ACCEPT 
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 6000:6010 -s xxx.xxx.xxx.xx -j ACCEPT 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 7100 -s xxx.xxx.xxx.xx -j ACCEPT      
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 7100 -s xxx.xxx.xxx.xx -j ACCEPT      
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 177 -s xxx.xxx.xxx.xx -j ACCEPT       
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 177 -s xxx.xxx.xxx.xx -j ACCEPT      
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -s xxx.xxx.xxx.xx -j ACCEPT 

centos 5.5 x86입니다.

어디가 잘못되었나요?

관련자료

댓글 5

SFWM님의 댓글

  • SFWM
  • 작성일
iptables 와 netstat 은 다릅니다.
iptables 는 포트를 열어줄 것인지에 대한 설정이고 netstat 은 활성화된 포트, 즉 사용중인 포트를 의미합니다.

길가빛나는별님의 댓글의 댓글

  • 길가빛나는별
  • 작성일
SFWM님 댓글 고맙습니다.

그러면 어느 포트가 열려져있는지를 알려면 어떻게 하나요?

SFWM님의 댓글의 댓글

  • SFWM
  • 작성일
iptables 로 사용하는 포트를 모두 열어주었는데 접속이 안되신다면 xmanager 데몬이 활성화 되어 있는지 확인해보세요.
iptables 설정확인은 iptables -nL
해당 데몬이 활성화 되어 있는지 확인하는 방법은 netstat -nlp
로 하시면 됩니다.

길가빛나는별님의 댓글의 댓글

  • 길가빛나는별
  • 작성일
고맙습니다. xmanager는 잘 되고 있었는데, 서버 있는 곳에서 보안상 한다고 해놓았네요. 그리고부터는 ssh만 되어서 힘듭니다....

먼저 iptables -nL에는 이렇게 나오는데, 제대로 열려 있는 건가요?

[root@remote ~]# iptables -nL
Chain INPUT (policy DROP)
target    prot opt source              destination       
RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0         
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:177

Chain FORWARD (policy DROP)
target    prot opt source              destination       
RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0         

Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination       

Chain RH-Firewall-1-INPUT (2 references)
target    prot opt source              destination       
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          tcp dpt:53
ACCEPT    udp  --  0.0.0.0/0            0.0.0.0/0          udp dpt:53
ACCEPT    all  --  0.0.0.0/0            0.0.0.0/0          state RELATED,ESTABLISHED
ACCEPT    tcp  --  xxx.xxx.xxx.240      0.0.0.0/0          state NEW tcp dpt:21
ACCEPT    tcp  --  xxx.xxx.xxx.88        0.0.0.0/0          state NEW tcp dpt:21
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpt:21
ACCEPT    tcp  --  xxx.xxx.xxx.240      0.0.0.0/0          state NEW tcp dpt:22
ACCEPT    tcp  --  xxx.xxx.xxx.88        0.0.0.0/0          state NEW tcp dpt:22
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpt:22
ACCEPT    tcp  --  0.0.0.0/0            0.0.0.0/0          state NEW tcp dpt:80
REJECT    all  --  0.0.0.0/0            0.0.0.0/0          reject-with icmp-host-prohibited
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpts:6000:6010
ACCEPT    udp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW udp dpts:6000:6010
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpt:7100
ACCEPT    udp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW udp dpt:7100
ACCEPT    udp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW udp dpt:177
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpt:177
ACCEPT    tcp  --  xxx.xxx.xxx.xx      0.0.0.0/0          state NEW tcp dpt:3306

SFWM님의 댓글의 댓글

  • SFWM
  • 작성일
위에 적으신 xxx.xxx.xxx.xx 가 접속하시는 서버의 IP 가 맞다면 정상적으로 된 거겠네요..

공지사항


뉴스광장


  • 현재 회원수 :  60,040 명
  • 현재 강좌수 :  35,853 개
  • 현재 접속자 :  139 명