Vmware ubuntu нет интернета

Virtual Machine Ubuntu 20.04 LTS : connect: Network is unreachable

I am new to linux and networking and today I have a «connect: Network is unreachable» when executing ping or sudo apt commands. I have seen some similar questions but still don’t have a clue about how to fix it. My ubuntu system is installled on my machine by VMware. messages I got after running sudo lshw -C network

 *-network DISABLED description: Ethernet interface product: 82545EM Gigabit Ethernet Controller (Copper) vendor: Intel Corporation physical id: 1 bus info: pci@0000:02:01.0 logical name: ens33 version: 01 serial: 00:0c:29:c3:23:09 size: 1Gbit/s capacity: 1Gbit/s width: 64 bits clock: 66MHz capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full latency=0 link=no mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) memory:fd500000-fd50ffff 
 # Let NetworkManager manage all devices on this system network: version: 2 renderer: NetworkManager 
 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default 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: ens33: mtu 1500 qdisc fq_codel state DOWN group default qlen 1000 link/ether 00:0c:29:c3:23:09 brd ff:ff:ff:ff:ff:ff 

Источник

cannot connect to internet from virtual machine

I am using Vmware Player to use Ubuntu 14.04 but I am unable to get any internet connection in my virtual machine even though my system is connected to the internet. The original OS in my system is Windows 7. Can anybody suggest the way out.

3 Answers 3

Found the solution by browsing through multiple threads. Compiling it here.

EDIT : Please check if your network is in bridged mode or not if you are using VMWare/ VirtualBox before following the steps below. Enabling bridge mode and restarting guest OS can resolve the issue.

First check if your network is disabled by using the following cmd in terminal:

If it shows disabled after the name of your adapter ( note down the logical name for later use)

 *-network DISABLED description: Ethernet interface product: 82545EM Gigabit Ethernet Controller (Copper) vendor: Intel Corporation physical id: 1 bus info: pci@0000:02:01.0 logical name: ens33 

All we need to do is enable the adapter, so lets get started.

open up your interfaces file by using the following cmd:

My file had the following data written:

auto lo iface lo loopback 

But the logical name of my NIC was ens33 ( not lo), so i changed it to read the following and saved the file.

auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto wlan0 iface wlan0 inet dhcp 

Now time to restart the networking service.

check if network is back up, it shouldn’t have that disabled tag anymore.

If that doesn’t work -> But as explained earlier change the network adaptor settings to bridged in your virtual machine settings.

If all that does not work, the best way to resolve the issue is

Читайте также:  Скорость мобильного интернета ташкент

Restore your VM network settings

If you are using an older version download a new version (trial version would also work) — we are just updating your settings

Follow the steps:

enter image description here

Depending on how you are connected to the network, try either Bridged or NAT mode for the VM’s network adapter. Keep in mind that you may lose connectivity from the host machine to the VM. In this case you’ll need another network adapter.

In most cases NAT should work. In this case only your host machine’s IP is visible to the network, and ports are allocated for the VM to communicate to the outside world. The problem is that you can’t connect to the VM from the host machine if you need to. Add another adapter as I mentioned above and connect to its IP address. You will have two adapters — one for the Internet and the other for host-to-guest.

In the bridge mode the VM is visible to the outside network, so a network configuration is required that enables the VM to get an IP address and participate in the network (for example, network administrators may block unknown MAC addresses). The host machine talks with the VM as it were just a computer on the network.

Update your question with additional information if my suggestion does not work: guest OS, how your host computer is connected to the network, what the current configuration of the VM’s network adapters is. Is it a home or a workplace computer?

So I guess if you are connected to a corporate LAN, then NAT will work while Bridge will not. To add another interface 1) add an adapter in VMWare Player; 2) Add an interface in Ubuntu. Assuming your existing interface is eth0, edit /etc/network/interfaces, adding these lines:

auto eth1 iface eth1 inet dhcp 

Then restart the networking service:

sudo /etc/init.d/networking restart 

Another reason for your not being able to connect to the Internet may be a proxy server. Make sure that the proxy configuration in the VM is the same as in the host machine.

Источник

