I have the following scenario: I'm on a laptop that I normally use to go from meeting to meeting and in house... I normally use this laptop to present projects and developments.
So as I go from here to there all the time... I decided to find a way to configure my equipment so that with a few clicks I can make my development environments work, etc...
As a first point the specifications of my environments: as host (operating system installed on the hardware) Windows 11 Pro, this computer is connected to a private network using the following settings:
LAN or WLAN configuration (Office, Static)
Note: these data were given and configured by the technical department if I change something I lose the internet connection on the office.
Or to private network WLAN (my House, DHCP)
switching between the LAN and WLAN whichever is sharing the internet with the VM workstation Network Device is the dynamic part... whichever should continue to provide the internet connection.
next... I have installed VM Workstation 16 y and I have created a virtual machine with ubuntu 20.04 server.
I explain how I have shared the network:
- I have taken the wired network or the wifi network, and shared it to the network device that VM Workstation created.
- Whether it is the wired or wifi network that provides internet connectivity is what I need to be dynamic, that is why I am using a static configuration in the adapter that VM Workstation has created:
- In my VM Workstation network device manager I have the following NAT configuration ():
- In ubuntu, I am using this configuration:
network:
version: 2
renderer: networkd
ethernets:
ens33:
dhcp4: false
dhcp6: false
addresses:
- 192.168.160.135/24
routes:
- to: default
via: 192.168.160.1
nameservers:
addresses:
- 192.168.160.1
- 192.168.2.2
just in case you think to ask me why use NAT in conjunction with a static IP or subnet? I do this because I usually have the developments in a virtual host, my windows host file looks like this:
192.168.160.135 test1.vm www.test1.vm
192.168.160.135 test1.vm www.test1.vm
In this way I get that in a single virtual machine through virtual host I can access and maintain different projects.
The problem is that sometimes it works and other times it doesn't.... for some reason I get a name resolution error.
can someone try to help me with this problem... if i'm configuring something wrong, i'm bad at subnetting.
nslookup google.com 192.168.2.2