From owner-freebsd-questions@freebsd.org Fri Oct 2 03:42:18 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F836A0C27E for ; Fri, 2 Oct 2015 03:42:18 +0000 (UTC) (envelope-from doroseracledes@gmail.com) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19C621C3E for ; Fri, 2 Oct 2015 03:42:18 +0000 (UTC) (envelope-from doroseracledes@gmail.com) Received: by wicgb1 with SMTP id gb1so15161399wic.1 for ; Thu, 01 Oct 2015 20:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:message-id:date :subject:from:in-reply-to:references:to; bh=I/H00Q1VjtJdof0lRM2O4w0zoDTFmnZeFTwQcjvljKQ=; b=yj3b+fsdMFPb0c4bVCc3Dh9Od51tvq+yyjRxMgZvrFu3k3lEsoRqQoJlOwV5L8jL4l 67bu2fBT5StvsKR3yQjCDeFoKLq2u6wJw7TajbgPCZ/76V9AbD/Krkzge294ujtOeQ+f LZ1BBZxlAWGmQBsGSSpO2mGhkUFZ7+mboHYURNaUQheMyBVTAvsf9xO3Os3Kl4c9UxtC qVXUHHRpwQu06bF+AC+doLMS83wzb9ffvsIOe7OeofW3bypov3ZwOv6rlQ2qKtxkYCsQ IAF74as0ZX8W+uRFfUdIJyNdPyKWbSOvQxijF0cghK48yMb00GakyfqGssjvk7cnOcwy tkKg== X-Received: by 10.181.29.74 with SMTP id ju10mr2028543wid.5.1443757336551; Thu, 01 Oct 2015 20:42:16 -0700 (PDT) Received: from [127.0.0.1] ([213.140.204.96]) by smtp.gmail.com with ESMTPSA id go5sm6207643wib.3.2015.10.01.20.42.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Oct 2015 20:42:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: BlackBerry Email (10.3.2.2639) Message-ID: <20151002034215.5804117.75106.9000@gmail.com> Date: Fri, 02 Oct 2015 06:42:15 +0300 Subject: Re: FreeBSD and two different networks From: doroseracledes@gmail.com In-Reply-To: <560DB7A3.1000707@fjl.co.uk> References: <6371943.nqOrXjNnlq@thinkpad> <560DB7A3.1000707@fjl.co.uk> To: Frank Leonhardt , freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2015 03:42:18 -0000 How about dhclient enter-hooks: =E2=80=8Ehttp://www.macfreek.nl/memory/DHCP_Client_Script_Examples "If you want to have more control, e.g. only set the default route for em0,= but not for other interface, add the following lines to /etc/dhclient-ente= r-hooks: # Do not set default route on any interface except em0 if [ "$interface" !=3D "em0" ] then =C2=A0 =C2=A0 unset new_routers fi " There's also "supersede" in dhclient.conf to overwrite what dhcp provides a= nd set to something you want (think overwrite) =E2=80=8E Theodoros Sent=C2=A0from=C2=A0a=C2=A0smartphone =C2=A0=C2=A0 > Dear All, > > I have a FreeBSD machine at work. It's mostly connected to the so-called > "internal" network that has a static ip: let it be 172.16.1.113/12. The > default gateway for that network is 172.16.1.1. > Sometimes, I need to connect this machine to another network that uses DH= CP. > Its network mask differs: it's 192.168.1.0/24. The second network uses DH= CP. > > The question is: can I set both of the default gateways (skip DHCP: I can > configure the interface for the "external" network manually) in some way?= Can > I set up some kind of a daemon that checks whether one of my gateways is > accessible and forwards all of the traffic through that gateway? Thank you > very much in advance.