Squidで必要な通信Portが不明

CentOSにSquidを入れたわけですが通信がうまくいかないという状況になりました。

で、結果として原因はiptablesでの通信許可が不十分だから、という結論に。

iptablesを無効化って方法もあるけどやりたくないしねぇ。。。

なので一時的にiptablesを無効にしてtcpdumpで通信を確認してみました。

条件:tcpdump -n -q ip and not port 22

22:16:40.490788 IP <サーバIP>.47929 > 157.7.180.133.domain: UDP, length 46
22:16:40.492357 IP 157.7.180.133.domain > <サーバIP>.47929: UDP, length 115
22:16:40.959497 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:40.959580 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:40.967507 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:40.967613 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 222
22:16:40.967632 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:40.968441 IP <サーバIP>.54897 > 157.7.180.133.domain: UDP, length 34
22:16:40.969552 IP 157.7.180.133.domain > <サーバIP>.54897: UDP, length 62
22:16:40.969738 IP <サーバIP>.54897 > 157.7.180.133.domain: UDP, length 34
22:16:40.970764 IP 157.7.180.133.domain > <サーバIP>.54897: UDP, length 82
22:16:41.040796 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 39
22:16:41.046145 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.048466 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 207
22:16:41.048492 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.118935 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 2920
22:16:41.118985 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 944
22:16:41.124517 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.181183 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 126
22:16:41.181213 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.251202 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 303
22:16:41.257458 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.260652 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 57
22:16:41.260673 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.260999 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 623
22:16:41.261023 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.419988 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 1404
22:16:41.420296 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 8760
22:16:41.420310 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 776
22:16:41.426250 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.426271 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 5840
22:16:41.426284 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.426291 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.426295 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 7300
22:16:41.426300 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.426304 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 1460
22:16:41.426307 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 500
22:16:41.432605 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.432620 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.489666 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 2920
22:16:41.489677 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 740
22:16:41.490024 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 16060
22:16:41.490043 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 340
22:16:41.495273 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.495524 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.496797 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.496819 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.621055 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 709
22:16:41.621100 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.674448 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 1460
22:16:41.674485 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.674503 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 489
22:16:41.674507 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:41.745571 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 11680
22:16:41.745607 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 761
22:16:41.751328 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.751369 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:41.783651 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 106
22:16:41.789225 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:43.358408 IP <サーバIP>.40209 > 157.7.180.133.domain: UDP, length 46
22:16:43.359553 IP 157.7.180.133.domain > <サーバIP>.40209: UDP, length 115
22:16:43.680587 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 749
22:16:43.680665 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 0
22:16:43.788929 IP <サーバIP>.squid > <クライアントIP>.51106: tcp 91
22:16:43.794368 IP <クライアントIP>.51106 > <サーバIP>.squid: tcp 0
22:16:45.469898 IP <サーバIP>.60080 > 157.7.180.133.domain: UDP, length 46
22:16:45.471761 IP 157.7.180.133.domain > <サーバIP>.60080: UDP, length 115

157.7.180.133はcache02.conoha.jpなのでVPSのサービス元ですね。

それを除くとするとtcpの通信は25種類のPortが発生している模様。

いったい何なのだろうか。

といったところでいったん時間切れ。

調査は続行しつつ、iptables側でdaemon単位で解放とかないか確認しないとね。。。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です