tcpcopy icon indicating copy to clipboard operation
tcpcopy copied to clipboard

在docker容器里部署tcpcopy,抓包发现虚拟的客户端ip与测试服务器tcp握手不成功

Open shenhuayingshy opened this issue 6 years ago • 1 comments

我的服务器环境为阿里云docker容器 我的部署环境如下: 一台正式服务器在容器里面安装tcpcopy,ip:172.24.120.5:8045 测试和辅助在一台机器上,在容器里安装intercept,ip:172.24.4.4:8045

运行顺序如下: /usr/local/intercept/sbin/intercept -i eth0 -F tcp and src port 8045 -d

/usr/local/tcpcopy/sbin/tcpcopy -x 8045-172.24.4.4:8045 -s 172.24.4.4 -c 172.24.4.100 -d

测试服务器运行抓包结果如下: 65 7.920939 172.24.4.100 172.24.4.4 TCP 74 48712 → 8045 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=19666714 TSecr=0 WS=128 69 8.222157 172.24.4.100 172.24.4.4 TCP 54 48698 → 8045 [RST, ACK] Seq=1 Ack=1 Win=8388480 Len=0 74 8.835889 172.24.4.100 172.24.4.4 TCP 54 48702 → 8045 [RST, ACK] Seq=1 Ack=1 Win=8388480 Len=0 77 9.391577 172.24.4.100 172.24.4.4 TCP 54 48704 → 8045 [RST, ACK] Seq=1 Ack=1 Win=8388480 Len=0

tcpcopylog如下: 2018/08/01 16:46:04 +672 [notice] user time used:0 2018/08/01 16:46:04 +672 [notice] sys time used:0 2018/08/01 16:46:04 +672 [notice] max memory size:4028 2018/08/01 16:46:04 +672 [notice] voluntary ctx switches:2913 2018/08/01 16:46:04 +672 [notice] involuntary ctx switches:0 2018/08/01 16:46:04 +682 [notice] active:0,rel:11,obs del:0,tw:0 2018/08/01 16:46:04 +682 [notice] conns:0,resp:0,c-resp:0 2018/08/01 16:46:04 +682 [notice] resp fin:0,resp rst:0 2018/08/01 16:46:04 +682 [notice] send:22,send content:0 2018/08/01 16:46:04 +682 [notice] send syn:11, fin:0,reset:11 2018/08/01 16:46:04 +682 [notice] reconnect:0,for no syn:0 2018/08/01 16:46:04 +682 [notice] retransmit:0 2018/08/01 16:46:04 +682 [notice] recv packs after retransmission:0 2018/08/01 16:46:04 +682 [notice] syn cnt:11,all clt:66,clt cont:11 2018/08/01 16:46:04 +682 [notice] total cont retransmit:0, frag:0 2018/08/01 16:46:04 +682 [notice] total captured packets:580 2018/08/01 16:46:34 +682 [notice] active:0,rel:11,obs del:0,tw:0 2018/08/01 16:46:34 +682 [notice] conns:0,resp:0,c-resp:0 2018/08/01 16:46:34 +682 [notice] resp fin:0,resp rst:0 2018/08/01 16:46:34 +682 [notice] send:22,send content:0 2018/08/01 16:46:34 +682 [notice] send syn:11, fin:0,reset:11 2018/08/01 16:46:34 +682 [notice] reconnect:0,for no syn:0 2018/08/01 16:46:34 +682 [notice] retransmit:0 2018/08/01 16:46:34 +682 [notice] recv packs after retransmission:0 2018/08/01 16:46:34 +682 [notice] syn cnt:11,all clt:66,clt cont:11 2018/08/01 16:46:34 +682 [notice] total cont retransmit:0, frag:0 2018/08/01 16:46:34 +682 [notice] total captured packets:605

intercept端log如下: 2018/08/01 16:44:55 +029 [notice] reset from tcp 2018/08/01 16:44:55 +061 [notice] reset from tcp 2018/08/01 16:44:55 +163 [notice] total resp packs:24182, all:24182, route:21, sock write cnt:0 2018/08/01 16:44:55 +163 [notice] cache hit:0,missed:0,lost:24182 2018/08/01 16:44:55 +163 [notice] search:24182,extra compared:0,all sessions:21 2018/08/01 16:44:55 +644 [notice] reset from tcp 2018/08/01 16:44:56 +230 [notice] reset from tcp 2018/08/01 16:44:56 +230 [notice] reset from tcp 2018/08/01 16:44:56 +830 [notice] reset from tcp

求大神赐教,多谢

shenhuayingshy avatar Aug 01 '18 08:08 shenhuayingshy

参考 https://github.com/session-replay-tools/tcpcopy/issues/315

wangbin579 avatar Aug 02 '18 10:08 wangbin579