From owner-freebsd-net@FreeBSD.ORG Wed Aug 21 18:13:56 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0C65BB31; Wed, 21 Aug 2013 18:13:56 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A02622EE3; Wed, 21 Aug 2013 18:13:55 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id o19so590459qap.6 for ; Wed, 21 Aug 2013 11:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:cc:content-type; bh=W1PvSYU1kuOgHbE/Mvknjm1VwIOHOprsKTWOmjkEx84=; b=kHDWztZZXoyU1HXd4mzOOlvYsMU15+xD90s7DZYjidj9SKsJBuZ0JuVSgbXLYJ2fvK 0HhWF6MhzXvQ2qTSEBSJ2rdhmL93ojF6Cvnot87VGoKfWSQ/yMQjFUDKWB4pgGBweOOi +SVk3tbyNnlqZQ3N0e+oBaXsMk1+uo5eh84EWOxToQlRudhfJE9AWBDmkXCgn7sXbfy1 eRIUBpqyuUa7C7qrZcg+RF//f+eCQuLGRmCve69NHiP/TPdQu3h8SrAfoyJ5fkhLSyGF 88XJcof4FIFTm0pa6nFrfwnqqbbfQJK9WlYnkccfpocc0Mzt/EvoR3zJnHb6m+XFEZXu 7qBA== MIME-Version: 1.0 X-Received: by 10.224.23.134 with SMTP id r6mr12317407qab.34.1377108834807; Wed, 21 Aug 2013 11:13:54 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.49.39.101 with HTTP; Wed, 21 Aug 2013 11:13:54 -0700 (PDT) Date: Wed, 21 Aug 2013 12:13:54 -0600 X-Google-Sender-Auth: x2ecm5iLbXtvTvm0IdKz4JNWdQk Message-ID: Subject: Re: CFR: FIB handling improvements From: Alan Somers To: "Sam Fourman Jr." Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-net@freebsd.org, Will Andrews , "Justin T. Gibbs" , Alan Somers X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Aug 2013 18:13:56 -0000 On Wed, Aug 21, 2013 at 11:48 AM, Sam Fourman Jr. wrote: > > * Use of dhclient with non-zero FIBs. With this patch, it is possible > >> to use DHCP on a specific interface with a non-zero FIB and have it >> work correctly with this rc.conf snippet: >> >> ifconfig_em1="SYNCDHCP" >> dhclient_fib_em1=1 >> > > This patch is needed, I have a situation where we have > 2 internet providers, one is a static ip set in rc.conf, the other > provider forces > the use of DHCP, but trying to use the "DHCP" connection only for a > "Backup" > caused the problem of the primary gateway being overwritten on fib0 (the > static) > I tried to solve it by the following in /etc/rc.local: > > /usr/sbin/setfib 1 /sbin/dhclient re2 > setfib 0 route delete default > setfib 1 route delete default > setfib 1 route add default 99.55.240.1 > setfib 0 route add default 75.133.75.193 > > this sorta works, but in practice after several hours (not sure why) > all of the traffic on the machine tries to use the gateway of FIB1. > this problem ONLY shows up when the use of DHCP is in the mix. > > > So my question is twofold, is my situation what this patch is supposed to > fix? > or did I simply find a bug in the interface code? that will sort of eludes > to > > Thank you for your work > -- > > Sam Fourman Jr. > Yes, this patch will probably fix your problem. We regularly configure machines with static on igb0, dynamic on igb1, and separate gateways for each.