From owner-freebsd-net@FreeBSD.ORG Fri Sep 14 10:57:03 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 928FE16A418 for ; Fri, 14 Sep 2007 10:57:03 +0000 (UTC) (envelope-from cristi@net.utcluj.ro) Received: from bavaria.utcluj.ro (unknown [IPv6:2001:b30:5000:2:20e:cff:fe4b:ca01]) by mx1.freebsd.org (Postfix) with ESMTP id 16CA913C458 for ; Fri, 14 Sep 2007 10:57:03 +0000 (UTC) (envelope-from cristi@net.utcluj.ro) Received: from localhost (localhost [127.0.0.1]) by bavaria.utcluj.ro (Postfix) with ESMTP id AFC6750871; Fri, 14 Sep 2007 13:57:01 +0300 (EEST) X-Virus-Scanned: by the daemon playing with your mail on local.mail.utcluj.ro Received: from bavaria.utcluj.ro ([127.0.0.1]) by localhost (bavaria.utcluj.ro [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HTU3VBUMkagZ; Fri, 14 Sep 2007 13:56:58 +0300 (EEST) Received: from [193.226.5.46] (hades.utcluj.ro [193.226.5.46]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by bavaria.utcluj.ro (Postfix) with ESMTP id 989A95087B; Fri, 14 Sep 2007 13:56:58 +0300 (EEST) Message-ID: <46EA68FB.8010108@net.utcluj.ro> Date: Fri, 14 Sep 2007 13:56:59 +0300 From: Cristian KLEIN User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: myronn@seed.net.tw References: <18389100.19191189762877349.JavaMail.root@wm8.seed.net.tw> In-Reply-To: <18389100.19191189762877349.JavaMail.root@wm8.seed.net.tw> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: ICMP issue while multiple interface in the same subnet X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2007 10:57:03 -0000 myronn@seed.net.tw wrote: > Hi, > For a special test reason, I must use two hosts and it has two interfaces to connect each other without any switch or hub. > Host1 Host2 > |-----| |-----| > | 1 0-----------------0 1 | > | | | | > | 2 0-----------------0 2 | > |-----| |-----| > > Host platform OS is BSD. I assigned Host1 NIC1 ping Host NIC2. Command is correct but I found as follows: > 1. Host1 arp broadcast to Host2 and Host2 would be return info to Host1. > 2. Then, Host1 sent ICMP request packet to Host2. > 3. Host2 received packet and always "USE" NIC2 replaying the ICMP reply. > 4. If Host1 use NIC2 ping Host2 NIC2, Host1 NIC2 could get the ICMP reply packet from Host2 NIC2. > > Question: > 1. This behavior is a normal network behavior? > 2. If it's a normal network behavior, it followed which standard? > 3. I know that there were other softwares could change this behavior but why many platforms(BSD,Linux,.....) used this behavior was its default network behavior? > 4. Why default behavior is incoming interface different from outgoing interface? > 5. If I set all interfaces are in the same subnet and the incoming interface is the same with outgoing interface, what weakness would be happened? Hi, This is the expected behaviour. ICMP reply packets are sent to the destination based on routing table, and not on the same interface as the incoming ICMP request packet. Depending on what you would like to accomplish, your solution could be as easy as adding a route, or as complicated as using policy routing.