Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Drop traffic from docker0 bridge to weave bridge #704

Merged
merged 3 commits into from
May 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/130_expose_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ exec_on1() {
assert_raises "exec_on $HOST1 $@"
}

# Containers in the same subnet should be able to talk; different subnet not.
check_container_connectivity() {
exec_on1 "c1 $PING $C2"
exec_on1 "c3 $PING $C4"
exec_on1 "c5 $PING $C6"
# fails due to #620
# exec_on1 "c3 ! $PING $C1"
# exec_on1 "c5 ! $PING $C1"
# exec_on1 "c5 ! $PING $C3"
exec_on1 "c1 sh -c \"! $PING $C3\""
exec_on1 "c3 sh -c \"! $PING $C5\""
exec_on1 "c5 sh -c \"! $PING $C1\""
}

start_suite "exposing weave network to host"
Expand Down
3 changes: 3 additions & 0 deletions weave
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ create_bridge() {
ip link add name v${CONTAINER_IFNAME}du mtu $MTU type dummy
ip link set dev v${CONTAINER_IFNAME}du master $BRIDGE
ip link del dev v${CONTAINER_IFNAME}du
# Drop traffic from Docker bridge to Weave; it can break subnet isolation
run_iptables -t filter -I FORWARD -i $DOCKER_BRIDGE -o $BRIDGE -j DROP
# Work around the situation where there are no rules allowing traffic
# across our bridge. E.g. ufw
add_iptables_rule filter FORWARD -i $BRIDGE -o $BRIDGE -j ACCEPT
Expand All @@ -282,6 +284,7 @@ destroy_bridge() {
if [ -d /sys/class/net/$BRIDGE ] ; then
ip link del dev $BRIDGE
fi
run_iptables -t filter -D FORWARD -i $DOCKER_BRIDGE -o $BRIDGE -j DROP 2>/dev/null || true
run_iptables -t filter -D FORWARD -i $BRIDGE -o $BRIDGE -j ACCEPT 2>/dev/null || true
run_iptables -t nat -F WEAVE >/dev/null 2>&1 || true
run_iptables -t nat -D POSTROUTING -j WEAVE >/dev/null 2>&1 || true
Expand Down