Hurricane Electric's IPv6 Tunnel Broker Forums

Advanced search  

News:

Welcome to Hurricane Electric's Tunnelbroker.net forums!

Author Topic: [FreeBSD] Setting default source address?  (Read 3677 times)

jemann

  • Newbie
  • *
  • Posts: 4
[FreeBSD] Setting default source address?
« on: January 30, 2013, 05:55:22 AM »

Hello forum.

I've successfully configured my hosted FreeBSD server to use a HE.net IPv6 tunnel.  My gif0 tunnel interface has the "Client IPv6 address" as it's primary and I've also added a few of the addresses from the routed /64 range as aliases on that interface, as follows:

Code: [Select]
gif0: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> metric 0 mtu 1280
        tunnel inet 31.193.132.199 --> 216.66.80.26
        inet6 2001:470:1f08:84f::2 --> 2001:470:1f08:84f::1 prefixlen 128
        inet6 fe80::be30:5bff:feda:b396%gif0 prefixlen 64 scopeid 0x7
        inet6 2001:470:1f09:84f:: prefixlen 64
        inet6 2001:470:1f09:84f::1 prefixlen 64
        inet6 2001:470:1f09:84f::2 prefixlen 64
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        options=1<ACCEPT_REV_ETHIP_VER>

The primary and alias addresses are all pingable from elsewhere.

However, IPv6 traffic originating from my host uses gif0's primary address (the tunnel endpoint IP) as its source address.  How can I make outgoing traffic originate from one of the alias address instead?

Was it a good idea to set up those additional addresses as aliases on the tunnel interface, or would it have been better to do it a different way?

Thanks for any advice.
« Last Edit: January 30, 2013, 05:58:07 AM by jemann »
Logged

snarked

  • Hero Member
  • *****
  • Posts: 765
Re: [FreeBSD] Setting default source address?
« Reply #1 on: January 30, 2013, 10:30:12 AM »

Unix-based OS:  "man ip".  You're looking for "ip addrlabel".
Logged

jemann

  • Newbie
  • *
  • Posts: 4
Re: [FreeBSD] Setting default source address?
« Reply #2 on: January 30, 2013, 11:58:46 AM »

FreeBSD doesn't have the 'ip' command.

The 'ifconfig' manpage makes no mention of a 'addrlabel' parameter either.

However, there is an inet6-specific interface flag named "prefer_source" that looks promising.  I'll give that a try.
« Last Edit: January 30, 2013, 12:02:37 PM by jemann »
Logged

jemann

  • Newbie
  • *
  • Posts: 4
Re: [FreeBSD] Setting default source address?
« Reply #3 on: January 30, 2013, 12:22:09 PM »

A reply to my similar post on the FreeBSD forums suggested an undocumented "deprecated" flag that can be set on an interface address.  This worked perfectly:

Code: [Select]
# ifconfig gif0 inet6 2001:470:1f08:84f::2 2001:470:1f08:84f::1 prefixlen 128 deprecated
# ifconfig gif0
gif0: flags=8151<UP,POINTOPOINT,RUNNING,PROMISC,MULTICAST> metric 0 mtu 1280
        tunnel inet 31.193.132.199 --> 216.66.80.26
        inet6 fe80::be30:5bff:feda:b396%gif0 prefixlen 64 scopeid 0x7
        inet6 2001:470:1f09:84f::1 prefixlen 64
        inet6 2001:470:1f09:84f::2 prefixlen 64
        inet6 2001:470:1f09:84f:: prefixlen 64
        inet6 2001:470:1f09:84f::3 prefixlen 64
        inet6 2001:470:1f09:84f::5e4c:dad4 prefixlen 64
        inet6 2001:470:1f09:84f::5e4c:dad5 prefixlen 64
        inet6 2001:470:1f09:84f::1fc1:84c7 prefixlen 64
        inet6 2001:470:1f08:84f::2 --> 2001:470:1f08:84f::1 prefixlen 128 deprecated
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        options=1<ACCEPT_REV_ETHIP_VER>
# ping6 home.b0rken.org
PING6(56=40+8+8 bytes) 2001:470:1f09:84f::1 --> 2001:470:1f08:84e::2
Logged