Score:1

ubuntu 20.04.03 cannot access internet

cn flag

sudo nano /etc/netplan/00-installer-config.yaml after I installed my ubuntu server, I cannot access the internet. I am able to access it from my network. Any idea what would it be? I installed the basic/default settings.

Thanks


pctech@live:~$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul
t qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group de
fault qlen 1000 link/ether 00:50:56:b1:66:36 brd ff:ff:ff:ff:ff:ff
inet 192.168.51.111/22 brd 192.168.51.255 scope global dynamic ens160
valid_lft 604225sec preferred_lft 604225sec
inet6 fe80::250:56ff:feb1:6636/64 scope link
valid_lft forever preferred_lft forever


pctech@live:~$ cat /etc/netplan/*.yaml

# This is the network config written by 'subiquity'
network:
  ethernets:
    ens160:
      dhcp4: true
  version: 2

pctech@live:~$ ls -al /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Aug 24 08:42 /etc/resolv.conf -> ../run/systemd/resolv
chili555 avatar
cn flag
Please edit your question to show the result of the terminal commands: `ip addr show` and also: `cat /etc/netplan/*.yaml` and, finally: `ls -al /etc/resolv.conf` Welcome to Ask Ubuntu.
cn flag
ok. just edited my question. thanks
chili555 avatar
cn flag
Do you mean: `/etc/resolv.conf -> /run/systemd/resolve/resolv.conf` ?
cn flag
Hi chili555, yes
Score:1
cn flag

Please amend your netplan file. First, find out it's exact name:

ls /etc/netplan

Next, edit the file:

sudo nano /etc/netplan/<what_you_found>.yaml

Amend it to read:

network:
  version: 2
  renderer: networkd
  ethernets:
    ens160:
      dhcp4: true

Netplan is very specific about spacing, identation, etc. so proofread carefully twice. Save (Ctrl+o followed by Enter) and exit the text editor nano (Ctrl+x followed by Enter).

Follow with:

sudo netplan generate
sudo netplan apply

Test:

ping -c3 8.8.8.8
ping -c3 www.ubuntu.com

If you get ping returns from both, you're all set.

cn flag
I still cannot ping. I tried to paste in the comment how it was spaced but not sure how you spaced it here. i will update the question with a snapshot.
chili555 avatar
cn flag
Your snapshot appears correct. Did you try a reboot? Are there any clues in the message log? `sudo dmesg | grep ens`
cn flag
pctech@live:~$ ls /etc/netplan<br> 00-installer-config.yaml<br> pctech@live:~$ sudo nano /etc/netplan/00-installer-config.yaml<br> pctech@live:~$ sudo netplan generate<br> pctech@live:~$ sudo netplan apply<br> pctech@live:~$ ping -c3 8.8.8.8<br> PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.<br> <br> --- 8.8.8.8 ping statistics ---<br> 3 packets transmitted, 0 received, 100% packet loss, time 2036ms<br>
cn flag
ok here it is:<br>pctech@live:~$ sudo dmesg | grep ens [sudo] password for pctech: [ 0.168888] ACPI: Added _OSI(3.0 _SCP Extensions) [ 1.540115] vmxnet3 0000:03:00.0 ens160: renamed from eth0 [ 1.997093] sd 32:0:0:0: [sda] Mode Sense: 61 00 00 00 [ 7.173425] vmxnet3 0000:03:00.0 ens160: intr type 3, mode 0, 3 vectors allocated [ 7.174286] vmxnet3 0000:03:00.0 ens160: NIC Link is Up 10000 Mbps
chili555 avatar
cn flag
I think you failed to mention that this is a virtual machine.
cn flag
oops. sorry. yes it is a virtual machine
cn flag
do i need to install a different version of ubuntu?
chili555 avatar
cn flag
In your VirtualBox setup, you'll want to ensure your network adapter is set to "Bridged." Is it?
cn flag
i am using vmware esxi. could not find any option to make the network as bridge. i will try to open a ticket with vmware and ask them if there is a particular options i need to set to make this work. will update this once i got it to work
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.