From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: tbskyd@gmail.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id fd7657e9 for ; Sun, 3 Dec 2017 17:39:19 +0000 (UTC) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 3390149d for ; Sun, 3 Dec 2017 17:39:18 +0000 (UTC) Received: by mail-wm0-f50.google.com with SMTP id f9so10667808wmh.0 for ; Sun, 03 Dec 2017 09:45:51 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20171129135124.GA29970@zx2c4.com> From: d tbsky Date: Mon, 4 Dec 2017 01:45:50 +0800 Message-ID: Subject: Re: multi-home difficulty To: "Jason A. Donenfeld" Content-Type: text/plain; charset="UTF-8" Cc: WireGuard mailing list List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 2017-12-01 15:44 GMT+08:00 d tbsky : > 2017-11-29 22:49 GMT+08:00 Jason A. Donenfeld : >> On Wed, Nov 29, 2017 at 3:16 PM, d tbsky wrote: >>> sorry I misunderstand you. you mean I modify the script and run >>> in my environment to reveal the problem? >>> ok I will try to do it. >> >> Take what I sent you. Run it. If it breaks, send me the output and >> your kernel. If it doesn't break, mess with it until it breaks, and >> then send it back to me. Hi Jason: sorry for bothering your again. I still can not find the key point. my testing environment is rhel 7.4, I have tried kernel 3.10, 4.4, 4.14. wireguard 20171111 and 20171127. I have three things in mind. 1. when wireguard communication established, it will remember self source ip(although "wg wg0" didn't show) forever until changed next time. I don't know if the assumption true, could you tell me? I don't know if this is wireguard feature or netns feature. 2. I build three netns environment, to emulate multi-home-client, multi-home-server, and a router between client/server. wireguard works perfect under netns environment. 3. in real world the situation is strange. as I said last time, build a simple vm with two nic(in the same host bridge) will reveal the problem. my vm looks like below: >ip addr show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:ff:29:75 brd ff:ff:ff:ff:ff:ff 3: eth1: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 52:54:00:31:d3:1a brd ff:ff:ff:ff:ff:ff inet 10.99.1.99/24 scope global eth1 valid_lft forever preferred_lft forever inet 10.99.1.100/24 scope global secondary eth1 valid_lft forever preferred_lft forever it is the most simple config I could find to reveal the problem. situation below won't show any problem: 1. single nic 2. two nic but ip bound to first nic 3. two nic but first nic state is "down", not "up". the problem is the same under kernel 3.10, 4.4, 4.14. when client connect to server ip "10.99.1.100", server will reply with ip "10.99.1.99". it is really a puzzle to me. but maybe you can see why immediately if you have the environment. thanks a lot for your patience. Regards, tbskyd