From root@tsunami.misproductions.com  Wed Oct  1 14:21:54 2003
Return-Path: <root@tsunami.misproductions.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 84E4C16A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 14:21:54 -0700 (PDT)
Received: from tsunami.misproductions.com (c-24-127-5-95.we.client2.attbi.com [24.127.5.95])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 69DC443FD7
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  1 Oct 2003 14:21:53 -0700 (PDT)
	(envelope-from root@tsunami.misproductions.com)
Received: from tsunami.misproductions.com (localhost.misproductions.com [127.0.0.1])
	by tsunami.misproductions.com (8.12.9/8.12.7) with ESMTP id h91LLqh2047499
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 1 Oct 2003 14:21:52 -0700 (PDT)
	(envelope-from root@tsunami.misproductions.com)
Received: (from root@localhost)
	by tsunami.misproductions.com (8.12.9/8.12.7/Submit) id h91LLqHr047498;
	Wed, 1 Oct 2003 14:21:52 -0700 (PDT)
Message-Id: <200310012121.h91LLqHr047498@tsunami.misproductions.com>
Date: Wed, 1 Oct 2003 14:21:52 -0700 (PDT)
From: Shon Elliott <shon@misproductions.com>
Reply-To: Shon Elliott <shon@misproductions.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: FreeBSD Not in compliance with RFC 1122, Cannot have multiple 0.0.0.0 gateways. This breaks programs like Zebra.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         57479
>Category:       kern
>Synopsis:       FreeBSD Not in compliance with RFC 1122, Cannot have multiple 0.0.0.0 gateways. This breaks programs like Zebra.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    julian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 01 14:30:11 PDT 2003
>Closed-Date:    Mon Aug 24 09:54:31 PDT 2009
>Last-Modified:  Mon Aug 24 09:54:31 PDT 2009
>Originator:     Shon Elliott
>Release:        FreeBSD 4.8-RELEASE-p4 i386
>Organization:
MiS Productions
>Environment:
System: FreeBSD tsunami.misproductions.com 4.8-RELEASE-p4 FreeBSD 4.8-RELEASE-p4 #23: Thu Sep 11 10:26:11 PDT 2003 root@tsunami.misproductions.com:/usr/obj/usr/src/sys/TSUNAMI i386


	
>Description:
	FreeBSD will not let you support multiple 0.0.0.0/0 gateways in the kernel routing table. This breaks programs
        like Zebra, when using BGP to automatically adjust default gateway in case a link goes down on a multi-connected
        system. This also effects things such as how FreeBSD responds to incoming IP packets. For example, you have two
        different network addresses for the machine 10.1.1.2/29 and 10.23.1.2/29. Whichever default gateway is set to, the
        other block will not answer. 
>How-To-Repeat:
	Get a multi-homed machine on a network, say one ethernet card to a ADSL  line, and one ethernet card to a cable
        line. Set the default gateway to the DSL Gateway. Try to come in on the cable IP from outside the network. You will
        not be able to, as it is trying to send the information back out the DSL gateway when it can't. trying to add more
        than one Default route to the kernel routing table makes "add net 0.0.0.0: gateway 10.23.1.1: File exists" type
        messages. according to RFC 1122 an OS >MUST< be able to support multiple 0.0.0.0/0 paths. FreeBSD fails on this. 
        See section 3.3.1.2 from RFC 1122. Excerpt from RFC states:

            When there is no route cache entry for the destination host
            address (and the destination is not on the connected 
            network), the IP layer MUST pick a gateway from its list of
            "default" gateways.  The IP layer >MUST< support multiple
            default gateways.

         and excerpt from 1.3.2 Requirements:

         In this document, the words that are used to define the
         significance of each particular requirement are capitalized.

              *    "MUST"
 
              This word or the adjective "REQUIRED" means that the item
              is an absolute requirement of the specification.



>Fix:

	There is no known workaround that I know of for FreeBSD.


>Release-Note:
>Audit-Trail:

From: Pawel Malachowski <pawmal-posting@freebsd.lublin.pl>
To: Shon Elliott <shon@misproductions.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/57479: FreeBSD Not in compliance with RFC 1122, Cannot have multiple 0.0.0.0 gateways. This breaks programs like Zebra.
Date: Fri, 3 Oct 2003 12:03:26 +0200

 On Wed, Oct 01, 2003 at 02:21:52PM -0700, Shon Elliott wrote:
 
 > >Description:
 > 	FreeBSD will not let you support multiple 0.0.0.0/0 gateways in the kernel routing table. This breaks programs
 
 Actually, it is not possible to assign two identical routes with different
 gateways:
 
 # route add 10/8 x.x.x.x
 add net 10: gateway x.x.x.x
 # route add 10/8 y.y.y.y
 route: writing to routing socket: File exists
 add net 10: gateway y.y.y.y: File exists
 
 
 One can only try with more specific route:
 
 # route add 10/9 y.y.y.y
 add net 10: gateway y.y.y.y
 
 So, that's why it is also not possible to set two 0/0 routes.
 
 >         like Zebra, when using BGP to automatically adjust default gateway in case a link goes down on a multi-connected
 
 I know there are people forced to use Linux on their multihomed gateways
 because of such behaviour.
 
 I think it should be not only possible to set two or more equal routes,
 but also to load-balance traffic, like this:
 
 	route add 10/8 x.x.x.x
 	route add 10/8 x.x.x.x
 	route add 10/8 y.y.y.y
 	// to send 33% of trafic to 10/8 via y.y.y.y and 67% via x.x.x.x
 	// and 100% of traffic to 10/8 via y.y.y.y if x.x.x.x fails.
 
 
 Step behind, having more than one routing table to easy deal with source
 based policy routing would be great. Some kind of this can be implemented
 using ipfw(8) `fwd', but this can't be integrated with routing daemons. ;)
 And using ipfw(8) classifiers to hook packages to different routing tables
 is like a dream. ;)
 
 
 -- 
 Pawe Maachowski
Responsible-Changed-From-To: freebsd-i386->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:31:47 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 

We're aware of the limitations in the current routing code and will look into 
this eventually, hopefully as part of a co-ordinated 'network junta' effort. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57479 
State-Changed-From-To: open->analyzed 
State-Changed-By: bms 
State-Changed-When: Wed 26 Nov 2003 20:39:10 PST 
State-Changed-Why:  
Will be addressed in future routing code changes. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57479 
Responsible-Changed-From-To: bms->julian 
Responsible-Changed-By: bms 
Responsible-Changed-When: Wed 2 Jan 2008 22:52:22 UTC 
Responsible-Changed-Why:  
by arrangement 

http://www.freebsd.org/cgi/query-pr.cgi?pr=57479 
State-Changed-From-To: analyzed->closed 
State-Changed-By: julian 
State-Changed-When: Mon Aug 24 09:51:42 PDT 2009 
State-Changed-Why:  
Multiple default gateway was added recently. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=57479 
>Unformatted:
