From owner-freebsd-net@FreeBSD.ORG Fri Feb 18 08:41:42 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8693016A4CE for ; Fri, 18 Feb 2005 08:41:42 +0000 (GMT) Received: from relay.bestcom.ru (relay.bestcom.ru [217.72.144.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 880B343D5E for ; Fri, 18 Feb 2005 08:41:41 +0000 (GMT) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (root@cell.sick.ru [217.72.144.68]) by relay.bestcom.ru (8.13.1/8.12.9) with ESMTP id j1I8fdwh055160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 18 Feb 2005 11:41:40 +0300 (MSK) (envelope-from glebius@freebsd.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.12.11/8.12.8) with ESMTP id j1I8fdlp004308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 18 Feb 2005 11:41:39 +0300 (MSK) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.sick.ru (8.12.11/8.12.11/Submit) id j1I8fc3E004307; Fri, 18 Feb 2005 11:41:39 +0300 (MSK) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@freebsd.org using -f Date: Fri, 18 Feb 2005 11:41:38 +0300 From: Gleb Smirnoff To: Marko Lerota Message-ID: <20050218084138.GB4027@cell.sick.ru> Mail-Followup-To: Gleb Smirnoff , Marko Lerota , freebsd-net@freebsd.org References: <86ll9mcm4y.fsf@redcloud.local> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <86ll9mcm4y.fsf@redcloud.local> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV version devel-20050125, clamav-milter version 0.80ff on relay.bestcom.ru X-Virus-Status: Clean cc: freebsd-net@freebsd.org Subject: Re: redundant ethernet interfaces X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 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, 18 Feb 2005 08:41:42 -0000 On Fri, Feb 18, 2005 at 09:23:09AM +0100, Marko Lerota wrote: M> I have two nic bge0 and bge0, and I would like them M> to have the same IP address in case that my redundant M> switch stop responding. Bridge is not an option, M> I tried with netgraph but I did not succeed. M> Does anyone have some solution? M> M> here is my config M> M> rc.conf M> ifconfig_bge0="1.2.3.4 netmask 255.255.0.0 media 100baseTX mediaopt M> full-duplex" M> ifconfig_bge1="media 100baseTX mediaopt full-duplex" M> M> and /usr/local/etc/rc.d/bonding.sh M> M> #!/bin/sh M> ifconfig bge1 up M> kldload /boot/kernel/ng_ether.ko M> kldload /boot/kernel/ng_one2many.ko M> ngctl mkpeer bge0: one2many upper one M> ngctl connect bge0: bge0:upper lower many0 M> ngctl connect bge1: bge0:upper lower many1 M> ngctl msg bge1: setpromisc 1 M> ngctl msg bge1: setautosrc 0 M> ngctl msg bge0:upper setconfig "{xmitAlg=1 failAlg=1 enabledLinks =[ 1 M> 1 ] }" M> I followed the examples from google groups and I stuck with M> duplicated packets when both ethernets are plugged and M> 50% packet loss when one ethernet is unplugged, damn !!#@!#@!$%^@$#@ It is very strange that you have duplicates. Do you see duplicates of incoming or outgoing packets? 50% packet loss is because to ng_one2many can't detect which link is active and which is not. We have a solution for this in HEAD, but I'm very sorry we can't MFC this to RELENG_5 due to ABI freeze. You can bring up patches from HEAD to your system. Actually, I'd better recommend you the following setup: ifconfig bge0 up ifconfig bge1 up kldload /boot/kernel/ng_ether.ko kldload /boot/kernel/ng_one2many.ko kldload /boot/kernel/ng_eiface.ko ngctl mkpeer bge0: one2many lower many0 ngctl connect bge1: bge0:lower lower many1 ngctl msg bge1: setenaddr ${MAC-address-of-bge0} ngctl mkpeer bge0:lower eiface one ether ngctl msg bge0:lower.one set ${MAC-address-of-bge0} ngctl msg bge0:lower setconfig "{xmitAlg=1 failAlg=2 enabledLinks =[ 1 1 ] " ifconfig ngeth0 1.2.3.4 netmask 255.255.0.0 Notice that I use failAlg=2, to make ng_one2many listen to flow control messages. However, ng_ether can't send these messages in RELENG_5, see above. And this setup is not guaranteed to work flawlessly unless you have a smart switch and this two cables are plugged into one trunk group on switch. M> manual for this sucks I plan to write a handbook chapter on netgraph sometime this year. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE