How do I discover the valid lifetime and preferred lifetime of IPv6 addresses on OS X?

2

On Linux, I can do ip -6 addr list and every address comes with a valid_lft and preferred_lft. What is the OS X equivalent? ifconfig doesn't include this information in its output.

Glyph

Posted 2015-09-16T01:42:05.333

Reputation: 538

Good question. Can you edit your question to add some example output of what you are looking for as it looks in the Linux command? – JakeGould – 2015-09-16T01:45:27.893

Answers

4

From the manual page of ifconfig:

If -L flag is supplied, address lifetime is displayed for IPv6 addresses, as time offset string.

The output looks like this:

en9: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=4<VLAN_MTU>
    ether 00:0e:ca:00:3d:0e 
    inet6 fe80::20e:caff:fe00:3d0e%en9 prefixlen 64 scopeid 0xe 
    inet 192.168.178.21 netmask 0xffffff00 broadcast 192.168.178.255
    inet6 2001:db8:d:ff01:20e:caff:fe00:3d0e prefixlen 64 autoconf pltime 3385 vltime 6985 
    inet6 2001:db8:d:ff01:2559:b136:a7f2:67c0 prefixlen 64 autoconf temporary pltime 3385 vltime 6985 
    nd6 options=1<PERFORMNUD>
    media: autoselect (100baseTX <full-duplex,flow-control>)
    status: active

Notice the pltime and vltime at the end of the inet6 lines.

MariusMatutiae

Posted 2015-09-16T01:42:05.333

Reputation: 41 321

@SanderSteffann Good job, IOU1. – MariusMatutiae – 2015-09-16T10:32:14.353

Thanks. I think I even knew about this option at some point; I guess I must have searched the manpage for "valid" and "preferred" but not "lifetime"! – Glyph – 2015-09-16T23:02:42.330