From owner-freebsd-net Sun Feb 17 3:45: 5 2002 Delivered-To: freebsd-net@freebsd.org Received: from email.seznam.cz (smtp.seznam.cz [195.119.180.43]) by hub.freebsd.org (Postfix) with SMTP id 9010B37B404 for ; Sun, 17 Feb 2002 03:44:56 -0800 (PST) Received: (qmail 91692 invoked from network); 17 Feb 2002 11:44:54 -0000 Received: from linux.sux.cz (HELO notes) (62.24.72.206) by smtp.seznam.cz with SMTP; 17 Feb 2002 11:44:54 -0000 Message-ID: <003501c1b7a8$4431d5f0$0500a8c0@notes> From: "Zviratko" To: References: Subject: Re: Ethernet bonding/load balancing on fbsd 4-stable Date: Sun, 17 Feb 2002 12:43:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > > Hi, > > is there a preferred way to do ethernet load balancing? My situation is - 2 > > cable modems connected to two ethernet cards on with a machine functioning > > as a NAT gateway for LAN. I tried netgraph (ng_ether with round robin and > > ng_fec). With ng_ether, I achieved packets being sent via one interface and > > received on another one(not what I want), ng_fec didn't work at all (it just > > silently dropped all outgoing packets). > > ng_fec needs a cisco at the other end (or possibly another freebsd > machine with ng_fec but I don't know that). > yes, bond.c does as well, but it worked in my situation because of the structure of the network I am on (basically, the nearest other host that understands IP is Cisco 6K (i think). It worked exactly in the way it should with ng_fec - 2 interfaces with the same MAC and IP and round robin routing policy. But when I look at netstat -in, I see no packets being sent out via fec0 (and thus they are dropped somewhere :-( ) > > Is there another way? I already did this with linux (by using bond.c > > similiar to ng_fec) and it worked under the same conditions. > > Any advice would be appreciated. > > if your outgoing packets are going to different hosts (and not just one) > you could try: > > ipfw add 1000 fwd {remote 1} ip from any to 0.0.1.0:0.0.1.0 out xmit fxp1 > ipfw add 1001 fwd {remote 2} ip from any to 0.0.0.0:0.0.1.0 out xmit fxp1 > > where "remote 1" and "remote 2" are the gateways on each cable modem, > (or some address that will make them go to different ports) > and fxp1 is the interface tha the routing table would make them go out of > normally. I will try that, but I guess default route has precedence over ipfw. > > alternatively, the netgraph approach should work but I'm guessing > that you've set up something wrong.. > what is your configuration? > > basically, I was trying the sample from man 4 ng_ether as following: ed1: ne2k card connected to cable modem ed2: ne2k card (another clone) connected to cable modem ngctl mkpeer ed2: one2many upper one ngctl connect ed2: ed2:upper lower many0 ngctl connect ed1: ed2:upper lower many1 ngctl msg ed1: setpromisc 1 ngctl msg ed1: setautosrc 0 # Configure all four links as up ngctl msg ed2:upper \ setconfig "{ xmitAlg=1 failAlg=1 enabledLinks=[ 1 1 1 1 ] }" # Bring up interface ifconfig ed2 inet my.ip.goes.here netmask 255.255.255.0 then, I set a route to my default gw, but all packets are then routed via one interface out and one in, but I want them flowing one-by-one via both as I used to do with bond.c. The one solution would be to route packets non-interface-specificaly, that means by random or round robin, but it seems like the "route" command doesn't support specifying interface at all! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message