VMware Cloud Community
jerry5
Enthusiast
Enthusiast
Jump to solution

how can vm access internet with dual uplinks?

Not sure if this is the right forum to ask my question.

But here is my question:

* I installed one Ubuntu vm in one ESXi host.

* The ESXi host has two ethernet ports:

  • One ethernet port "vmnic0" connects to my Windows 10 PC for management (DHCP, and IP like 192.168.1.x)
  • Another ethernet port "vmnic2" connects to internet (DHCP, and IP like 172.21.6.x)

* So I add dual uplinks for "vSwitch0" (please see screenshot)

  • Yesterday, I was able to ping 8.8.8.8 and access internet from Ubuntu
  • However for today, when I restart ESXI and Ubuntu vm, I can not ping 8.8.8.8 from Ubuntu anymore. 

Any hint to make it work again?

----------------- related screenshot -------------------------------------------

2-uplinks.jpg

ping-fail.jpg

 

ip.jpg

0 Kudos
1 Solution

Accepted Solutions
Lalegre
Virtuoso
Virtuoso
Jump to solution

Hello @jerry5,

I believe the issues you are facing are two:

vSwitch and Portgroup:

One the way you are setting the vSwitch is letting it choose one vmnic as Active (by default) and because of your restart, it could be possible that the vmnic2 took that position. Even if you have the 2 vmnic as Active, that is not the proper configuraiton.

IP Assignment:

Make sure that not both of the IP ranges that you have are giving IPs with the Gateway IP on the configuration because if that is the case, you will end having duplicate default routes and the Ubuntu box will not know to where send the traffic.

If In understood well, the scenario you are trying to achieve is to have an IP from ranges 192.168.1.x for the management, I am assuming that this network is purely L2 and you do not need to access other subnets from this IP. What you should ensure is that the default gateway is only from network 172.21.6.x

Solutions to this issue:

vSwitch and Portgroup:

  1. Create a separate vSwitch and move the vmnic for Internet to there.
  2. Create a portgroup on that vSwitch.
  3. Connect the second vNIC of the Ubuntu box to that portgroup.

IP Assignment:

Only if you have the duplicate gateway IP issue, make sure only the DHCP from the Internet subnet gives you the gateway.

Let me know how it goes.

Regards!

 

View solution in original post

2 Replies
Lalegre
Virtuoso
Virtuoso
Jump to solution

Hello @jerry5,

I believe the issues you are facing are two:

vSwitch and Portgroup:

One the way you are setting the vSwitch is letting it choose one vmnic as Active (by default) and because of your restart, it could be possible that the vmnic2 took that position. Even if you have the 2 vmnic as Active, that is not the proper configuraiton.

IP Assignment:

Make sure that not both of the IP ranges that you have are giving IPs with the Gateway IP on the configuration because if that is the case, you will end having duplicate default routes and the Ubuntu box will not know to where send the traffic.

If In understood well, the scenario you are trying to achieve is to have an IP from ranges 192.168.1.x for the management, I am assuming that this network is purely L2 and you do not need to access other subnets from this IP. What you should ensure is that the default gateway is only from network 172.21.6.x

Solutions to this issue:

vSwitch and Portgroup:

  1. Create a separate vSwitch and move the vmnic for Internet to there.
  2. Create a portgroup on that vSwitch.
  3. Connect the second vNIC of the Ubuntu box to that portgroup.

IP Assignment:

Only if you have the duplicate gateway IP issue, make sure only the DHCP from the Internet subnet gives you the gateway.

Let me know how it goes.

Regards!

 

jerry5
Enthusiast
Enthusiast
Jump to solution

Thanks Lalegre, 

  • Your solution on "vSwitch and Portgroup" works perfect: ubuntu can ping and access internet now!
  • I do not quite understand your solution on "IP Assignment",
    • probably I don't have the duplicate gateway issue for now.
    • I may understand it if I encounter the duplicate gateway issue in the future .
0 Kudos