Reply to Message

View discussion in a popup

Replying to:
louyo
Virtuoso
Virtuoso

OK,  if you have not tried to use a static IP, you might want to  try it. Your initial post showed your VM ethernet adapter as ens33. Mine is the same, make sure yours hasn't changed. You also might want to try on a new VM or a copy of yours just to be safe.

To simulate what you are doing, I went into the control panel on my VM and deleted the ethernet adapter. Again, this is not Ubuntu host or VM.

This process is available on the 'net via duckduckgo, but here is a synopsis:

In network editor, I checked the subnet and gateway for NAT: 192.168.164.0/24 and GW of 192.168.164.2.

Then, I ran ip addr:

2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:2f:08:9b brd ff:ff:ff:ff:ff:ff

That shows the ens33 adapter.  I then created a netplan yaml. file using nano (use the text editor of your choice).

sudo nano /etc/netplan/01-netcfg.yaml

In that .yaml file, I pasted:

network:
  version: 2
  renderer: networkd
  ethernets:
    ens33: #this should be the name of your Ethernet.
      dhcp4: no
      addresses:
        - 192.168.164.10/24
      gateway4: 192.168.164.2
      nameservers:
        addresses:
          - 8.8.8.8
          - 8.8.4.4

After saving:

sudo netplan apply

Then, I tested.

ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=128 time=24.1 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=128 time=21.6 ms

then

ping yahoo.com
PING yahoo.com (98.137.11.164) 56(84) bytes of data.
64 bytes from media-router-fp73.prod.media.vip.gq1.yahoo.com (98.137.11.164): icmp_seq=1 ttl=128 time=93.2 ms
64 bytes from media-router-fp73.prod.media.vip.gq1.yahoo.com (98.137.11.164): icmp_seq=2 ttl=128 time=91.1 ms

Note that I turned off dhcp. I think I got a disconnected notice but then it connected as seen with the ping command.

You could do the same with bridged using your LAN settings, just don't use something in the DHCP range.

Like I said, might be worth a try unless someone comes up with a better solution.

Again, probably want to use a copy of the VM or save it first.

Lou

Reply
0 Kudos