VMware {code} Community
jrackliffe
Hot Shot
Hot Shot
Jump to solution

Get the Subnet and Gateway of the Physical Hosts NICs

Reviewing the vModel for 2.01 and 2.5 the same DataObjects seem to be in play the HostIpConfig and the HostIpRouteConfig for the HostNetworkInfo.

In the ESX hosts http://3.0 I have reviewed the DataObjects exist, but the fields are either null/Unset or empty strings. The network adapters are all Static configured and everything works, but just no data is exposed.

Is this a security issue where my role may just be to tight? I didn't think so because I could see the objects in the MOB, but maybe that is how sec is implemented in the current iteration.

Or is there some config on the ESX host that I need to set to refresh this data on a regular basis?

Any pointers?

J

Reply
0 Kudos
1 Solution

Accepted Solutions
ISYS2
Enthusiast
Enthusiast
Jump to solution

Hi J

Sorry if I cover topics that you already know but.....

The physical nics on an esx host don't normally have IP set on them. They are basically trunks through to the Virtual switches that are created.

As a minimum the following are normally created

vSwitch0

This normally contains the Service Console Port and the VMkernel Port.

The IP settings for the Service Console Port are stored in two places.

Default Gateway = HostIpRouteConfig.config.network.consoleIpRouteConfig.defaultGateway

IPAddress = HostIPConfig.config.network.consoleVnic[http://"key-vim.host.VirtualNic-vswif0"|http://"key-vim.host.VirtualNic-vswif0"].spec.ip.ipAddress

SubMask = HostIPConfig.config.network.consoleVnic[http://"key-vim.host.VirtualNic-vswif0"|http://"key-vim.host.VirtualNic-vswif0"].spec.ip.subnetMask

I hope this is of some help

Regards

ISYS

View solution in original post

Reply
0 Kudos
2 Replies
ISYS2
Enthusiast
Enthusiast
Jump to solution

Hi J

Sorry if I cover topics that you already know but.....

The physical nics on an esx host don't normally have IP set on them. They are basically trunks through to the Virtual switches that are created.

As a minimum the following are normally created

vSwitch0

This normally contains the Service Console Port and the VMkernel Port.

The IP settings for the Service Console Port are stored in two places.

Default Gateway = HostIpRouteConfig.config.network.consoleIpRouteConfig.defaultGateway

IPAddress = HostIPConfig.config.network.consoleVnic[http://"key-vim.host.VirtualNic-vswif0"|http://"key-vim.host.VirtualNic-vswif0"].spec.ip.ipAddress

SubMask = HostIPConfig.config.network.consoleVnic[http://"key-vim.host.VirtualNic-vswif0"|http://"key-vim.host.VirtualNic-vswif0"].spec.ip.subnetMask

I hope this is of some help

Regards

ISYS

Reply
0 Kudos
jrackliffe
Hot Shot
Hot Shot
Jump to solution

Bing bing bing! Give that man a cupie doll.

I didn't even think about looking at the Console route and IP. Awesome point.

Seems a bit odd not to just fill in the ip data for the pnics in the vmodel, but whatever I have what I need!

Thanks again for the pointer.

J

Reply
0 Kudos