netstatの結果だと、IPv6のport80はlistenしているが、IPv4のport80はlistenしていないように見えます。
# netstat -nat | grep -i listen tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:46391 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:35868 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN tcp6 0 0 :::111 :::* LISTEN tcp6 0 0 :::80 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::25 :::* LISTEN tcp6 0 0 :::40415 :::* LISTEN tcp6 0 0 :::10050 :::* LISTEN tcp6 0 0 :::34343 :::* LISTEN
しかし、実際にIPv4のport80へアクセスすると、応答があります。
# curl 127.0.0.1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access / on this server.</p> </body></html>
tcpdumpしてみましたが、実際にIPv4にて応答しているようです。
(以下の結果はIPv6でアクセスした後、IPv4でアクセスした結果です。)
# tcpdump -i lo port 80 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on lo, link-type EN10MB (Ethernet), capture size 262144 bytes 10:31:12.387377 IP6 localhost.53738 > localhost.http: Flags [S], seq 968427148, win 43690, options [mss 65476,sackOK,TS val 72593463 ecr 0,nop,wscale 7], length 0 00:22:33.663400 IP6 localhost.http > localhost.53738: Flags [S.], seq 1565811111, ack 968427149, win 43690, options [mss 65476,sackOK,TS val 72593463 ecr 72593463,nop,wscale 7], length 0 10:31:12.387407 IP6 localhost.53738 > localhost.http: Flags [.], ack 1, win 342, options [nop,nop,TS val 72593463 ecr 72593463], length 0 10:31:12.387473 IP6 localhost.53738 > localhost.http: Flags [P.], seq 1:74, ack 1, win 342, options [nop,nop,TS val 72593463 ecr 72593463], length 73: HTTP: GET / HTTP/1.1 10:31:12.387498 IP6 localhost.http > localhost.53738: Flags [.], ack 74, win 342, options [nop,nop,TS val 72593463 ecr 72593463], length 0 10:31:12.389620 IP6 localhost.http > localhost.53738: Flags [P.], seq 1:348, ack 74, win 342, options [nop,nop,TS val 72593465 ecr 72593463], length 347: HTTP: HTTP/1.1 403 Forbidden 10:31:12.389633 IP6 localhost.53738 > localhost.http: Flags [.], ack 348, win 350, options [nop,nop,TS val 72593466 ecr 72593465], length 0 10:31:12.390230 IP6 localhost.53738 > localhost.http: Flags [F.], seq 74, ack 348, win 350, options [nop,nop,TS val 72593466 ecr 72593465], length 0 10:31:12.391606 IP6 localhost.http > localhost.53738: Flags [F.], seq 348, ack 75, win 342, options [nop,nop,TS val 72593467 ecr 72593466], length 0 10:31:12.391643 IP6 localhost.53738 > localhost.http: Flags [.], ack 349, win 350, options [nop,nop,TS val 72593468 ecr 72593467], length 0 10:31:30.095105 IP localhost.34130 > localhost.http: Flags [S], seq 691767966, win 43690, options [mss 65495,sackOK,TS val 72611171 ecr 0,nop,wscale 7], length 0 21:30:08.961986 IP localhost.http > localhost.34130: Flags [S.], seq 4181075012, ack 691767967, win 43690, options [mss 65495,sackOK,TS val 72611171 ecr 72611171,nop,wscale 7], length 0 10:31:30.095157 IP localhost.34130 > localhost.http: Flags [.], ack 1, win 342, options [nop,nop,TS val 72611171 ecr 72611171], length 0 10:31:30.095797 IP localhost.34130 > localhost.http: Flags [P.], seq 1:74, ack 1, win 342, options [nop,nop,TS val 72611172 ecr 72611171], length 73: HTTP: GET / HTTP/1.1 10:31:30.095853 IP localhost.http > localhost.34130: Flags [.], ack 74, win 342, options [nop,nop,TS val 72611172 ecr 72611172], length 0 10:31:30.097912 IP localhost.http > localhost.34130: Flags [P.], seq 1:348, ack 74, win 342, options [nop,nop,TS val 72611174 ecr 72611172], length 347: HTTP: HTTP/1.1 403 Forbidden 10:31:30.097922 IP localhost.34130 > localhost.http: Flags [.], ack 348, win 350, options [nop,nop,TS val 72611174 ecr 72611174], length 0 10:31:30.099390 IP localhost.34130 > localhost.http: Flags [F.], seq 74, ack 348, win 350, options [nop,nop,TS val 72611175 ecr 72611174], length 0 10:31:30.099537 IP localhost.http > localhost.34130: Flags [F.], seq 348, ack 75, win 342, options [nop,nop,TS val 72611175 ecr 72611175], length 0 10:31:30.099561 IP localhost.34130 > localhost.http: Flags [.], ack 349, win 350, options [nop,nop,TS val 72611175 ecr 72611175], length 0
なぜIPv4にてport80へアクセスしても応答があるのでしょうか。
netstatで表示されていなくとも、応答可能な場合はあるのでしょうか。
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。