RE: Quickie... Hopefully!

From: Kevin Glick (keving_at_sbfnet.com)
Date: 10/02/04

  • Next message: David Gerard: "Re: Platforms"
    To: "'Richard Marriner'" <richard@syix.com>
    Date: Fri, 1 Oct 2004 15:53:38 -0700
    
    

    Richard,

    I've done the same thing a few times. To get the full description, check
    the ifconfig man page and look for "alias". There's two problems with doing
    this: first, BSD can't have two default routes. Windows allows you to set
    two default gateways, and it works because of the "Route Discovery" built
    into it (this is why a windows machine can use a gateway that's not on it's
    local subnet...but, that's another topic). Second, if you've got servers
    set to listen only on a specific IP (apache, etc) it still won't work, even
    with the alias.

    Example:
    1.1.1.1-1.1.1.255 -->from ISP #1 \
    /-> 1.1.1.2
                                                -->hub/switch --> FreeBSD fxp0
    2.2.2.1-2.2.2.255 -->from ISP #2 /
    \-> 2.2.2.2

    In the crude diagram above, both ISPs feeds end up coming into a hub/switch
    that your BSD machine is plugged into. The normal ifconfig on the device is
    1.1.1.2 netmask 255.255.255.0. You would then: "ifconfig fxp0 inet 2.2.2.2
    netmask 255.255.255.0 alias" the device. This will work, as long as routing
    is setup correctly. Any request for 2.2.2.2 from anywhere in the world
    would end up at the same machine/interface as a request for 1.1.1.2. The
    problem lies in getting data out with the aliased address. The default
    route on the machine would be 1.1.1.1 and all traffic goes there. If you
    have specific traffic that you want to go out with the 2.2.2.2 address,
    you'd have to add routes for each DESTINATION IP: "route add -net 3.3.3.3
    -netmask 255.255.255.0 2.2.2.1" and so on. BSD isn't smart enough to do
    source based routing. So the traffic will come into 2.2.2.2 via ISP #2, but
    the replies/ACKs will go out via ISP #1. Any traffic generated from the
    machine, without a specified SOURCE IP will go out as 1.1.1.2, and get sent
    via the 1.1.1.1 gateway.

    The other problem with the diagram above is that you've got two subnets
    running on the same lan, which breaks most rules of networking. This can be
    remedied with a few vlans, but again, that's another topic.

    Hope this helps. I'm sure most of this info is correct, but I'm more than
    willing to have somebody set me straight.

    Kevin Glick
    ITS Manager
    keving@sbfnet.com
    Sterling Business Forms

    -----Original Message-----
    From: owner-freebsd-questions@freebsd.org
    [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Richard Marriner
    Sent: Friday, October 01, 2004 3:25 PM
    To: freebsd-questions@freebsd.org
    Subject: Quickie... Hopefully!

    Dear list,

       Just wondering if there is anyway (preferably simple.) to have two ip
    addresses on the same NIC that are different networks.

    A little background. We are in the process of changing ISPs, we now have
    two circuits going to two differnet ISPs. Because of this change we have to
    renumber our entire network. Being an ISP ourselves we have a handful of
    servers that run FreeBSD. While trying to get one of our test servers to
    talk to both networks from the internet we fail, I think because even though
    your request is on the new numbers FreeBSD still trys routing the response
    back through our old gateway. Another question, I know in Windows XP you
    can set two gateways, two ips, etc. Can you do this in FBSD? Our windows
    boxes are talking fine on both networks.

    Any help or suggestions appreciated...

           Richard Dean Marriner II
    SYIX.COM --=-- Network Administrator
    530-755-1751x206 - richard at syix.com

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"

    _______________________________________________
    freebsd-questions@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-questions
    To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"


  • Next message: David Gerard: "Re: Platforms"

    Relevant Pages

    • RE: Quickie... Hopefully!
      ... the interface two Ips with ifconfig and set the default route to our newest ... > via the 1.1.1.1 gateway. ... > addresses on the same NIC that are different networks. ... We are in the process of changing ISPs, ...
      (freebsd-questions)
    • Re: VLAN interfaces and routing
      ... VLANS which is fantastic but my next objective is to have the box talk ... to other networks via a default route, ... back from other networks, even netstat -r seems to hang. ... The default gateway ...
      (freebsd-net)
    • Routing with two gateways
      ... currently I am trying to setup my routing table to route everything ... routed through a vpn. ... My problem is that the second gateway lies within ... one of the three networks. ...
      (comp.os.linux.networking)
    • Re: Ip aliasing/routing
      ... If the default route for both networks goes thru the same ... Robin wrote: ... > How would I set the default gateway, and set the gateway for 172.16.3.100 ...
      (alt.os.linux.redhat)
    • Re: Quickie... Hopefully!
      ... > addresses on the same NIC that are different networks. ... We are in the process of changing ISPs, ... > back through our old gateway. ... I know in Windows XP you ...
      (freebsd-questions)