While ipfw supplies me6, I need the list of IPv6 addresses for a specific interface to be used in an ipfw ruleset.
"Screen scraping" ifconfig is one option, but having a firewall at the whim of the human-readable output of even ifconfig is concerning.
Is there a better way with the "stock" tools available during boot phases?
"Screen scraping" ifconfig is one option, but having a firewall at the whim of the human-readable output of even ifconfig is concerning.
Is there a better way with the "stock" tools available during boot phases?
Code:
ifconfig <some_interface> | sed -E -n -e 's/^[[:space:]]*inet6 ([0-9a-f:]+)[^0-9a-f:].*$/\1/p'