내 Linux 시스템은 다음과 같이 IP 주소를 통해 연결할 수 없습니다.
http://127.0.0.1:8080/projectname
또는 localhost가 브라우저에서 작동하지만
http://10.1.5.5:8080/projectname
아니요(여기서 10.1.5.5는 ifconfig
터미널에 입력하여 찾은 IP 주소입니다).
저는 페도라 16을 사용하고 있습니다.
편집 : 출력 iptables -L -n
:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
INPUT_direct all -- 0.0.0.0/0 0.0.0.0/0
INPUT_ZONES all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
FORWARD_direct all -- 0.0.0.0/0 0.0.0.0/0
FORWARD_ZONES all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
OUTPUT_direct all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD_ZONES (1 references)
target prot opt source destination
FWDO_ZONE_public all -- 0.0.0.0/0 0.0.0.0/0
FWDI_ZONE_public all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD_direct (1 references)
target prot opt source destination
Chain FWDI_ZONE_public (1 references)
target prot opt source destination
FWDI_ZONE_public_deny all -- 0.0.0.0/0 0.0.0.0/0
FWDI_ZONE_public_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain FWDI_ZONE_public_allow (1 references)
target prot opt source destination
Chain FWDI_ZONE_public_deny (1 references)
target prot opt source destination
Chain FWDO_ZONE_external (0 references)
target prot opt source destination
FWDO_ZONE_external_deny all -- 0.0.0.0/0 0.0.0.0/0
FWDO_ZONE_external_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain FWDO_ZONE_external_allow (1 references)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain FWDO_ZONE_external_deny (1 references)
target prot opt source destination
Chain FWDO_ZONE_public (1 references)
target prot opt source destination
FWDO_ZONE_public_deny all -- 0.0.0.0/0 0.0.0.0/0
FWDO_ZONE_public_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain FWDO_ZONE_public_allow (1 references)
target prot opt source destination
Chain FWDO_ZONE_public_deny (1 references)
target prot opt source destination
Chain INPUT_ZONES (1 references)
target prot opt source destination
IN_ZONE_public all -- 0.0.0.0/0 0.0.0.0/0
Chain INPUT_direct (1 references)
target prot opt source destination
Chain IN_ZONE_dmz (0 references)
target prot opt source destination
IN_ZONE_dmz_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_dmz_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_dmz_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
Chain IN_ZONE_dmz_deny (1 references)
target prot opt source destination
Chain IN_ZONE_external (0 references)
target prot opt source destination
IN_ZONE_external_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_external_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_external_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ctstate NEW
Chain IN_ZONE_external_deny (1 references)
target prot opt source destination
Chain IN_ZONE_home (0 references)
target prot opt source destination
IN_ZONE_home_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_home_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_home_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:137 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:138 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
Chain IN_ZONE_home_deny (1 references)
target prot opt source destination
Chain IN_ZONE_internal (0 references)
target prot opt source destination
IN_ZONE_internal_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_internal_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_internal_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:137 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:138 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
Chain IN_ZONE_internal_deny (1 references)
target prot opt source destination
Chain IN_ZONE_public (1 references)
target prot opt source destination
IN_ZONE_public_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_public_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_public_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080 ctstate NEW
Chain IN_ZONE_public_deny (1 references)
target prot opt source destination
Chain IN_ZONE_work (0 references)
target prot opt source destination
IN_ZONE_work_deny all -- 0.0.0.0/0 0.0.0.0/0
IN_ZONE_work_allow all -- 0.0.0.0/0 0.0.0.0/0
Chain IN_ZONE_work_allow (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:631 ctstate NEW
Chain IN_ZONE_work_deny (1 references)
target prot opt source destination
Chain OUTPUT_direct (1 references)
target prot opt source destination
편집 : 출력 netstat -an | grep '^tcp'
:
[root@localhost etc]# netstat -an | grep '^tcp'
tcp 0 0 127.0.0.1:9999 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:4447 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:9990 0.0.0.0:* LISTEN
tcp 0 0 10.1.5.4:42019 203.190.124.28:80 TIME_WAIT
tcp 0 0 10.1.5.4:59036 198.252.206.25:80 ESTABLISHED
tcp 0 0 10.1.5.4:40731 74.125.236.111:443 ESTABLISHED
tcp 0 0 10.1.5.4:43896 74.125.236.33:80 ESTABLISHED
tcp 0 0 10.1.5.4:57049 74.125.236.160:80 ESTABLISHED
tcp 0 0 10.1.5.4:52908 74.125.236.162:443 ESTABLISHED
tcp 0 0 10.1.5.4:48313 204.154.94.81:443 ESTABLISHED
tcp 0 0 10.1.5.4:59059 198.252.206.25:80 ESTABLISHED
tcp 0 0 10.1.5.4:50342 74.125.236.161:80 ESTABLISHED
tcp 0 0 10.1.5.4:42020 203.190.124.28:80 TIME_WAIT
tcp 0 0 10.1.5.4:48398 74.125.135.95:80 TIME_WAIT
tcp 0 0 10.1.5.4:42036 68.232.44.121:80 TIME_WAIT
tcp 0 0 10.1.5.4:42132 141.101.114.59:80 TIME_WAIT
tcp 0 0 10.1.5.4:40183 96.17.182.57:80 TIME_WAIT
tcp 0 0 10.1.5.4:57117 203.190.124.17:80 TIME_WAIT
tcp 0 0 10.1.5.4:50606 198.252.206.16:80 ESTABLISHED
tcp 0 0 10.1.5.4:45892 74.125.236.40:80 ESTABLISHED
tcp 0 0 10.1.5.4:42133 141.101.114.59:80 TIME_WAIT
tcp 0 0 10.1.5.4:42037 68.232.44.121:80 TIME_WAIT
tcp6 0 0 :::111 :::* LISTEN
tcp6 0 0 :::6000 :::* LISTEN
tcp6 0 0 :::5298 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 :::9278 :::* LISTEN
답변1
상자에는 여러 인터페이스가 있습니다. 각 인터페이스에는 여러 개의 IP 주소가 있을 수 있습니다. (lo에는 127.0.0.1이 있고 eth0에는 10.1.5.5 또는 이와 유사한 것이 있습니다. - ip addr
자세한 내용은 참조하세요.)
이제 해당 상자에서 일종의 웹 서버가 실행되고 있습니다. 다른 사람이 액세스하려면 일부 인터페이스나 IP 주소에 바인딩되어야 합니다.
웹 서버의 구성 파일 어딘가에서 서버가 바인딩할 주소를 지정하는 "listen" 또는 "bind" 옵션을 찾아야 합니다.
현재는 127.0.0.1에만 바인딩된 것으로 보입니다. 즉, 루프백 인터페이스를 통해 자신의 상자에서만 액세스할 수 있습니다. ( netstat -tpln
자세히보다.)
어디에서나 변경할 수 있도록 하려면 일반적으로 "*" 또는 "0.0.0.0"으로 바인딩합니다. - 구성 문서를 검토하세요.