Ubuntu installed on Vmware cannot get access to internet

I installed Ubuntu 14.04 on Vmware, the host machine is Windows 7. However, I cannot get access to internet from Ubuntu. I am not clear how to identify the cause and fix it? Thank you for the help. This the screenshot I choose the option of «bridged» option. Besides, I also include the result of running ifconfig enter image description here enter image description hereI also try to change to «bridge option» enter image description here

4 Answers 4

Selecting NAT option under Network Connection in Network Adapter setting has done the trick for me.

enter image description here

You just need to Bridge your actual Ethernet port to VmWare port, so that virtual machine get access to internet through that bridged connection.

In order to do that, instruction are available on following links:
1. Configuring Bridged Networking Options on a Windows Host
2. Vmware Help

This will definitely solve your issue.

For Vmware PLayer: How to Fix a VMware Player Bridged Network?
There are images shown in the article, which will help you to attend each step.

Читайте также:  Увеличение скорости интернета несколько подключений

Another resolution is it may be possible that it won’t work with Bridged Connection. Try with NAT (N/W Address Translation) option.
if it still doesn’t work then check your UBUNTU has correct driver installed.

Источник

После настройки статического IP Ubuntu server 22.04 пропадает сеть

192.168.1.1 — ip роутера после sudo netplan apply ip поменялся на статический но при этом попала сеть. Ничего не пингуется, получаю Destination Host Unreachable. При чем с хоста все пингуется по ip 192.168.168.10 нормально. Подскажите, пожалуйста, в чем проблема? Или для подобных целей нужно два сетевый интерфейса? (Один ходит во внешку а другой во внутрянку?)

Можете, пожалуйста, подробнее описать, что не так?

макаке дали компьютер и она стала нажимать все кнопки подряд. Вас реально ничего не смущает в том куске который я привел выше?

Вы про то что они ip который я прописываю не относится к подсети шлюза? Исправил, но все аналогично

Покажите выхлоп ip a; ip r s table all

Вам нужно где-то в настройках vmware указать, чтобы подсеть 192.168.168.0/24 NAT’илась, раз вы хотите такую конфигурацию.

При чем с хоста все пингуется по ip 192.168.168.10 нормально

Это вы, могу предположить, пингуете соседа по локальной сети (возможно, в сети провайдера, а не в вашей), а не ВМ.

ValdikSS ★★★★★ ( 13.02.23 23:12:04 MSK )
Последнее исправление: ValdikSS 13.02.23 23:12:09 MSK (всего исправлений: 1)

 GNU nano 6.2 output.txt default via 192.168.1.1 dev ens33 proto static 192.168.1.0/24 dev ens33 proto kernel scope link src 192.168.1.145 local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1 local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1 broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1 local 192.168.1.145 dev ens33 table local proto kernel scope host src 192.168.1.145 broadcast 192.168.1.255 dev ens33 table local proto kernel scope link src 192.168.1.145 ::1 dev lo proto kernel metric 256 pref medium fe80::/64 dev ens33 proto kernel metric 256 pref medium local ::1 dev lo table local proto kernel metric 0 pref medium local fe80::20c:29ff:fefc:95f0 dev ens33 table local proto kernel metric 0 pref medium multicast ff00::/8 dev ens33 table local proto kernel metric 256 pref medium 

Да нет, точно не соседа делал tcpdump когда пинговал

У меня 192.168.168.0 как раз и NAT’тится

У меня 192.168.168.0 как раз и NAT’тится

Тогда почему у вас о ней никаких упоминаний в таблице роутинга, зато есть 192.168.1.145?

Изменил файл /etc/netplan/00-installer-config.yaml

network: ethernets: ens33: dhcp4: no addresses: [192.168.168.145/24] gateway4: 192.168.168.1 nameservers: addresses: [8.8.8.8, 192.168.168.1] optional: true version: 2 

в шлюз прописал IP сетевого адаптера VMware

теперь получаю следующие на ip a; ip r s table all

