Jjv
Enthusiast
Enthusiast

Assigning Different IPs to NICs in ESXi 5.1.0

Jump to solution


Hi Guys

I have installed VMware ESXi 5.1.0 in one of the HP Proliant DL320 servers. This server has dual NICs.

I have configured the IP for NIC1 and and it is through that IP that I am accessing the VMware ESX server (using vSphere Client). I tried to assign a different IP Address(different Subnet) to the NIC2 port from ESX Admin Console, however it doesn't provide me an option to assign an IP to that port.

Now when I create the VMs on this server, I would like to have 2 NICs per VM. One NIC using the same IP as the NIC1 subnet IPs and the second NIC in the VM getting another IP as the NIC2 subnet.

I am unable to achieve that option with VMware ESXi 5.1.0 that I have. I would greatly appreciate any help from the community to solve this issue.

Regards

JJV

1 Solution

Accepted Solutions
abhilashhb
VMware Employee
VMware Employee

Refer this for step by step guidance http://www.rustyhann.com/ESXi-05-Create-vSwitch.pdf

Login into your Host.

Select host and go to Configuration Tab.

Click on Networking from the Left List.

In the networking tab you will see a vSwitch0 already present. With your NIC1 attached to it as Uplink.

Now click on Add Networking at the right top corner, And it will ask you whether its a VMkernel or Virtual machine connection type. Choose Virtual machine.

The it will ask you for an Uplink selection. Choose NIC2 from the window.

Name it as vSwitch1 or whatever your requirement is.

And click finish. you will see a second vSwitch that will appear on the Networking Window.

Now you create a new VM with two NICs. While creating choose the number of NICs as two. Assign first NIC to vSwitch0 and second NIC to vSwitch1.

Then after installation of OS you will see two network adapters where you can assign two IP's from two different subnets.

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

View solution in original post

13 Replies
abhilashhb
VMware Employee
VMware Employee

Hi JJV,

Welcome to the community.

There is a default vSwitch0 with nIC1 as uplink to it.

Create vSwitch and add the NIC2 to that vSwitch.

Create your VM and assign two vNIC's to them.

Now go to your VM, for the first vNIC assign the IP that is in NIC1's subnet.

For the second vNIC assing an ip from the NIC2's subnet.

This way you will be able to talk to two subnets from the VM. Is that what you are looking for?

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

0 Kudos
a_p_
Leadership
Leadership

It's not the NIC which the IP address is assigned to, it's the ESXi host, to be precise the VMKernel which is connected to a virtual switch. Configuring the setup you want is actually not much different from a physical setup where you don't assign an IP address to a switch port, but rather to the operating system, which in this case lives in a virtual machine.

André

0 Kudos
TedH256
Expert
Expert

Just to clarify what Abhilash said:

