From nobody@FreeBSD.org  Mon Mar 10 00:01:59 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 08EB64DC
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Mar 2014 00:01:59 +0000 (UTC)
Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id EA77B77F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Mar 2014 00:01:58 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s2A01v1X009780
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 10 Mar 2014 00:01:57 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s2A01vdH009779;
	Mon, 10 Mar 2014 00:01:57 GMT
	(envelope-from nobody)
Message-Id: <201403100001.s2A01vdH009779@cgiserv.freebsd.org>
Date: Mon, 10 Mar 2014 00:01:57 GMT
From: Stavros Patiniotis <stavros@staff.esc.net.au>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Add default route after static routes
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         187404
>Category:       conf
>Synopsis:       [rc.d] [patch] Add default route after static routes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-rc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 10 00:10:00 UTC 2014
>Closed-Date:    Mon Mar 10 03:43:08 UTC 2014
>Last-Modified:  Mon Mar 10 03:43:08 UTC 2014
>Originator:     Stavros Patiniotis
>Release:        9.1-RELEASE amd64
>Organization:
EscapeNet
>Environment:
FreeBSD template-fbsd9.1-64bit.esc.net.au 9.1-RELEASE-p3 FreeBSD 9.1-RELEASE-p3 #0: Tue May 28 03:28:39 CST 2013     root@template-fbsd9.1-64bit.esc.net.au:/usr/obj/usr/src/sys/XENHVM  amd64
>Description:
The issue we are experiencing is that the default route is added before
static routes. We have a situation whereby the default route relies on
a static route eg

defaultrouter="$private_ip"
ifconfig_xn0="inet $public_ip netmask 255.255.255.255 -tso"
static_routes="xn0"
route_xn0="-host $private_ip -iface xn0"

>How-To-Repeat:

>Fix:
See attached patch file.

Also suggestion to add 'man rc.conf'

Add in the "static_routes" section, Static routes are added before any default route (see defaultrouter).


Patch attached with submission follows:

--- /etc/rc.d/routing.old       2014-03-10 09:54:53.000000000 +1030
+++ /etc/rc.d/routing   2014-03-10 09:18:58.000000000 +1030
@@ -122,7 +122,8 @@
        [Nn][Oo] | '')
                ;;
        *)
-               static_routes="default ${static_routes}"
+               static_routes="${static_routes} default"
                route_default="default ${defaultrouter}"
                ;;
        esac

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Mar 10 03:32:03 UTC 2014 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=187404 
State-Changed-From-To: open->closed 
State-Changed-By: hrs 
State-Changed-When: Mon Mar 10 03:42:19 UTC 2014 
State-Changed-Why:  
This bug has been fixed on 9.2R and later.  Please upgrade your system. 

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