# gre0 needs a manual 'ifconfig gre0 up' after booting



## Grumpy (May 29, 2010)

Hi guys,

I'm using a route based VPN to my office using IP in GRE in IPSec.  This works fine except for the gre0 interface needing a manual 'ifconfig gre0 up' before it starts working after booting.

Here are the relevant entries from /etc/rc.conf.


```
ifconfig_re0="up"
ifconfig_re1="up"
cloned_interfaces="lagg0 lo1 vlan100 vlan1000 gre0"
ifconfig_lo1="inet 10.255.100.1/32"
ifconfig_gre0="inet 172.16.1.22 172.16.1.21 netmask 255.255.255.252 tunnel 10.255.100.1 192.168.255.12"
ifconfig_lagg0="laggproto lacp laggport re0 laggport re1 10.255.255.250/30"
ifconfig_vlan100="inet 10.0.147.1/28 vlan 100 vlandev lagg0"
ifconfig_vlan1000="vlan 1000 vlandev lagg0 dhcp"
```

After booting I see the following in my logs.


```
May 29 14:21:37 dumpster kernel: Starting Network: lo0 re0 re1 lagg0 lo1 vlan100 vlan1000 gre0.
May 29 14:21:37 dumpster kernel: lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
May 29 14:21:37 dumpster kernel: options=3<RXCSUM,TXCSUM>
May 29 14:21:37 dumpster kernel: inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
May 29 14:21:37 dumpster kernel: inet6 ::1 prefixlen 128
May 29 14:21:37 dumpster kernel: inet 127.0.0.1 netmask 0xff000000
May 29 14:21:37 dumpster kernel: nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
May 29 14:21:37 dumpster kernel: re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
May 29 14:21:37 dumpster kernel: options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
May 29 14:21:37 dumpster kernel: ether 40:61:86:48:45:15
May 29 14:21:37 dumpster kernel: media: Ethernet autoselect (none)
May 29 14:21:37 dumpster kernel: status: no carrier
May 29 14:21:37 dumpster kernel: re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
May 29 14:21:37 dumpster kernel: options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
May 29 14:21:37 dumpster kernel: ether 40:61:86:48:45:15
May 29 14:21:37 dumpster kernel: media: Ethernet autoselect (none)
May 29 14:21:37 dumpster kernel: status: no carrier
May 29 14:21:37 dumpster kernel: lagg0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
May 29 14:21:37 dumpster kernel: options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
May 29 14:21:37 dumpster kernel: ether 40:61:86:48:45:15
May 29 14:21:37 dumpster kernel: inet 10.255.255.250 netmask 0xfffffffc broadcast 10.255.255.251
May 29 14:21:37 dumpster kernel: media: Ethernet autoselect
May 29 14:21:37 dumpster kernel: status: no carrier
May 29 14:21:37 dumpster kernel: laggproto lacp
May 29 14:21:37 dumpster kernel: laggport: re1 flags=0<>
May 29 14:21:37 dumpster kernel: laggport: re0 flags=0<>
May 29 14:21:37 dumpster kernel: lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
May 29 14:21:37 dumpster kernel: options=3<RXCSUM,TXCSUM>
May 29 14:21:37 dumpster kernel: inet 10.255.100.1 netmask 0xffffffff
May 29 14:21:37 dumpster kernel: vlan100: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
May 29 14:21:37 dumpster kernel: options=3<RXCSUM,TXCSUM>
May 29 14:21:37 dumpster kernel: ether 40:61:86:48:45:15
May 29 14:21:37 dumpster kernel: inet 10.0.147.1 netmask 0xfffffff0 broadcast 10.0.147.15
May 29 14:21:37 dumpster kernel: media: Ethernet autoselect
May 29 14:21:37 dumpster kernel: status: no carrier
May 29 14:21:37 dumpster kernel: vlan: 100 parent interface: lagg0
May 29 14:21:37 dumpster kernel: vlan1000: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
May 29 14:21:37 dumpster kernel: options=3<RXCSUM,TXCSUM>
May 29 14:21:37 dumpster kernel: ether 40:61:86:48:45:15
May 29 14:21:37 dumpster kernel: media: Ethernet autoselect
May 29 14:21:37 dumpster kernel: status: no carrier
May 29 14:21:37 dumpster kernel: vlan: 1000 parent interface: lagg0
May 29 14:21:37 dumpster kernel: gre0: flags=9011<UP,POINTOPOINT,LINK0,MULTICAST> metric 0 mtu 1476
May 29 14:21:37 dumpster kernel: tunnel inet 10.255.100.1 --> 192.168.255.12
May 29 14:21:37 dumpster kernel: inet 172.16.1.22 --> 172.16.1.21 netmask 0xfffffffc
May 29 14:21:37 dumpster kernel: add net 10.0.0.0: gateway 172.16.1.21
May 29 14:21:37 dumpster kernel: add net 172.16.0.0: gateway 172.16.1.21
May 29 14:21:37 dumpster kernel: add net 192.168.0.0: gateway 172.16.1.21
```

Then, after bringing the firewall and some daemons up, I see these log entries.


```
May 29 14:21:38 dumpster kernel: re0: link state changed to UP
May 29 14:21:38 dumpster kernel: lagg0: link state changed to UP
May 29 14:21:38 dumpster kernel: vlan100: link state changed to UP
May 29 14:21:38 dumpster kernel: vlan1000: link state changed to UP
May 29 14:21:38 dumpster kernel: re1: link state changed to UP
May 29 14:21:38 dumpster dhclient[1387]: DHCPREQUEST on vlan1000 to 255.255.255.255 port 67
```

As you can see there is no gre0 being brought up.
Is this expected behaviour or a bug?

Any help appreciated 

Regards,
Jeffrey Overman


----------



## Grumpy (May 29, 2010)

Some additional information...  After booting the gre0 interface is being display as up by 'ifconfig gre0'.


----------



## Alt (May 30, 2010)

Try this

```
ifconfig_gre0="inet 172.16.1.22 172.16.1.21 netmask 255.255.255.252 tunnel 10.255.100.1 192.168.255.12 up"
```


----------



## Grumpy (May 30, 2010)

Alt said:
			
		

> Try this
> 
> ```
> ifconfig_gre0="inet 172.16.1.22 172.16.1.21 netmask 255.255.255.252 tunnel 10.255.100.1 192.168.255.12 up"
> ```



Unfortunately this didn't fix it.


----------



## Carpetsmoker (May 30, 2010)

You can use rc.local, and add "ifconfig gre0 up" there.


----------

