環境
bash
# OSバージョン $ cat /etc/redhat-release CentOS release 6.5 (Final) # Apacheのバージョン $ httpd -v Server version: Apache/2.2.15 (Unix) Server built: Jun 19 2018 15:45:13
自ホストからの接続はOK
bash
# 自ホストからの接続はOK(192.168.1.50) $ curl http://192.168.1.50 <html> <head> <meta charset="utf-8"> <title>タイトル</title> </head> <body> 本文 </body> </html> # 80番ポート開放済み $ sudo iptables -nL Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 Chain FORWARD (policy ACCEPT) target prot opt source destination 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 # netstatで確認すると、IPv4はLISTENしていない $ netstat -anp | grep 'LISTEN ' (No info could be read for "-p": geteuid()=500 but you should be root.) tcp 0 0 0.0.0.0:111 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 0.0.0.0:43898 0.0.0.0:* LISTEN - tcp 0 0 :::111 :::* LISTEN - tcp 0 0 :::80 :::* LISTEN - # IPv6はLISTEN tcp 0 0 :::22 :::* LISTEN - tcp 0 0 ::1:631 :::* LISTEN - tcp 0 0 :::48964 :::* LISTEN - tcp 0 0 :::3306 :::* LISTEN -
他ホストからの接続はNG
bash
# pingはOK $ ping 192.168.1.50 PING 192.168.1.50 (192.168.1.50) 56(84) bytes of data. 64 bytes from 192.168.1.50: icmp_seq=1 ttl=64 time=1.24 ms : # 他ホストからの接続はNG(192.168.1.23) $ curl -v http://192.168.1.50 * About to connect() to 192.168.1.50 port 80 (#0) * Trying 192.168.1.50... No route to host * couldn't connect to host * Closing connection #0 curl: (7) couldn't connect to host
netstatで80番ポートのIPv4がLISTENしていないのが原因と思っていますが、iptablesの設定では開放できているように見えます。エラーの原因分かる方いましたら、教えて頂けますでしょうか。
※ プロキシは使用していません。
まだ回答がついていません
会員登録して回答してみよう