-
Notifications
You must be signed in to change notification settings - Fork 674
Conversation
7bb70b7
to
7a1a191
Compare
if ! ip link add name $BRIDGE_IFNAME mtu $MTU type veth peer name $PCAP_IFNAME mtu $MTU || | ||
! ip link set $BRIDGE_IFNAME up || | ||
! add_iface_bridge $BRIDGE_IFNAME || | ||
! ip link set $PCAP_IFNAME up ; then |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
c6903da
to
1f501f3
Compare
Addressed comments and updated mesh dependency. |
I think |
1f501f3
to
9d0ad01
Compare
The old multiweave lets one launch additional peers, and also stop just some of the peers, by setting
This is no longer possible since a) 'launch' will trip over the multiweave bridge creation, and b) 'stop' will remove the bridge even though there are still weaves connected to it. Suggested fix:
|
0e0d97b
to
0946417
Compare
which allows us to get rid of port mappings and a whole bunch of other code.
We already know what the weave container IP is, since now it runs in the host netns.
Allow the weave router bind to a specific host IP address instead of INADDR_ANY.
cfd5136
to
6484d20
Compare
...and now so does the new multiweave. |
Multiweave now creates a temporary bridge with an IP alias per router in the host netns, and overrides the router to bind to that specific IP for weave protocol and data traffic and http control.
6484d20
to
034d893
Compare
For posterity, here is a patch to multiweave that makes it use just distinct ports instead of IPs. This does work but results in some "connection shutting down due to error: cannot connect to ourself" noise. diff --git a/bin/multiweave b/bin/multiweave
index 40654b4..090776e 100755
--- a/bin/multiweave
+++ b/bin/multiweave
@@ -15,8 +15,6 @@ START=${FIRST_WEAVE:-1}
COUNT=${NUM_WEAVES:-28}
FINISH=$((START+COUNT-1))
-SUBNET=192.168.7
-
weavedir=$(dirname $0)/..
# Generate a random MAC value - copied from 'weave' script
@@ -30,24 +28,21 @@ random_mac() {
weave() {
i=$1
shift
- WEAVE_CONTAINER_NAME=weave$i WEAVE_HTTP_ADDR=$SUBNET.$i:6784 $weavedir/weave "$@"
+ WEAVE_CONTAINER_NAME=weave$i WEAVE_HTTP_ADDR=127.0.0.1:$((6000+i)) WEAVE_PORT=$((5000+i)) $weavedir/weave "$@"
}
case "$1" in
launch)
shift 1
echo $(date -R) launching
- ip link show multiweave >/dev/null 2>&1 || sudo ip link add name multiweave type bridge
for i in $(seq $START $FINISH); do
- IP=$SUBNET.$i
- sudo ip addr add $IP/24 dev multiweave
- weave $i launch-router --datapath '' --iface '' --no-dns --host $IP \
+ weave $i launch-router --datapath '' --iface '' --no-dns --port $((5000+i)) \
--name $(random_mac) --nickname weave$i "$@"
done
echo $(date -R) connecting
[ $START -gt 1 ] || START=2
for i in $(seq $START $FINISH); do
- TO=$SUBNET.$((i-1))
+ TO=localhost:$((5000+i-1))
echo connecting weave$i to $TO
weave $i connect $TO
done
@@ -55,12 +50,9 @@ case "$1" in
;;
stop)
for i in $(seq $FINISH -1 $START); do
- IP=$SUBNET.$i
echo Stopping weave$i
weave $i stop-router
- sudo ip addr del $IP/24 dev multiweave || true
done
- [ -z "$(ip -4 -o addr show multiweave)" ] && sudo ip link del multiweave
;;
*)
weave "$@" |
Fixes #1589,#1746.
This PR currently depends on an as yet unmerged change in mesh (weaveworks/mesh#5); that should be merged first and this PR rebased accordingly.