Looking for an easy way to grab the IPv6 address instead of the IPv4 address. Is there any way within BitRock to do this or do I have to create my own?

asked 19 Dec '12, 16:03

tinius's gravatar image

tinius
6112
accept rate: 0%


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.

link

answered 20 Dec '12, 09:37

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3
×1

Asked: 19 Dec '12, 16:03

Seen: 873 times

Last updated: 20 Dec '12, 09:37