# Creating gif0 for IPv6 when you have DHCP



## dvl@ (Feb 7, 2014)

This is the standard method for creating an IPv6 tunnel from HE.net:


```
ifconfig gif0 create
ifconfig gif0 tunnel 98.114.44.254 209.51.161.14
ifconfig gif0 inet6 2001:470:1f06:9ea::2 2001:470:1f06:9ea::1 prefixlen 128
route -n add -inet6 default 2001:470:1f06:9ea::1
ifconfig gif0 up
```

These are the settings I use in my /etc/rc.conf:


```
gif_interfaces="gif0"
gifconfig_gif0="98.114.44.254 209.51.161.14"
ifconfig_gif0_ipv6="inet6 2001:470:1f06:9ea::2 2001:470:1f06:9ea::1  prefixlen 128"
ipv6_defaultrouter="2001:470:1f06:9ea::1"
```

The problem is: 98.114.44.254 isn't always my IP address.  I have DHCP.  Any suggestions as to how to do this properly?


----------



## kpa (Feb 7, 2014)

Does HE.net support dynamic IPv4 address at all? I don't think that gif(4) is designed for dynamic tunnel IP addresses so you must have something on top of it watching for an address change. I have sixxs.net tunnel and I could use their net/sixxs-aiccu tool for automatic configuration that is aware of a changing WAN IP address. I'm not using it though since my IP address stays static as long as I don't take my system offline for too long time.


----------



## dvl@ (Feb 7, 2014)

I have the address change part settled.  That seems to work.  https://dan.langille.org/2014/01/09/upd ... ss-change/

It is the reboot part which does not work.


----------



## SirDice (Feb 7, 2014)

If your address changes you need to reconfigure the tunnel at he.net. Your source IP address is set on their side too.


----------



## dvl@ (Feb 7, 2014)

*Re: Creating gif0 for IPv6 when you have DHCPs*

Yes. That part is handled by the script.  Perhaps the script needs to detect boot time.


----------

