Bug 138407 - [gre] gre(4) interface does not come up after reboot
Summary: [gre] gre(4) interface does not come up after reboot
Status: Closed DUPLICATE of bug 164475
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 7.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-31 18:30 UTC by Nick Kritsky
Modified: 2015-09-17 12:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Kritsky 2009-08-31 18:30:06 UTC
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.

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.
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-08-31 18:36:28 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Most likely a problem in the driver.
Comment 2 Remko Lodder 2010-06-03 07:12:10 UTC
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
Comment 3 Terrence Koeman 2012-07-08 22:33:29 UTC
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.
Comment 4 cmb 2015-09-16 21:24:58 UTC
this is a duplicate of 164475, which was recently fixed. Should be safe to close.
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2015-09-17 12:44:39 UTC

*** This bug has been marked as a duplicate of bug 164475 ***