From nobody@FreeBSD.org  Mon Aug 31 17:28:04 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 739871065679
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 17:28:04 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 629DC8FC1C
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 17:28:04 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n7VHS3F7046949
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Aug 2009 17:28:03 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n7VHS3WD046948;
	Mon, 31 Aug 2009 17:28:03 GMT
	(envelope-from nobody)
Message-Id: <200908311728.n7VHS3WD046948@www.freebsd.org>
Date: Mon, 31 Aug 2009 17:28:03 GMT
From: Nick Kritsky <nkritsky@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: gre(4) interface does not come up after reboot
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         138407
>Category:       kern
>Synopsis:       [gre] gre(4) interface does not come up after reboot
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 31 17:30:06 UTC 2009
>Closed-Date:    
>Last-Modified:  Sun Jul  8 21:40:06 UTC 2012
>Originator:     Nick Kritsky
>Release:        7.2-RELEASE
>Organization:
>Environment:
FreeBSD suzmisgw01.internal.corp 7.2-RELEASE FreeBSD 7.2-RELEASE #1: Thu Jul  2 23:20:47 CST 2009     root@ESSUZNMS01.TAIHOOTECH.COM:/usr/obj/usr/src/sys/VPN  i386
>Description:
GRE interface will not work after reboot.
Following line were added to rc.conf:

cloned_interfaces="gre3168"
ifconfig_gre3168="inet 192.168.249.170 192.168.249.169 netmask 255.255.255.254 tunnel 10.166.2.40 195.62.48.25 mtu 1400"

When running "ifconfig gre3168" I noticed that interface is missing "RUNNING" flag.
If I issue "ifconfig gre3168 up" the interface becomes operational, and "RUNNING" flag is added to "ifconfig gre3168" output.
>How-To-Repeat:
1. Create records about GRE interface in rc.conf.
2. Reboot the server
3. try ping rhe remote side of GRE tunnel. You should get "network is down" error.
>Fix:
Possible reason for this lies in /usr/src/sys/net/if_gre.c, line 633:


if (gre_compute_route(sc) == 0)
    ifp->if_drv_flags |= IFF_DRV_RUNNING;
else
    ifp->if_drv_flags &= ~IFF_DRV_RUNNING;

If the system did not install default route before the gre interface initialization, setting up tunnel properties will not trigger RUNNING flag on interface.

My knowledge of 7.x kernel is not enough to decide if this check is safe to comment out.
My quick fix was just adding "ifconfig gre3168 up" in rc.local. 

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Aug 31 17:36:28 UTC 2009 
Responsible-Changed-Why:  
Most likely a problem in the driver. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=138407 

From: Remko Lodder <remko@elvandar.org>
To: bug-followup@FreeBSD.org,
 nkritsky@mail.ru
Cc:  
Subject: Re: kern/138407: [gre] gre(4) interface does not come up after reboot
Date: Thu, 3 Jun 2010 08:12:10 +0200

 For what it's worth, I have been bitten by this as well.
 
 -- 
 /"\   Best regards,                        | remko@FreeBSD.org
 \ /   Remko Lodder                      | remko@EFnet
 X    http://www.evilcoder.org/    |
 / \   ASCII Ribbon Campaign    | Against HTML Mail and News
 

From: "Terrence Koeman" <terrence@mediamonks.net>
To: "bug-followup@FreeBSD.org" <bug-followup@FreeBSD.org>, 
	"nkritsky@mail.ru" <nkritsky@mail.ru>
Cc:  
Subject: Re: kern/138407: [gre] gre(4) interface does not come up after reboot
Date: Sun, 08 Jul 2012 23:33:29 +0200

 I can confirm that this problem still exists:
 
 FreeBSD sanshou.mediamonks.net 8.3-STABLE FreeBSD 8.3-STABLE #14: Sun Jul  =
 8 08:35:04 CEST 2012
 
 gre0: flags=3D9011<UP,POINTOPOINT,LINK0,MULTICAST> metric 0 mtu 1300
         tunnel inet 77.95.x.x --> 78.86.x.x
         inet x.64.1.2 --> x.64.1.1 netmask 0xfffffffc
 
 No 'RUNNING' after reboot and as said by the reporter, issuing an 'up' or r=
 unning tcpdump on the interface brings it up.
 
 -- 
 Regards,
 T. Koeman, MTh/BSc/BPsy; Chief Technical Monk
 
 MediaMonks B.V. (www.mediamonks.com)
 Please quote relevant replies in correspondence.
 
 
 
 
 
>Unformatted:
