Re: Multiple Interfaces

From: Wes Peters (wes_at_softweyr.com)
Date: 08/01/03

  • Next message: Michael W. Oliver: "Multipath Routing"
    To: Oleg Polyakov <opolyakov@yahoo.com>, bob@starblanket.ca, freebsd-net@freebsd.org
    Date: Thu, 31 Jul 2003 16:06:37 -0700
    
    

    On Thursday 31 July 2003 11:21, Oleg Polyakov wrote:
    > --- Bob <bob@starblanket.ca> wrote:
    > > Greets
    > >
    > > > I have two interfaces and the following info in rc.conf. The
    > > > first one is
    > > > setup properly but the second one never gets configured.
    > >
    > > I just went through this process myself.
    > >
    > > The word I have is that FreeBSD cannot run two NICs on
    > > the same subnet, which is what your included config shows.
    > > So try as you may it will not work. I also tested 4.7, 5.0
    > > and 5.1 with similar results.
    >
    > The trick is to configure second interface with netmask
    > 255.255.255.255. That interface can't be default gateway. But if
    > anything listen to that address than it responds on that address.

    Right. The problem is, you have two interfaces on the same network.
    This isn't an error per se, but only one of them is going to be used
    because there can only be one route to the associated network.

    By giving the second interface an all-ones netmask, you've effectively
    placed it into a different network. This prevents the ifconfig command
    from trying to duplicate the route to the local network. You can add
    other routes through this interface now, for instance as a dedicated
    interface for another IP network.

    What you haven't told us is what you're attempting to accomplish with
    this second interface.

    By the way, this topic of conversation is actually more appropriate for
    freebsd-questions, this list is supposedly for discussing
    implementation details on the various FreeBSD network stacks.

    > You may see log messages like this:
    > arp: 10.13.1.2 is on fxp0 but got reply from 00:00:0c:61:2e:c0 on
    > fxp1
    >
    > To disable it run:
    > sysctl net.link.ether.inet.log_arp_wrong_iface=0

    Yeah, that'll turn off the messages but not the errors. ;^)

    > > Here is a snippet of an email I received on this topic:
    > >
    > > Begin
    > >
    > > Well, as long as I can tell, one can't have 2 ifaces on the same
    > > subnet on FreeBSD. This seems to be regarded as a feature by the
    > > guys who have written the code.

    Yup, it is. In the absence of being able to do something sensible, a
    warning message seems like a good alternative.

    > > "It's arguable that it should be
    > > done any other way, since it will put questions like what
    > > interface will be used for outgoing segments to the subnet ? etc.

    Uh, no, that's exactly the questions that come up when you DO try to
    configure two interfaces on the same network. Look at it this way: if
    I have two interfaces on a 192.168.1 network and I open a socket, bind
    the local address to INADDR_ANY and the remote address to something
    else on the 192.168.1 network, which interface do I pick for outgoing
    packets?

    The dark secret in OpenBSD and NetBSD here is that they always pick the
    same one. You think you're "load balancing" by putting two interfaces
    in there, but the general truth is that you're just pouring electrons
    into unused hardware unless you've carefully configured the system to
    make use of both interfaces.

    > > which will require to manually assign the arp table as log as you
    > > have the rest of the nodes of the subnet connected throu some kind
    > > of switches or to still have all outgoing connections throu a
    > > preferred interface which will require a SRC (IP+MAC) addresses of
    > > the other interface and will unnecessary complicated the hole
    > > thing". So the result will be a gain in the speed of incoming
    > > segments but more load on the system.

    This has nothing to the with the ARP table and everything to do with the
    routing table.

    > > >What am I missing?
    > >
    > > All you are missing is the fact FreeBSD cannot handle
    > > two NICs the same subnet. OpenBSD does, NetBSD does and Linux does.
    >
    > That sounds misleading. FreeBSD handles two or more NICS on one
    > subnet. You just can't configure them with same netmask or have them
    > behave identically.
    > Only one can be default gateway.

    In point of fact, it's just completely wrong. I guess it depends on
    what you mean by "cannot handle", it certainly doesn't crash the kernel
    or halt networking or anything like that. In fact, the first interface
    you brought up continues to work just fine. FreeBSD does the same
    thing OpenBSD and NetBSD do, it just tells you that you've done
    something stupid while the other two merrily let you configure hardware
    that isn't going to be used.

    -- 
             "Where am I, and what am I doing in this handbasket?"
    Wes Peters                                              wes@softweyr.com
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Michael W. Oliver: "Multipath Routing"

    Relevant Pages

    • Re: Two Networks on one System
      ... network to their new network and both nets are presented ... interface for the primary to be reachable so that the minute the ... route add default x.x.x.x ... from outside the new subnet. ...
      (freebsd-questions)
    • Re: IPPNP
      ... If the client pc is configured with DHCP they ... The short answer is that this appears to be some kind of MAC based gateway protocol; basically, an 'internet access device' will forward any traffic it sees for a subnet which it isn't configured with, by spoofing ARP traffic so as to make it appear as though it is on that subnet. ... This sounds like a configuration nightmare to implement correctly, and goodness help you if you have more than one of these things connected to the same network. ... Whilst it probably can be done in the network stack, I speculate it couldn't be turned on at the same time as a number of other features such as Proxy ARP, or CARP, and may have problems scaling to more than a two-armed router (that is, 1 WAN uplink, and 1 Ethernet interface running this stuff). ...
      (freebsd-net)
    • Re: Lennart Poettering: BSD Isnt Relevant Anymore
      ... preferred network, etcetera. ... documentation and properly configure the wireless app correctly then ... FreeBSD implementation is trailing the pack. ... ones, could interface with, just as gmencoder interfaces ...
      (freebsd-questions)
    • [PATCH 1/1] IPN: Inter Process Networking
      ... +IPN is an Inter Process Communication service. ... +interface and protocols used for networking. ... +to a "network". ... +creates a communication socket. ...
      (Linux-Kernel)
    • Re: [PATCH 1/1] IPN: Inter Process Networking
      ... +IPN is an Inter Process Communication service. ... +interface and protocols used for networking. ... +to a "network". ... +creates a communication socket. ...
      (Linux-Kernel)