| Interface can have multiple ipv6 addresses and each addresses can have a different scope. currently facter reports a scope6 fact at the interface level however it should more correctly report it at the binding level. As an example given the following interface:
2: en0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 |
link/ether aa:aa:bb:bb:cc:cc brd ff:ff:ff:ff:ff:ff |
inet6 2001:db8::aaaa:bbff:febb:cccc/64 scope global mngtmpaddr dynamic |
valid_lft forever preferred_lft forever |
inet6 2001:db8::1/64 scope global |
valid_lft forever preferred_lft forever |
inet6 fe80::aaaa:bbff:febb:cccc/64 scope link |
valid_lft forever preferred_lft forever
|
facter will report the following fact
'en0' => { |
'bindings6' => [ |
{ |
address => "2001:db8::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
}, |
{ |
address => "2001:db8::1", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
}, |
{ |
address => "fe80::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "fe80::" |
} |
] |
'scope6' => "global"
|
However i think it would its more correct to have
'en0' => { |
'bindings6' => [ |
{ |
address => "2001:db8::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
'scope' => "global" |
}, |
{ |
address => "2001:db8::1", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
'scope' => "global" |
}, |
{ |
address => "fe80::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "fe80::" |
'scope' => "link" |
} |
]
|
it would also be nice to capture the interface flags if they are present e.g.
'en0' => { |
'bindings6' => [ |
{ |
address => "2001:db8::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
'scope' => "global" |
'flags' => ['mngtmpaddr', 'dynamic'] |
}, |
{ |
address => "2001:db8::1", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "2620:0:861:103::" |
'scope' => "global" |
}, |
{ |
address => "fe80::aaaa:bbff:febb:cccc", |
netmask => "ffff:ffff:ffff:ffff::", |
network => "fe80::" |
'scope' => "link" |
} |
]
|
|