1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default 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: ens33: mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:0c:29:fc:95:f0 brd ff:ff:ff:ff:ff:ff altname enp2s1 inet 192.168.168.145/24 brd 192.168.168.255 scope global ens33 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fefc:95f0/64 scope link valid_lft forever preferred_lft forever default via 192.168.168.1 dev ens33 proto static 192.168.168.0/24 dev ens33 proto kernel scope link src 192.168.168.145 local 127.0.0.0/8 dev lo table local proto kernel scope host src 127.0.0.1 local 127.0.0.1 dev lo table local proto kernel scope host src 127.0.0.1 broadcast 127.255.255.255 dev lo table local proto kernel scope link src 127.0.0.1 local 192.168.168.145 dev ens33 table local proto kernel scope host src 192.168.168.145 broadcast 192.168.168.255 dev ens33 table local proto kernel scope link src 192.168.168.145 ::1 dev lo proto kernel metric 256 pref medium fe80::/64 dev ens33 proto kernel metric 256 pref medium local ::1 dev lo table local proto kernel metric 0 pref medium local fe80::20c:29ff:fefc:95f0 dev ens33 table local proto kernel metric 0 pref medium multicast ff00::/8 dev ens33 table local proto kernel metric 256 pref medium 

Извиняюсь за тупость, только начинаю осваивать Linux

Читайте также:  Wifire скорость мобильного интернета

Где «у вас»? NAT в виртуальных машинах — userspace (SLIRP), он не создаёт сетевого интерфейса, его нельзя настроить через таблицу маршрутизации, он не позволит подключиться к виртуальной машине с хоста или откуда-либо еще. Исходящий адрес при такой настройке — IP-адрес хоста, независимо от того, что вы укажете в сетевых настройках внутри ВМ.

Используйте полноценные интерфейсы. NAT-интерфейс нужен только для того, чтобы раздать интернет без дополнительных настроек.

ValdikSS ★★★★★ ( 14.02.23 11:08:30 MSK )
Последнее исправление: ValdikSS 14.02.23 11:10:58 MSK (всего исправлений: 1)

Потому что у человека userspace NAT, о чём написано в первом сообщении.

Да хоть хренюзерспэйс, defroute указывает на адрес до которого при показанных настройках достучатся нельзя от слова совсем.

Вас смущает несовпадение диапазона шлюза и адреса клиента? Такая настройка заработает без проблем, если на хосте/роутере все настроено для этого.

Такая настройка заработает без проблем, если на хосте/роутере все настроено для этого.

Если был бы полноценный сетевой интерфейс и на хосте установлен маршрут в указанную сеть на хосте.

В чём ваш вопрос? Это довольно типовая конфигурация, да и вопрос не в этом.

ip a add 192.168.168.10/24 dev ens33 ip r add default via 192.168.1.1

Как вы думаете, почему после второй команды оно напишет «Error: Nexthop has invalid gateway.» ?

Далеко не всегда. Да и вмтваревский NAT как раз создаёт интерфейс vmnet8 .

Как вы думаете, почему после второй команды оно напишет «Error: Nexthop has invalid gateway.» ?

Потому что вы не добавили маршрут до 192.168.1.1/32 , а NetworkManager, который прописан в файле Netplan’а, его добавляет автоматически при такой конфигурации. Я только что развернул контейнер с Ubuntu 22.04 и скопировал конфигурацию из первого поста — она применилась корректно.

# ip r default via 192.168.1.1 dev eth0 proto static metric 100 192.168.1.1 dev eth0 proto static scope link metric 100 192.168.168.0/24 dev eth0 proto kernel scope link src 192.168.168.10 metric 100 

Зачем вы спорите со мной, ни о чём? Лучше помогите автору решить проблему.

Я не знаю особенностей vmware, но в сообщении После настройки статического IP Ubuntu server 22.04 пропадает сеть (комментарий) у автора нет никаких дополнительных интерфейсов — вероятно, используется slirp.

и скопировал конфигурацию из первого поста — она применилась корректно.

gateway4: 192.168.1.1 addresses: [192.168.168.10/24]
default via 192.168.1.1 dev eth0 proto static metric 100 192.168.1.1 dev eth0 proto static scope link metric 100 

Источник

Оцените статью
Adblock
detector