# Setting default IPv6 source address



## jem (Jan 30, 2013)

I've recently set up my hosted FreeBSD server to use an IPv6 tunnel from HE.net.  As well as the single IPv6 address on my end of the tunnel, a routeable /64 network has been allocated for my use.

However as this is just a single host the routeable addresses can only be utilised by configuring them as aliases, which I have done for four of them, as follows:


```
gif0: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> metric 0 mtu 1280
        tunnel inet 31.xxx.yyy.zzz --> 216.66.80.26
        [color="Red"]inet6 2001:470:1f08:84f::2[/color] --> 2001:470:1f08:84f::1 prefixlen 128 
        inet6 fe80::be30:5bff:feda:b396%gif0 prefixlen 64 scopeid 0x7 
        [color="Blue"]inet6 2001:470:1f09:84f:: prefixlen 64 
        inet6 2001:470:1f09:84f::1 prefixlen 64 
        inet6 2001:470:1f09:84f::2 prefixlen 64 
        inet6 2001:470:1f09:84f::3 prefixlen 64[/color]
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        options=1<ACCEPT_REV_ETHIP_VER>
```

(red = tunnel endpoint address, blue = routeable /64 addresses)

With this configuration all of the IPv6 addresses are pingable from elsewhere.  However, any traffic originating from this host uses the tunnel endpoint address as its source.

Is there any way to make one of the routeable IP's be used as the source address for outgoing traffic instead?

Thanks.


----------



## kpa (Jan 30, 2013)

I think ifconfig(8) has an undocumented "deprecated" option that can be used in your case:

`# ifconfig gif0 2001:470:1f08:84f::2 deprecated`


----------



## jem (Jan 30, 2013)

That worked, thanks for the suggestion.

The source address of outgoing traffic is now of the first alias on the interface.


----------

