IPv6 support by built in variables, like machine_ipaddr?

Answered

Comments

1 comment

  • Avatar
    wojciechka

    Unfortunately it is not possible to list IPv6 addresses from InstallBuilder at the moment.

    On Windows, can create a VBS script to list all IPv6 addresses:

    <initializationActionList> <writeFile> <encoding>iso8859-1</encoding> <path>${system_temp_directory}/listipv6.vbs</path> <text> Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery _ ("Select * from Win32_NetworkAdapterConfiguration") For Each row in colItems If row.IPEnabled Then For i = 0 to UBound(row.IPAddress) IP = row.IPAddress(i) If InStr(IP, ":") &lt;&gt; 0 Then Wscript.Echo IP End If Next End If Next </text> </writeFile> <runProgram> <program>cscript</program> <programArguments>/nologo "${system_temp_directory}/listipv6.vbs"</programArguments> </runProgram> <deleteFile> <path>${system_temp_directory}/listipv6.vbs</path> </deleteFile> </initializationActionList>

    To detect the one with default gateway for IPv6 set, you can change the VBS loop to:

    For Each row in colItems If row.IPEnabled Then Ok = 0 If NOT IsNull (row.DefaultIPGateway) Then For i = 0 to UBound(row.DefaultIPGateway) GW = row.DefaultIPGateway(i) If InStr(GW, ":") <> 0 Then Ok = 1 End If Next End If If Ok = 1 Then For i = 0 to UBound(row.IPAddress) IP = row.IPAddress(i) If InStr(IP, ":") <> 0 Then Wscript.Echo IP End If Next End If End If Next

    On Linux, it is a matter of reading ip addr show and looking for device name and inet6 addresses.

    On OS X, the ip6 command can be used to retrieve IPv6 addresses.

Please sign in to leave a comment.