Ip address properties

(imported topic written by Darknight)

Hi ,

I am trying to get below ip address property via relevance,please guide me how these can be generated:

  1. list of all ipv4 and ipv6 address in a single property usign relevance.(ipv4 and ipv6 separate proparties are available)

2.list of ipv4 and ipv6 address of system alongwith their version for eg :

whenever i try to run below relevance output is coming as :

q:

(address

of

ip interfaces

of

network

as

string)

whose

(
it

as

string

does not contain

“127.0.0.1”
)
&

“-”

&

(ip version

of

addresses

of

ip interfaces

of

network

as
string)

A:
10.18.154.166-ipv4

but as soon as i make it plural :

q: (addresses of ip interfaces of network as string) whose (it as string does not contain “127.0.0.1”)& “-” & (ip versions of addresses of ip interfaces of network asstring)

E:A singular expression is required.

Please advice where i am doing mystake.

(imported comment written by jgstew)

(it as string &"-"& (ip version of it as string)) of addresses whose(it as string does not equal “127.0.0.1”) of ip interfaces of network

There are many ways to do the same thing in relevance, but some methods only work for singulars and not plurals.

(imported comment written by Darknight)

thanks a lot jgstew for providing your valuable guidance.

It would be of great help if you can let me know how to list down all thats is ipv4 as well as ipv6 addresses of any computer system via releavnce.

i am aware there are two different relevance as mentioned below :

for ipv4 :

if

(

exists

true

whose

(
if

true

then

(

exists

ip interfaces

of

network)

else

false
) )

then

addresses

whose

(
it

as

string

!=

“0.0.0.0”
)

of

ip interfaces

whose

(
not

loopback

of

it
)

of

network

as

string

else

nothing

for ipv6:

if (exists property “ipv6 interfaces” and exists network) then addresses of ipv6 interfaces of adapters whose (up of it and not loopback of it) of network as string else “”

But i am not able to combine both these properties to have desire result.Please suggest

Thanks again for your valuable inputs.

(imported comment written by jgstew)

(address of it as string & “-ipv4”; ipv6 address of it as string & “-ipv6”) of adapters whose(up of it AND not loopback of it AND address of it as string != “127.0.0.1”) of network

(imported comment written by Darknight)

thanks a billion jgstew…for your help:)

I have one more query regarding the relevance…if i try to list all the possible ips assigned to particular computer then it throws below error:

q:(addresses of it as string & “-ipv4”; ipv6 addresses of it as string & “-ipv6”) of adapters whose(up of it AND not loopback of it AND address of it as string != “127.0.0.1”) ofnetwork

E:A singular expression is required.

Maube i am goofing up with relevance this time,could you please point out it. thanks again :slight_smile:

also if i try to run this relevance on redhat machine it gives me below error:

Q: (address of it as string & “-ipv4”; ipv6 address of it as string & “-ipv6”) of adapters whose(up of it AND not loopback of it AND address of it as string != “127.0.0.1”) of network
E: The operator “ipv6 address” is not defined.

(imported comment written by jgstew)

The relevance already does list out all IPs of all NICs.

Try this on redhat / others:

((address of it as string & “-ipv4”) | “”; (ipv6 address of it as string & “-ipv6”) | “”) of adapters whose(up of it AND not loopback of it AND address of it as string != “127.0.0.1”) of network

The reason it may not have appeared to work to list all IPs of all NICs for you, is it may only return a result if there is BOTH an ipv4 address and an IPv6 address.

(imported comment written by Darknight)

Thanks jgstew :slight_smile:

Since i have not defined the operator the above relevance was giving error - “
The operator “ipv6 address” is not defined.”

I have tried it on RedHat and other operating systems it throwed me the same error , i have modified the above relevance a bit and come up with below solution which is perfectly working in nonwindows as well as on windows machine

Q: ((address of it as string & “-ipv4”) | “”; ((if (exists property “ipv6 interfaces” and exists network) then address of ipv6 interfaces of it as string else “”) & “-ipv6”) | “”)of adapters whose(up of it AND not loopback of it AND address of it as string != “127.0.0.1”) of network
A: 172.16.1.139-ipv4
A: fe80:0:0:0:250:56ff:feab:1d7e-ipv6
A: 10.18.154.171-ipv4
A: fe80:0:0:0:250:56ff:feab:3872-ipv6

thanks a lot for providing a hint due to which now i am able to retrive the required property

(imported comment written by jgstew)

Glad it worked out. I often forget about checking for the existence of a property, but it is a great way to handle a situation like this.