Windows пингует linux а linux нет

Всем привет. Подскажите, пожалуйста, если кто знает, почему один и тот же шлюз пингуется из Windows и нет, когда загружен Linux?

Всем привет.
Подскажите, пожалуйста, если кто знает, почему один и тот же шлюз пингуется из Windows и нет, когда загружен Linux?

Ситуация подробно:
мой компьютер подключен к районной ethernet-сети, топологию которой я точно не знаю, но знаю, что:
— есть три «шлюза», которые нужно прописывать, чтобы использовать VPN-подключение к Интернет:

192.168.10.1
192.168.11.1
192.168.100.1
— маска подсети 255.255.0.0

Мой компьютер находится в сети 100 и имеет адрес 192.168.100.16. Выхожу в инет через сервер знакомого в сети 11: 192.168.11.204. Качество сети таково, что периодически этот сервер становится от меня недоступен (но доступен для компов из 11 сети). Затем становится доступен, но только из Windows. Когда загружаю GNU/Linux, пинг хоста 11.204, равно как и шлюза 11.1 выдаёт: icmp … packet filtered. Иногда, через несколько десятков или несколько тысяч пингов, связь устанавливается (но чаще надоедает ждать). При перезагрузке в Win пинг идёт сразу.
Сравнивал MAC-адрес сетевой карты в Lin и Win, они идентичны.

Вывод команды route -n показывает только 2 записи:
127.0.0.0 —> lo
192.168.0.0 —> eth0.

Система Mandriva 2006, ядро 2.6.12. Iptables отключены.
Для исключения глюков грузил другие дистрибутивы на Live CD, например, SLAX-6 c 24 ядром. Всё точно так же.
Установлено 2 сетевые карточки Realtek 8139.

  • Печать

Страницы: [1]   Вниз

Тема: ping с Windows на Ubuntu есть, а с Ubuntu на Windows нет!  (Прочитано 967 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
paykfvm

Здравствуйте! Ситуация такая, есть два компа, на одном стоит Windows 7, а на другом Ubuntu 11.04. Они соеденены сетевым кабелем напрямую. Дал обоим ip: windows — 192.168.10.1, Ubuntu — 192.168.10.2. Проблема в том, что ping с Windows на Ubuntu есть, а с Ubuntu на Windows нет! В чем проблема может быть?


Оффлайн
ArcFi

Копать в сторону виндового фаервола, обработка icmp.


Оффлайн
fisher74

Это смотря какая цель преследуется… :)

Вводим

sudo iptables -I INPUT -p icmp -j DROPи Ubuntu также перестаёт пинговаться … и пинговать кого-либо тоже кстати :)


Оффлайн
ArcFi

Это смотря какая цель преследуется… :)

Логично, в принципе. =]


Оффлайн
paykfvm

Это смотря какая цель преследуется… :)

Вводим

sudo iptables -I INPUT -p icmp -j DROPи Ubuntu также перестаёт пинговаться … и пинговать кого-либо тоже кстати :)

я так понимаю после этого действия с Винды до Ubuntu не достучусь что ли?


Оффлайн
ArcFi

я так понимаю после этого действия с Винды до Ubuntu не достучусь что ли?

и Ubuntu также перестаёт пинговаться … и пинговать кого-либо тоже кстати


Оффлайн
fisher74

Заметьте — я говорил только про ping!


Оффлайн
metal_mania

В семёрке идём в «Центр управления сетями и общим доступом», далее «Дополнительные параметры общего доступа» — там должен стоять radiobutton «Включить сетевое обнаружение». И тип сети должен быть «Рабочая» или «Домашняя».


Оффлайн
paykfvm

все с убунты до винды пошел пинг! пришлось отключить брандмауэр.


  • Печать

Страницы: [1]   Вверх

We need a little more information on your network setup to answer your question fully, but I believe I know at least what is causing the issue.

Assuming:


1) Both the Windows and Linux computers are supposed to be on the same local network.

2) The Linux server is not a virtual machine.

3) You are using bridged connections on your Windows machine to share its wireless connection to the Linux server through ethernet. (You bridged Wireless and Ethernet in Windows to get a connection to Linux.)


Then the problem is likely your network bridge. Your router assigned the local IP 192.168.0.110 to the Windows machine, and this is a common subnet for local networks.

The issue is that your Linux server has the IP of 10.88.77.111, which is an entirely different subnet. This means it likely did not receive an address from your router properly, and because of this Windows cannot ping the Linux server.

I would remove the network bridge, check all of your settings, and try to create it again.
Did you change any settings from default when creating the bridge, such as setting static addresses under the «Internet Protocol Version 4 (TCP/IPv4)» properties, for example?

Edit:

Since your Linux server is a virtual machine, the above information does not apply to your setup.

