tried with 7000, with freshly created container with ubuntu.
same result - if mapped, your test return opened, if not mapped - return "not".
I even make telnet tcpdump in both cases (for 9000 which is mapped and 9001 is not), different response from socket:
Code: Select all
admin@stormain:~$ sudo tcpdump -nvv host 192.168.1.216
tcpdump: listening on docker0, link-type EN10MB (Ethernet), capture size 262144 bytes
01:31:20.517342 IP (tos 0x10, ttl 64, id 42615, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [S], cksum 0x6ec3 (incorrect -> 0x763e), seq 1427778998, win 29200, options [mss 1460,sackO0
01:31:20.517384 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [S.], cksum 0x6ec3 (incorrect -> 0xce9a), seq 2384749922, ack 1427778999, win 28960, option0
01:31:20.517404 IP (tos 0x10, ttl 64, id 42616, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [.], cksum 0x6ebb (incorrect -> 0x6da2), seq 1, ack 1, win 229, options [nop,nop,TS val 6910
01:31:20.517684 IP (tos 0x0, ttl 64, id 61090, offset 0, flags [DF], proto TCP (6), length 52)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [F.], cksum 0x6ebb (incorrect -> 0x6da3), seq 1, ack 1, win 227, options [nop,nop,TS val 690
01:31:20.517767 IP (tos 0x10, ttl 64, id 42617, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [.], cksum 0x6ebb (incorrect -> 0x6da0), seq 1, ack 2, win 229, options [nop,nop,TS val 6910
01:31:20.517816 IP (tos 0x10, ttl 64, id 42618, offset 0, flags [DF], proto TCP (6), length 52)
172.17.0.3.40440 > 192.168.1.216.7000: Flags [F.], cksum 0x6ebb (incorrect -> 0x6d9f), seq 1, ack 2, win 229, options [nop,nop,TS val 690
01:31:20.517826 IP (tos 0x0, ttl 64, id 18465, offset 0, flags [DF], proto TCP (6), length 52)
192.168.1.216.7000 > 172.17.0.3.40440: Flags [.], cksum 0x6da0 (correct), seq 2, ack 2, win 227, options [nop,nop,TS val 691702722 ecr 60
01:31:28.225011 IP (tos 0x10, ttl 64, id 34718, offset 0, flags [DF], proto TCP (6), length 60)
172.17.0.3.44540 > 192.168.1.216.7001: Flags [S], cksum 0x6ec3 (incorrect -> 0x2353), seq 2035756611, win 29200, options [mss 1460,sackO0
01:31:28.225051 IP (tos 0x10, ttl 64, id 22136, offset 0, flags [DF], proto TCP (6), length 40)
192.168.1.216.7001 > 172.17.0.3.44540: Flags [R.], cksum 0xd04a (correct), seq 0, ack 2035756612, win 0, length 0