VMware Cloud Community
MF0
Contributor
Contributor
Jump to solution

Assigning Different ip's to NICs in ESXi 6.0.0

Hello all, I have the default vSwitch0 with 1 physical nic associated. The network is 10.0.0.0/23 with gateway 10.0.1.10 and I have Virtual Machines in this subnet that are running perfect.

Now I would like to connect one Virtual Machine to a different subnet. So I have added a second vSwitch1 with a second physical nic associated (that is online and connected). The network is 10.115.110.0/23 with gateway 10.115.110.10.

Its not working, I was thinking maybe I need to add a static route but this is for Service Console network only.

Is it not possible? the VM has no network connection, what could I do?

I also added two network cards on the vm and the default is working fine but what can I do to make the second work? or is it not possible if the ip range is in a different subnet?

Thanks!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
rcporto
Leadership
Leadership
Jump to solution

First, you don't need create an additional VMkernel interface on the new switch to your virtual machines be able to reach different networks and there is no need to create static routes. What you need to do is create the new virtual switch using the vmnic connected to the new subnet, create a new port group inside this new vSwitch and create the virtual machine with virtual network adapter binding to this new port group.

Note, this is not the best approach, my recommendation is to use VLAN to segment your subnets, anyway this design will work.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto

View solution in original post

0 Kudos
6 Replies
rcporto
Leadership
Leadership
Jump to solution

First, you don't need create an additional VMkernel interface on the new switch to your virtual machines be able to reach different networks and there is no need to create static routes. What you need to do is create the new virtual switch using the vmnic connected to the new subnet, create a new port group inside this new vSwitch and create the virtual machine with virtual network adapter binding to this new port group.

Note, this is not the best approach, my recommendation is to use VLAN to segment your subnets, anyway this design will work.

---

Richardson Porto
Senior Infrastructure Specialist
LinkedIn: http://linkedin.com/in/richardsonporto
0 Kudos
MF0
Contributor
Contributor
Jump to solution

Dear Richardson, first thank you for your answer. Please correct me if I am wrong but I think I did that

esxi.jpg

I have a virtual machine port group (of 120 ports) or do you mean something else? I have the feeling my problem is the two different gateways (not being in the same subnet). VM with VLAN ID 1 tries to route over 10.0.1.10 while it can find it because its tcp/ip settings are 10.115.110.15 mask 255.255.254.0 and gateway 10.115.110.10

I must say I don't have much experience with vSphere, if I am missing a port configuration, can you tell me where to add it? Thanks!

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Only a guess. The port group configuration shows VLAN 1 tagged at the port group level. Assuming this is the physical switch port's native/default VLAN, the VLAN must not be tagged at the port group level.

André

0 Kudos
MF0
Contributor
Contributor
Jump to solution

esxi.jpg

vSwitch0 has a VM Network portgroup with 2 VM's attached. vmnic0 is connected to 10.0.0.0/23 with gateway 10.0.1.10

vSwitch1 has a VM Network1 portgroup with 1 VM attached. vmnic1 is connected to 10.115.110.0/23 with gateway 10.115.110.10

server.jpg

I can for example add a second nic (vm network = 10.0.0.0/23) and this works fine but the original nic (vm network1 = 10.115.110.0/23) does not connect.

I think this is maybe because of this setting

gateway.jpg

Because how can vSwitch1 possibly know it has to route through 10.115.110.10? No way right? That's why you have to add a static route but this can only be done for VMKernel

So I hope there is somebody here who can tell me wrong since I'm not very familiar with vSphere and maybe there is something I am missing. Thanks!

0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Routing the Virtual machine traffic has nothing to do with VMkernel ports. It's configured within the VM itself. Once you configure the different IP settings for the two virtual NICs within the VM, the guest OS will route the traffic for these two networks properly. you can verify this by running the route print command in the guest OS.

Just one more thing. The vSwitches/port groups don't provide any routing capabilities. If you want/need to route traffic - i.e. connect subnets - you need to provide a router (either physical or virtual).

André

MF0
Contributor
Contributor
Jump to solution

Thank you! I have it working, during the creation of the second vswitch I selected vlan number 1, I should not have done that and leave it default. Thank you all for your help!

0 Kudos