Hello, I’m having an issue with my container not connecting to an external PPTP server using the bridge network. The issue seems to be related to GRE packets not being forwarded to the container.
If I use --net=host, the container successfully connects.
Also, on my laptop (using the same version of docker), the container works with the bridge network.
My host is Debian Stretch.
Client:
Version: 17.09.1-ce
API version: 1.32
Go version: go1.8.3
Git commit: 19e2cf6
Built: Thu Dec 7 22:24:16 2017
OS/Arch: linux/amd64
Server:
Version: 17.09.1-ce
API version: 1.32 (minimum version 1.12)
Go version: go1.8.3
Git commit: 19e2cf6
Built: Thu Dec 7 22:22:56 2017
OS/Arch: linux/amd64
Experimental: false
When I run the container using the bridge network, the container does have an internet connection. For instance, watching the tcpdump while running “ping -c1 google.com” yields
# tcpdump -i $(ip addr | perl -n -e'/(veth.*)@/ && print $1')
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on veth33d584d, link-type EN10MB (Ethernet), capture size 262144 bytes
17:35:26.120608 IP 172.17.0.2.58358 > google-public-dns-a.google.com.domain: 43748+ A? google.com. (28)
17:35:26.120628 IP 172.17.0.2.58358 > google-public-dns-a.google.com.domain: 44095+ AAAA? google.com. (28)
17:35:26.142104 IP google-public-dns-a.google.com.domain > 172.17.0.2.58358: 43748 1/0/0 A 216.58.195.78 (44)
17:35:26.145277 IP google-public-dns-a.google.com.domain > 172.17.0.2.58358: 44095 1/0/0 AAAA 2607:f8b0:4005:808::200e (56)
17:35:26.145887 IP 172.17.0.2 > sfo07s16-in-f14.1e100.net: ICMP echo request, id 2816, seq 0, length 64
17:35:26.147185 IP sfo07s16-in-f14.1e100.net > 172.17.0.2: ICMP echo reply, id 2816, seq 0, length 64
17:35:31.277512 ARP, Request who-has 172.17.0.2 tell 172.17.0.1, length 28
17:35:31.277594 ARP, Request who-has 172.17.0.1 tell 172.17.0.2, length 28
17:35:31.277609 ARP, Reply 172.17.0.1 is-at 02:42:ce:84:90:11 (oui Unknown), length 28
17:35:31.277611 ARP, Reply 172.17.0.2 is-at 02:42:ac:11:00:02 (oui Unknown), length 28
You can see that traffic is being routed to and from the container correctly here. However, trying to connect to the PPTP server, I only see one way traffic like this:
# tcpdump -i $(ip addr | perl -n -e'/(veth.*)@/ && print $1')
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on veth9d23755, link-type EN10MB (Ethernet), capture size 262144 bytes
17:38:52.994815 IP 172.17.0.2 > [EXTERNAL SERVER]: GREv1, call 1377, seq 7, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:38:55.998040 IP 172.17.0.2 > [EXTERNAL SERVER]: GREv1, call 1377, seq 8, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:38:59.001220 IP 172.17.0.2 > [EXTERNAL SERVER]: GREv1, call 1377, seq 9, length 36: LCP, Conf-Request (0x01), id 1, length 22
Watching the host device, though, during the same process shows that the host is receiving responses from the server:
# tcpdump -i eth0 proto GRE
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
17:42:57.097051 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 1, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:42:57.129178 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 0, ack 1, length 72: LCP, Conf-Request (0x01), id 0, length 54
17:42:57.129257 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 1, length 36: LCP, Conf-Ack (0x02), id 1, length 22
17:42:59.127461 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 2, length 68: LCP, Conf-Request (0x01), id 1, length 54
17:42:59.982903 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 2, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:00.014645 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 3, ack 2, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:02.112996 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 4, length 68: LCP, Conf-Request (0x01), id 2, length 54
17:43:02.985988 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 3, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:03.017733 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 5, ack 3, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:05.989102 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 4, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:06.020984 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 6, ack 4, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:06.132897 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 7, length 68: LCP, Conf-Request (0x01), id 3, length 54
17:43:08.992230 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 5, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:09.024055 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 8, ack 5, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:10.136056 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 9, length 68: LCP, Conf-Request (0x01), id 4, length 54
17:43:11.995347 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 6, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:12.026995 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 10, ack 6, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:14.142478 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 11, length 68: LCP, Conf-Request (0x01), id 5, length 54
17:43:14.998489 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 7, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:15.030213 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 12, ack 7, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:18.001597 IP [HOST MACHINE] > [EXTERNAL SERVER]: GREv1, call 7561, seq 8, length 36: LCP, Conf-Request (0x01), id 1, length 22
17:43:18.034240 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 13, ack 8, length 40: LCP, Conf-Ack (0x02), id 1, length 22
17:43:18.149176 IP [EXTERNAL SERVER] > [HOST MACHINE]: GREv1, call 63861, seq 14, length 68: LCP, Conf-Request (0x01), id 6, length 54
That is, the host machine and external server are communicating, but the GRE packets never seem to make it to the veth device in the container.
Again, if I monitor the veth device on my laptop, using the same version of docker, I see and back and forth with the external server. Both machines also have identical iptables configurations.
Any advice would be greatly appreciated!