you have by default one vswitch - which by default has 1 physical nic associated with it. That vswitch also has a "management" vmkernel port group associated. This is the IP address that you assigned to the host. This port group cannot be used by virtual machnes - you need to have virtual machine port groups for that - there is probably already one there, by default, called possibly "Virtual Machine Network". Assigning this port group to a vnic in a virtual machine, will give that VM connectivity on the same subnet that the host is using (the ip address you gave to the vmkernel management port group. This functionality is dependent, of course, on how your physical switch is configured - but if your host is working, likely the virtual machine port group would work as well.

Pbly the easiest thing to do now, would be to create another vswitch, configure it with a virtual machine port group using a different name from the one above, and assign the other physical nic to it, Then just be sure the physical switch that the server port connects to, is configured on the proper vlan.

Now, when you create a vm with two vnics, you associate one vnic with the first virtual machine port group, and the other with the second vm port group.

Hope this help!

0 Kudos
Jjv
Enthusiast
Enthusiast

Hi Abhilash

Thanks for your reply.

I am very new to this VMware. Trying to learn by trial and error method.

Where do I see the options that you specified in your instructions like "create vSwitch and add NIC2 to it etc"?

It would be very grateful if you could be bit more specific on the steps to be followed.

Regards

JJ


0 Kudos
abhilashhb
VMware Employee
VMware Employee

Refer this for step by step guidance http://www.rustyhann.com/ESXi-05-Create-vSwitch.pdf

Login into your Host.

Select host and go to Configuration Tab.

Click on Networking from the Left List.

In the networking tab you will see a vSwitch0 already present. With your NIC1 attached to it as Uplink.

Now click on Add Networking at the right top corner, And it will ask you whether its a VMkernel or Virtual machine connection type. Choose Virtual machine.

The it will ask you for an Uplink selection. Choose NIC2 from the window.

Name it as vSwitch1 or whatever your requirement is.

And click finish. you will see a second vSwitch that will appear on the Networking Window.

Now you create a new VM with two NICs. While creating choose the number of NICs as two. Assign first NIC to vSwitch0 and second NIC to vSwitch1.

Then after installation of OS you will see two network adapters where you can assign two IP's from two different subnets.

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

Jjv
Enthusiast
Enthusiast

Hello Abhilash

Before I do what you mentioned, I need to ensure that both the physical NIC Adapters are enabled from ESX interface and the cables are connected to the appropriate network. Am I right?

After that follow your instruction. Is that the right procedure?

Regards

JJv

0 Kudos
abhilashhb
VMware Employee
VMware Employee

Yes please connect the physical NICs and see if they are detected by ESXi by going into ESXI configuration screen--->Configure management network--->Network adapters.

ESXi5_Configuration_3.jpg

They should say connected under status.

Once that is done you  could follow the steps.

Please consider awarding points by choosing Correct/helpful answers Smiley Happy

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

0 Kudos
Jjv
Enthusiast
Enthusiast

Hello Abhilash

I don't get the options as you have described in your steps. I have captured the screen shots of the options that I get when I select both Virtual Machine and VMKernel for your reference. However, I don't see an option to upload that file. Could you please tell me on how do I upload that screenshots for you to check?

Regards

JJv

0 Kudos
abhilashhb
VMware Employee
VMware Employee

Hello JJv. Please use the camera symbol that's there on the top bar to choose a file and attach it as screenshot Smiley Happy

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

0 Kudos
Jjv
Enthusiast
Enthusiast

Hi Abhilash

Your instructions were very good and it worked this time. Thanks for your assistance and guidance on resolving this issue.

Regards

JJv


0 Kudos
abhilashhb
VMware Employee
VMware Employee

Glad it helped Smiley Happy

Abhilash B
LinkedIn : https://www.linkedin.com/in/abhilashhb/

0 Kudos
davemac2626
Contributor
Contributor

Hi

I am having the same issue and cant see how to do this.... I need 2 different IP addresses, one on each adapter however it appears as though it wont let me.... The VMKernal Default Gateway seems to only allow 1 DFGW so how can I assign a different ip with a different dfgw to a different adapter?

I have attached some screen shots of my setup so far...

Many thanks in advance

Davevm1.JPGvm2.JPGvm3.JPG

davemac2626
Contributor
Contributor

Sorry please ignore this now! Basically I forgot that you cant have 2 x default gateways so instead you need to add static routes so thats what I did:

/bin # esxcfg-route -a 10.81.0.0/16 10.81.253.1

Adding static route 10.81.0.0/16 to VMkernel

/bin # esxcfg-route -a 10.96.0.0/16 10.81.253.1

Adding static route 10.96.0.0/16 to VMkernel

/bin # esxcfg-route -a 10.97.0.0/16 10.81.253.1

Adding static route 10.97.0.0/16 to VMkernel

/bin # esxcfg-route -a 10.254.240.0/20 10.254.129.1

Adding static route 10.254.240.0/20 to VMkernel

/bin # esxcfg-route -a 10.254.224.0/20 10.254.129.1

Adding static route 10.254.224.0/20 to VMkernel

/bin # esxcfg-route -a 10.254.128.0/20 10.254.129.1

Adding static route 10.254.128.0/20 to VMkernel

Cheers

Dave

0 Kudos