VMware Cloud Community
Bubbly
Enthusiast
Enthusiast
Jump to solution

How to get subnets info assigned to physical NIC on ESXi Host?

Hi,

Is there a way we can get subnets info that are assigned to physical NIC on ESXi Host using POWRCLI.?

Networks.png

1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Not without querying the switch afaik.

ESXi only reports the subnets it sees passing on it's side.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

12 Replies
LucD
Leadership
Leadership
Jump to solution

Something like this?

Re: command to retrieve visible networks for each vmnic


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Bubbly
Enthusiast
Enthusiast
Jump to solution

Thanks LucD for the reply. not looking for  "Observed IP ranges" info. I would like to see "Networks" info just like in the screenshot.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Isn't that the same as Observed IP Ranges (see column header)?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Bubbly
Enthusiast
Enthusiast
Jump to solution

I took your script and ran it 1 ESXi server. Please find expected and actual output.

Expected Output -

10.136.0.133-10.136.0.133 ( VLAN300 ),10.138.128.1-10.138.143.254 ( VLAN750 ),10.138.0.1-10.138.3.254 ( VLAN700 ),

10.138.16.1-10.138.23.254 ( VLAN710 ),0.0.0.1-255.255.255.254 ( VLAN310 ),10.136.232.1-10.136.239.254 ( VLAN203 ),

10.136.120.1-10.136.127.254 ( VLAN204 ),10.136.128.1-10.136.128.254 ( VLAN450 ),10.137.8.1-10.137.9.254 ( VLAN760 ),0.0.0.1-255.255.255.254 ( VLAN457 )

Actual Output:

10.136.0.133-10.136.0.133 (VLAN 300),10.138.128.1-10.138.143.254 (VLAN750),10.138.0.1-10.138.3.254 (VLAN 700),

10.138.20.1-10.138.23.254 (VLAN 710), 10.136.22.164-10.136.22.165 (VLAN 310),10.136.232.1-10.136.239.254 (VLAN 203),

10.136.120.1-10.136.127.254 (VLAN 204),10.136.128.1-10.136.129.254 (VLAN 450),10.137.8.1-10.137.9.254 (VLAN 760),0.0.0.1-255.255.255.254 (VLAN 457)  

0 Kudos
LucD
Leadership
Leadership
Jump to solution

These are observed IP ranges.
These addresses change depending on what the hypervisor sees coming through.

Perhaps try a refresh of the page.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Bubbly
Enthusiast
Enthusiast
Jump to solution

I refreshed the page. but no changes in "Networks" info.

As you said Observed IP Ranges are addresses change depending on what the hypervisor sees coming through.

But "Networks" tab provides complete subnet visibility info in physical NIC side.

Is there a way could you please confirm from your network or share any VMware blogs regarding the same?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Have a look at How to find out what VLANs your ESX hosts can really see, especially Update 1


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Bubbly
Enthusiast
Enthusiast
Jump to solution

You are right LucD. Networks tab and observed IP address tab is same.

Unfortunately, it is not solve my issue.

I'm looking for subnets attached to the physical NIC. Is there a way we can se that info from ESXi side instead physical switch side?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Not without querying the switch afaik.

ESXi only reports the subnets it sees passing on it's side.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

AlbertWT
Virtuoso
Virtuoso
Jump to solution

If the Switch is Cisco with VDP enabled, is it possible?

/* Please feel free to provide any comments or input you may have. */
0 Kudos
LucD
Leadership
Leadership
Jump to solution

I'm afraid I have no practical experience with the Nexus, but afaik you would still need to query the VSI for more information (correct me if I'm wrong).
I don't think it would change anything on the ESXi side.

As I understand the VDP concept, the VDP will send initialisation info to the switches (DFA leaf) for a VM that is started.

Based on that info, the Cisco Leaf (switch) configures and attaches the required VLAN.

That info is regularly sent back to the Nexus, who will configure the packets from the VM accordingly.

My conclusion, not based on practical experience and I would love to get some feedback on this, again the switch will only "see" subnets that have active traffic going on.

Not the list of potential VLANs, and subnets, that could be traversing the switch.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

AlbertWT
Virtuoso
Virtuoso
Jump to solution

Yes, that does make sense.

Thanks for sharing the knowledge here LucD​ I appreciate it.

/* Please feel free to provide any comments or input you may have. */
0 Kudos