# GIF interface settings retention



## pboehmer (Feb 13, 2018)

I've run into an interesting issue when creating and destroying a GIF interface and was hoping to get some clarification.  

Background:  I'm in the process of setting up a IPSEC tunnel between work and home.  This is your typical FreeBSD to FreeBSD IPSec (both 11.1-STABLE) tunnel as described in the handbook (I've done several other connections on other boxes, so not new stuff to me).  I have a weird issue with the tunnel crashing my home's FTTH ONT (loss of POTS, red alarm LED).  Only way to recover is to bounce the ONT or wait a couple of hours for the thing to reset on it's own.  A soon as I create the interface and set up the tunnel (before IPSEC is set), the ONT drops dead.  Working with my ISP to figure out what's going on.

Here's the rub.  If I destroy the interface and recreate it, all of the settings are still set:

```
# ifconfig gif0 destroy
# ifconfig gif0
ifconfig: interface gif0 does not exist
# ifconfig create gif0
# ifconfig gif0
gif0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1280
        options=80000<LINKSTATE>
        tunnel inet work --> home
        inet work-priv --> home-priv  netmask 0xffffff00
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        groups: gif
```

Can anyone tell me where the settings are being stored, and how to clear them out of memory?  I was thinking `sysctl`, but `sysctl -a` doesn't have anything with the related IP addresses.  At this point, I have to reboot my home box to clear the settings, or risk hosing up the ONT when recreating the GIF interface.


----------



## pboehmer (Feb 14, 2018)

I should add, all is good if I manually deconstruct the gif tunnel, destroy, and then re-create the GIF interface.  It just seems to me that if the interface is "destroyed", that the settings should be cleared as well.


----------



## SirDice (Feb 14, 2018)

As far as I know this information isn't stored anywhere, not on disk at least. It may still be stored in some (kernel) memory structures though. But I'm not sure if these structures are intentionally kept intact or if they really should have been destroyed along with the interface.

I have started reading The design and implementation of the FreeBSD operating system (2nd edition) but I haven't gotten past the first chapter yet. When I get home tonight I'll browse through it. Maybe it has some information about this issue.


----------

