From owner-freebsd-net@freebsd.org Wed Apr 20 14:18:13 2016 Return-Path: Delivered-To: freebsd-net@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 74F86B16516 for ; Wed, 20 Apr 2016 14:18:13 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22a.google.com (mail-ob0-x22a.google.com [IPv6:2607:f8b0:4003:c01::22a]) (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 3B49C1703; Wed, 20 Apr 2016 14:18:13 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x22a.google.com with SMTP id n10so28765519obb.2; Wed, 20 Apr 2016 07:18:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=JJRABNkGY7FvlJo8W7KIJlIA+0xAMu77bZn34qS2A7A=; b=SHhiUGDsOU8AjVztmxIvcFroTBC3+0EKuDouCaekVhdwDAVRkzodQ2QBSkRiXDJ8ct WNIAGoJMzfCTgdvp7bNKaZygSar5jfQpOmtGuV+Hpow6tpCf7cwzU/jS9QxlaDektuYD z00O9aC4XMrVKpgUSfjnUMFQ4ZFDzRningUa2Ndsf92G0lFmDMtqbxPMdh7oIFEOyzJG sNv1qzy1lTjbbxTXAI/bPbiprZe/AhgkQAjqtmmrZrBv4JVs5H2EtVUIChOmlUhUKZ1Z PSleDf2X7zqSb649N0Ja0jIB7O8wZUJPaiSlwdw0RRWE/oGY+oshvM75TSswtwUZxonm hxhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=JJRABNkGY7FvlJo8W7KIJlIA+0xAMu77bZn34qS2A7A=; b=CTp1z3u77MnILJ5qInV0S/HG9k1fOzMiYXgz1yfNaWJKai+dMCwTYam8i3u/EUCcN7 eKr054bmxiU8xlaw4pOzF8wQ0bVcV9DatnG3OgyrGBTtrtzyFGQodAPKMKoTT898YcYf u/HtMa/v7UUYGa3uzYs45F7Du+LRm2AyGkLAH1qTTVNfZ72tR0kJhE7K7cCwPKDH9TKP Z+Mr29pF8cpblDILaytDvGKFjiLsMEVn4U2a5RweRc9VbrMH0kZwbqAW/aUNzn/zMHiG ZcZOO505zQ3eX75WizB67YXKita/VEK0SwhFe2/VoAAFXZK9zuRXALxSF2iiieeAhQ/G Qxzw== X-Gm-Message-State: AOPr4FWcxY8gbagtO2azdD8ETftKYouYRfGGUmelQyZLKVzm7OA8QzE7YWXEixjhS/rw84UEpqKvTVnmZK6GyA== MIME-Version: 1.0 X-Received: by 10.182.28.168 with SMTP id c8mr4113739obh.49.1461161892290; Wed, 20 Apr 2016 07:18:12 -0700 (PDT) Received: by 10.202.64.138 with HTTP; Wed, 20 Apr 2016 07:18:12 -0700 (PDT) In-Reply-To: <571757A8.8030007@freebsd.org> References: <118390227.3958522.1461146303528.JavaMail.yahoo.ref@mail.yahoo.com> <118390227.3958522.1461146303528.JavaMail.yahoo@mail.yahoo.com> <571757A8.8030007@freebsd.org> Date: Wed, 20 Apr 2016 08:18:12 -0600 Message-ID: Subject: Re: Assigning same ip address to different interfaces with different FIBs From: alan somers To: Julian Elischer Cc: FreeBSD Net Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 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, 20 Apr 2016 14:18:13 -0000 What you described doesn't work in FreeBSD, and there's even an open bug for it. But as Julian described, you should see if VIMAGE will work for you. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=189088 -Alan On Wed, Apr 20, 2016 at 4:19 AM, Julian Elischer wrote: > On 20/04/2016 5:58 PM, M. V. via freebsd-net wrote: > >> Hello guys, >> I have a problem with having multiple FIBs in FreeBSD-9.2. I've already >> setup 4 FIBs in kernel, and everything is OK. I assigned each interface to >> one FIB and I can add routes to any of FIBs I want, and everything works >> fine.But my problem is, I want to assign same IP address to multiple >> interfaces. for example: >> interface em1 (in FIB-1) : 100.100.100.1/24interface em2 (in FIB-2) : >> 100.100.100.1/24 >> this should work, bacause I want each FIB's interfaces and routes to be >> completely separate from other FIBs' interfaces and routes. for this I do:# >> sysctl net.add_addr_allfibs = 0 >> > I think you are using the wrong tool to do this job. > Fibs will "kind-of" allow you to do some of this but all fibs still 'see' > all interfaces, Even if you don't set routes to them. > What you want is VIMAGE/VNET > Even though we've made vnet a characteristic of a jail (it wasn't always), > you can still use it in the way you want if done right. > Write a "how-to" when you've got it worked out :-) > > > # ifconfig em1 fib 1# ifconfig em2 fib 2# setfib 1 ifconfig em1 >> 100.100.100.1/24# setfib 2 ifconfig em2 100.100.100.1/24 >> but this doesn't work as expected, and 100.100.100.0/24 route is only >> being added to FIB-1 (second IP assignment command doesn't work, though it >> returns no error).# setfib 1 netstat -rn ==> this fib has >> 100.100.100.0/24 entry added in it# setfib 2 netstat -rn ==> nothing is >> added here. >> > > there are some sysctls that control some of this. have you investigated > them? > > Though, as I say, you really want to structure your problem around using > vimage. Each vimage instance can have identical interfaces etc, becasue > they are effectively separate machines. You can route between them > internally to the machine and at one stage you could have a process with > sockets on each net but I"m not sure if you can still do that easily. > > > > >> Is there any way I can do this in FreeBSD? >> Thank you. >> _____________________________________________ >> >