Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

override default gateway for vmkernel adapter (vsphere 6.5)

$
0
0

hey,

 

I am using vsphere 6.5u3 enterprise plus.

I need to add additional vmkernel adapter to 100+ hosts for vsphere replication traffic. The additional vmkernel adapter will be in a dedicated L3 subnet.

I want to use powercli/api to achieve this. So far I was able to create vmkernel and enable vsphere replication traffic using PS, but i am struggling to override default gateway on vmk.

 

I've researched this and it seems that nobody provided the solution to this yet. All solutions were based on changing default gateway for default tcp/ip stack, or creating new tcp/ip stack.

 

I came across a potential method, but i don't know how to proceed further. Any help would be appreciated!

 

$esx=get-vmhost$hostname

$vmk=$esx.ExtensionData.Config.Network.Vnic |wheredevice-eq"vmk2"

$vmk.Spec.IpRouteSpec.IpRouteConfig.DefaultGateway  # this seems to be the setting to modify, but how?

 

$gw=New-Objectvmware.vim.HostVirtualNicIpRouteSpec

$gw.IpRouteConfig.DefaultGateway = "X.X.X.X" # error: The property 'DefaultGateway' cannot be found on this object. Verify that the property exists and can be set.

 

?

 

reference:

https://vdc-repo.vmware.com/vmwb-repository/dcr-public/6b586ed2-655c-49d9-9029-bc416323cb22/fa0b429a-a695-4c11-b7d2-2cbc…


Viewing all articles
Browse latest Browse all 180329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>