Currently I have a setup with 1 physical NIC with a public IP address, a standard docker environment and a GRE tunnel & bridge. If I run a container on a port, lets say 80, I'll be able to connect directly to the container via the public IP address.
However when attempting to connect via the GRE tunnel the traffic is routed back to the default route.
An attempted connection via the tunnel:
00:52:43.899400 tun0 In IP {client_ip}.57122 > {tunnel_ip}.80: Flags [S], seq 1853400133, win 64240, options [mss 1400,nop,wscale 8,nop,nop,sackOK], length 0
00:52:43.899501 enp3s0f0 Out IP {tunnel_ip}.80 > {client_ip}.57122: Flags [S.], seq 3563157661, ack 1853400134, win 64240, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
And a successful connection via the public IP:
00:52:48.822480 enp3s0f0 In IP {client_ip}.57112 > {public_ip}.80: Flags [P.], seq 3944436694:3944437201, ack 1907727361, win 1029, length 507
00:52:48.823843 enp3s0f0 Out IP {public_ip}.80 > {client_ip}.57112: Flags [P.], seq 1:109, ack 507, win 501, length 108
So my issue is that traffic is being routed from tunnel -> docker container -> public interface
rather than returning to the tunnel. I've read multiple articles around the docker networking subject but couldn't find anything specific about this sort of issue. Any help appreciated.