When you originally setup the virtual machine, did you change any of the network settings?

Edit #2:

Wait a second, that address you have your server set to looks very similar to the address VirtualBox assigns when the network settings are in NAT mode. Are you sure it is in bridged mode, like this for example:
The VirtualBox Machine I am testing things with currently.

If it is in bridged mode, and not NAT, then set the /etc/network/interfaces file to automatically retrieve an IP address. It will likely look more like the Windows one. If the automatic address it gives you works, then configure the static IP address to be what it gave you automatically.

First some background. One should need Windows 10 Build 17627 or higher to support Firewall with WSL connections. Here is the section from WSL release notes:

Build 17627 (Skip Ahead)

WSL

  • Windows firewall support for WSL processes. [GH 1852]
    • For example, to allow the WSL python process to listen on any port, use the elevated Windows cmd: netsh.exe advfirewall firewall
      add rule name=wsl_python dir=in action=allow
      program="C:Users<UserName>AppDataLocalPackagescanonicalgrouplimited.ubuntuonwindows_79rhkp1fndgsclocalstaterootfsusrbinpython2.7"
      enable=yes
    • For additional details on how to add firewall rules, see link

Next step, find absolute path of the Linux executable that wants Internet connection. The full path can be divided into three parts:

  1. C:UsersUserNameAppDataLocalPackages — Path where Universal Windows Platform apps store user specific files, temporary files etc.
  2. CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfs — Path where Ubuntu 18.04 Appx package store Ubuntu usersapce files i.e. /bin, /etc, /usr and others.
  3. binping — Linux ping binary.

Hence the whole path is:

C:UsersUserNameAppDataLocalPackagesCanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgscLocalStaterootfsbinping

You can use the following PowerShell script to get that path. Just enter ubuntu when it asks to enter Distribution name.

$DistroName=Read-Host "Enter Distribution Name"
$pacakgeName = (Get-AppxPackage *$DistroName*).PackageFamilyName
$appData = [System.Environment]::ExpandEnvironmentVariables("%LocalAppData%")
$InstallDir = $appData + "Packages" + $pacakgeName + "LocalStaterootfs"
echo $InstallDir
Invoke-Item $InstallDir
Read-Host -Prompt "Press any key to continue..."

Final step, add the firewall rule. For Windows Firewall, run this command as administrator to add Outbound firewall rule.

netsh.exe advfirewall firewall add rule name=wsl_ping dir=out action=allow program=<path_to_ping> enable=yes

For Avast Firewall, follow this instruction from Avast Support. Open Settings > General > Exclusion and add the path from previous step.

Canonical answers:

  • Accessing Ubuntu data (like «/etc») from Windows
  • Where is the Linux Subsystem’s file system located in Windows 10?

Не по теме:

Просто ping -t -w 100 192.168.0.1
Сейчас попробую arping

Выяснил:
если удалить arp кэш у винды, то пинг появляется на 2 пакета.

Добавлено через 13 минут
Если делать arping 192.168.0.2 -I eth1 на рутере, то пинг идёт нормально без сбоев. В этот момент пинг с виндовской машины становиться лучше (50% сбоев).
Неправильно настроены routing tables на рутере? (Но с линуксом на клиентской машине проблем ведь нет)

Добавлено через 11 минут
Если пинговать arping’ом с виндовской машины — то тоже всё впорядке, пинг arping идёт 100%. Пока идёт arping с виндовской машины простой пинг тоже проходит на 100%

Добавлено через 18 часов 13 минут
Перепроверил тублицы роутинга у рутера и сервисы у винды.
Не обнаружил нечего необычного. Непонимаю в чём может быть дело

Добавлено через 1 час 51 минуту
Посмотрел что происходит в сети через сниффер. Вот 2 пакета в качестве примера (в оффтоп убрано лишнее, жирным выделенно подозрительное).
Пакет от рутера:
ARP request

Не по теме:

HW type: Ethernet (0x0001)
Protocol type: IP (0x0800)
HW size: 6
Protocol size: 4
Opcode: request (0x0001)
[Is gratuitous: False]

Sender MAC address: 00:00:00_00:00:12 (00:00:00:00:00:12)
Sender IP address: 127.0.0.1 (127.0.0.1)
Target MAC address: 00:00:00_00:00:00 (00:00:00:00:00:00)
Target IP address: 192.168.0.2 (192.168.0.2)

Снифер выдаёт следующее инфо об этом пакете: «Who has 192.168.0.2? Tell 127.0.0.1»

Пакет от винды:
ARP reply:

Не по теме:

HW type: Ethernet (0x0001)
Protocol type: IP (0x0800)
HW size: 6
Protocol size: 4
Opcode: reply (0x0002)
[Is gratuitous: False]

