Hurricane Electric's IPv6 Tunnel Broker Forums

General IPv6 Topics => IPv6 Basics & Questions & General Chatter => Topic started by: guylhem on July 20, 2011, 11:00:11 AM

Title: Question about deprecating an address on OSX or BSD
Post by: guylhem on July 20, 2011, 11:00:11 AM
Hello

I would like to know what is the equivalent on OSX or BSD of the following linux command :

ip -6 addr change 2001::something/64 dev tap0 preferred_lft 0

The idea is to make the address still valid for receiving packets, but not valid for sending them.

I tried to do some googling but I found nothing for OSX or BSD

Thanks
Guylhem
Title: Re: Question about deprecating an address on OSX or BSD
Post by: juhoostman on July 22, 2011, 08:14:58 AM
Try this: ifconfig DEV inet6 ADDR deprecated

This is not tested at all, since I have no access to an OS X, instead it is quickly derived from the source. You may also have a different version of ifconfig.
Title: Re: Question about deprecating an address on OSX or BSD
Post by: guylhem on July 22, 2011, 08:52:52 AM
Hello

Thanks - but with this syntax I get:

ifconfig: unable to get address cache: Operation not supported on socket

If I remove "addr" it works, but the address is not deprecated.

Guylhem
Title: Re: Question about deprecating an address on OSX or BSD
Post by: jrocha on July 22, 2011, 12:03:17 PM
Replace DEV with your device name and ADDR with the address you wish to depreciate, like so:

sudo ifconfig en0 inet6 2001:470::a9:1889:a6e7:ee07:1687 deprecated
Title: Re: Question about deprecating an address on OSX or BSD
Post by: juhoostman on July 26, 2011, 05:32:28 AM
If this doesn't work, there may be other means to do what you want. You can create a pseudo-interface and assign the addresses you don't want to be used by default to it instead of the real outgoing interface. You should assign only single addresses to the pseudo-interface, not subnets. If the addresses have subnets, add explicit routes to them through their real interfaces.
Title: Re: Question about deprecating an address on OSX or BSD
Post by: juhoostman on July 26, 2011, 06:17:53 AM
You can also use ip6addrctl if it is available. First run ip6addrctl to see the current policy table, then add a new rule:
ip6addrctl add <prefix to be "deprecated"> 1 <label that is not yet used, maybe greater than 10>