Merge pull request #2527 from weaveworks/2494-track-non-natted-shortlived-conns

Let conntrack track non-NATed short-lived connections
This commit is contained in:
Alfonso Acosta
2017-05-19 01:42:02 +02:00
committed by GitHub
2 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
#! /bin/bash
# shellcheck disable=SC1091
. ./config.sh
start_suite "Test short lived connections between containers without Weave (no NAT)"
scope_on "$HOST1" launch
docker_on "$HOST1" run -d --name nginx nginx
wait_for_containers "$HOST1" 60 nginx
nginx_ip="$(docker_on "$HOST1" inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx)"
docker_on "$HOST1" run -d --name client alpine /bin/sh -c "while true; do \
wget $nginx_ip:80/ -O - >/dev/null || true; \
sleep 1; \
done"
wait_for_containers "$HOST1" 60 client
has_container "$HOST1" nginx
has_container "$HOST1" client
has_connection containers "$HOST1" client nginx
scope_end_suite

View File

@@ -37,7 +37,7 @@ func newProcfsConnectionTracker(conf connectionTrackerConfig) connectionTracker
}
return connectionTracker{
conf: conf,
flowWalker: newConntrackFlowWalker(conf.UseConntrack, conf.ProcRoot, conf.BufferSize, "--any-nat"),
flowWalker: newConntrackFlowWalker(conf.UseConntrack, conf.ProcRoot, conf.BufferSize),
ebpfTracker: nil,
reverseResolver: newReverseResolver(),
}