Sender MAC address: AsustekC_79:86:ca (00:1b:fc:79:86:ca)
Sender IP address: 192.168.0.2 (192.168.0.2)
Target MAC address: 00:00:00_00:00:10 (00:00:00:00:00:10)
Target IP address: 127.0.0.1 (127.0.0.1)

Снифер выдаёт инфо на этот пакет: «192.168.0.2 is at 00:1b:fc:79:86:ca (duplicate use of 127.0.0.1 detected)»

Странно что 127.0.0.1 учавствует в arp. Странно что у него постоянно меняется mac адресс.

Если очестить arp кэш, то последовательность пакетов в сети такая:

Не по теме:

1. «Who has 192.168.0.1? Tell 127.0.0.1» — это запрос к рутеру
2. «192.168.0.1 is at 00:1b:fc:79:86:ca» -ответ от рутера
3. Echo (ping) request
4. Echo (ping) reply
5. Echo (ping) request
6. Echo (ping) reply
7 «Who has 192.168.0.2? Tell 127.0.0.1 (duplicate use of 127.0.0.1 detected)»
8.»192.168.0.2 is at 00:1b:fc:79:86:ca (duplicate use of 127.0.0.1 detected)»
9. DNS запрос антивируса
10. DNS ответ антивирусу
Всё.

Примечательно что в п.1, п7 и п.8 используется 3 разных мак адреса (причём все они какие-то странные типа 00:00:00:00:00:53)
+/- 3 к последнему числу.

Из всего следует что проблема с 127.0.0.1 — почему-то этот интерфейс учавствует в arp и у него постоянно меняется мак.

I can ping my BBB on 192.168.1.166, which is the address my router gave it, and which I have since made static.

Windows host

Ip address: 192.168.1.219

My linux VM (running on windows host):

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::dddc:91d0:276:c7b2  prefixlen 64  scopeid 0x20<link>

BBB:

eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.1.166  netmask 255.255.255.0  broadcast 192.168.1.255
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255

I also tried to add a route, so my route table looks like:

debian@beaglebone:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.254   0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.6.0     0.0.0.0         255.255.255.0   U     0      0        0 usb1
192.168.7.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0
192.168.56.0    192.168.1.166   255.255.255.0   UG    0      0        0 eth0 <-- ADDED THIS

Summary

  • From my linux VM I can ping my windows host and the BBB, both usb0 and eth0 (I can also ssh on to the BBB via both).
  • From my windows host I can ping my linux VM and BBB (both addresses)
  • from my BBB I can ping my windows host, but not my linux VM

I figure that this might have to do with my linux VM being on a different sub-net: 192.168.56.x, and not 192.168.1.x. So this is why I added a route in the table above.

What am I doing wrong?

UPDATE

I have another linux box on my network (192.168.1.120) and the BBB can ping that. However this second linux box also can’t ping my linux VM — so I think the problem is anything that is not my windows host PC can’t ping the linux VM… so the title to this question is now probably wrong and this is more of a «can’t ping my linux VM» issue. Updating the title…

I can ping my BBB on 192.168.1.166, which is the address my router gave it, and which I have since made static.

Windows host

Ip address: 192.168.1.219

My linux VM (running on windows host):

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::dddc:91d0:276:c7b2  prefixlen 64  scopeid 0x20<link>

BBB:

eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.1.166  netmask 255.255.255.0  broadcast 192.168.1.255
usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.7.2  netmask 255.255.255.0  broadcast 192.168.7.255

I also tried to add a route, so my route table looks like:

debian@beaglebone:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.254   0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.6.0     0.0.0.0         255.255.255.0   U     0      0        0 usb1
192.168.7.0     0.0.0.0         255.255.255.0   U     0      0        0 usb0
192.168.56.0    192.168.1.166   255.255.255.0   UG    0      0        0 eth0 <-- ADDED THIS

Summary

  • From my linux VM I can ping my windows host and the BBB, both usb0 and eth0 (I can also ssh on to the BBB via both).
  • From my windows host I can ping my linux VM and BBB (both addresses)
  • from my BBB I can ping my windows host, but not my linux VM

I figure that this might have to do with my linux VM being on a different sub-net: 192.168.56.x, and not 192.168.1.x. So this is why I added a route in the table above.

What am I doing wrong?

UPDATE

I have another linux box on my network (192.168.1.120) and the BBB can ping that. However this second linux box also can’t ping my linux VM — so I think the problem is anything that is not my windows host PC can’t ping the linux VM… so the title to this question is now probably wrong and this is more of a «can’t ping my linux VM» issue. Updating the title…

Понравилась статья? Поделить с друзьями:
  • Windows перестал видеть жесткий диск в биосе есть
  • Windows переместить окно с другого монитора
  • Windows переместить все окна на второй экран
  • Windows переменные среды системные переменные path
  • Windows переключение между рабочими столами мышкой