Брандмауэр windows открыть ping

Встроенный брандмауэр Windows в целях безопасности по умолчанию блокирует входящий ICMP трафик как в десктопных Windows 10/11, так и в Windows Server. Это означает, что вы не сможете удаленно проверить доступность компьютера с помощью стандартной команды
ping
, т.к. она будет отвечать о превышении интервала ожидания запроса (
Request timed out
) для ICMP Echo-Reply. Если вы хотите сделать возможной проверку доступности хостов Windows по протоколу ICMP из системы мониторинга или вручную из командной строки, можно разрешить ответы на ICMP эхо-запросы.

Чтобы разрешить отправку ответов на запросы по протоколу ICMP, нужно включить предустановленные правила в брандмауэре Windows.

  1. Откройте оснастку управления Windows Defender Firewall with Advanced Security, выполнив команду
    wf.msc
  2. Перейдите в раздел Inbound Rules
  3. Найдите правило Core Network Diagnostics – ICMP Echo Request (ICMPv4-In) и включите его.
  4. В моем случае есть два правила с этим именем. Одно для частного и общедоступного сетевого профиля Windows, и второе для доменного. Я включил их оба. Можно также включить правило, разрешающее ICMP ответы для IPv6 протокола (если используется).
    Правило Windows Firewall разрешить ответ на ping

Есть также другое правило File and Printer Sharing (Echo Request – ICMPv4-In), которое также разрешает компьютеру отвечать на эхо-запросы
ping
.

Попробуйте пропиговать ваш компьютер и убедитесь, что теперь он отвечает на ICMP запросы.

Можно включить правила Windows Firewall, разрешающие ответы на эхо-запросы ICMP с помощью такой команды PowerShell:

Set-NetFirewallRule -Name CoreNet-Diag-ICMP4-EchoRequest-In -enabled True

Если нужно ограничить список IP подсетей или хостов, которым разрешено отправлять ответы на ICMP запросы, выполните команду:

Set-NetFirewallRule -Name CoreNet-Diag-ICMP4-EchoRequest-In -enabled True -RemoteAddress 192.168.12.0,192.168.31.94

Откройте свойства правила в Windows Firewall и проверьте, что теперь правило разрешающие ICMP ответы будет работать только для указанных IP/подсетей.

Ограничить список IP в правиле ICMPv4 echo request

Если в файрволе отсутствует (удалено) правило для входящих ICMP запросов, можно создать его из командной строки:

netsh advfirewall firewall add rule name="Allow_ICMPv4_Echo" protocol=icmpv4:8,any dir=in action=allow

Другой пример PowerShell команды, которое создаст правило файервола, разрешающего ping для всех хостов в локальной сети:

New-NetFirewallRule -DisplayName "Allow_ICMPv4_Echo" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress localsubnet -Action Allow

Если нужно заблокировать ответы на ICMP эхо-запрос независимо от того, какие правила включены, создайте запрещающее правило, которое будет иметь более высокий приоритет:

New-NetFirewallRule -DisplayName "Block_ICMPv4_Echo" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress localsubnet -Action Block

Чтобы разрешить ответы на ICMP ping на всех компьютерах в сети, можно включить правило Windows Firewall с помощью доменной групповой политики .

  1. Откройте редактор доменных GPO (
    gpmc.msc
    ), создайте или отредактируйте имеющуюся GPO и назначьте ее на целевую OU или корень домена.
  2. Перейдите в раздел Computer Configuration -> Windows Settings -> Security Settings -> Windows Firewall with Advanced Security -> Inbound rules
  3. Создайте новое правило, выберите Predefined rule типа Core Networking Diagnostics
    Групповая политика с правилами для Windows Firewall

  4. Укажите какие правила ICMP Echo request нужно включить.
    GPO: разрешить ICMP ping в Windows

  5. На следующем шаге вы берите Allow the connection.

В этом руководстве рассмотрим, как включить правило, чтобы сервер стал отвечать на ping используя графический интерфейс Windows Server 2019, а также включим разрешающее правило через PowerShell и netsh.

Обычно просто отключают Windows Firewall полностью, однако это не рекомендуется делать в производственной среде, так как брандмауэр Windows хорошо справляется с обеспечением базового уровня защиты системы. Разрешим только конкретное правило, необходимое для успешного выполнения команды ping.


Разрешить проверку связи через брандмауэр Windows

Сначала нам нужно открыть брандмауэр Windows, это можно сделать несколькими способами. Один из методов — просто нажать клавишу Windows, чтобы открыть меню «Start«, а затем начать вводить слово Firewall. Как показано ниже, брандмауэр Windows с расширенной безопасностью должен отображаться, выберите этот пункт.

Меню Start Windows Server 2019 - открыть брандмауэр Windows

Еще один быстрый способ: в PowerShell можно просто ввести «firewall» и нажать Enter. Откроется базовый интерфейс брандмауэра, а затем нажать кнопку «Advanced settings» в левой части. Откроется тот же интерфейс, что и через меню «Start«.

Следующий способ открыть Firewall — ввести в CMD такой текст: «firewall.cpl«

В Брандмауэре в расширенном режиме перейдите в Inboud Rules (Правила для входящих подключений).

Правила Inboud Rules

В перечне правил в Inboud Rules, найдите «File and Printer Sharing (Echo Request — ICMPv4-In)» и активируйте его.

File and Printer Sharing (Echo Request - ICMPv4-In)

Еще один вариант. Активируем разрешающее правило командлетом Powershell

Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True

Полную справку со всеми параметрами можно получить, набрав команду в PowerShell

help New-NetFirewallRule

Вариант создания правила через netsh

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow

Примечание: Включение правила позволит получать ответы только на IPv4 запросы, если нужно получать ответы по IPv6, нужно разблокировать правило такое же правило, только с Echo Request — ICMPv6-In, перечисленное ниже. К тому же имеется несколько профилей: доменный, публичный, частный. Ненужные профили можно отключить в правиле, во вкладке Advanced.

После разблокировки правила сервер должен начать отвечать на запросы ping. С хоста виртуализации или другого пк в локальной сети протестируем ping’ом Windows Server 2019 по адресу 192.168.1.11 перед включением правила, а затем снова после его включения. Ниже видно, что время ожидания первых запросов истекло, так как входящие запросы ICMP были отключены по умолчанию в Windows Server 2019. После включения правила ICMP запросы ping успешно выполняются, что подтверждает ожидаемую работу.

Пример проверки связи:

Скачать видео.


Резюме

Стандартное правило брандмауэра — блокировать ICMP запросы, в итоге сервер не отвечает на ping. Включив это правило брандмауэра, мы включили команду ping в Windows Server 2019, которая поможет нам устранить неполадки в сети.

In this guide, you will learn how to enable ping requests in Windows client and server operating systems.

I’ll show you the steps for a single computer and how to use group policy to enable ping requests for multiple computers.

By default, the Windows Firewall blocks ping requests. Blocking ping requests adds another layer of security to your network by making systems appear offline or unavailable. This helps to slow down viruses, ransomware, and attackers. For these reasons it is recommended that ICMP ping requests are blocked.

I understand blocking ping requests can cause problems with other systems and in troubleshooting network problems. Many management tools use ICMP requests to check for uptime, system status, and so on. If you need to unblock ping requests try to allow it only where needed.

Allow Ping Requests in Windows 10

Step 1: Open the Windows Firewall

Click the start button then type firewall and click on “Windows Defender Firewall with Advanced Security”

open windows defender firewall

Step 2: Click on Inbound Rules

In the Firewall console click on inbound rules

open inbound rules

Step 3: Find File and Printer Sharing (Echo Request – ICMPv4-In) Rule

In the inbound rule list scroll down to find the “File and Printer Sharing (Echo Request

select file and printer sharing

If you look at the Enabled column it should say no and this is why ping requests are being blocked. To allow pings just pick your profile and then click on Enabled. In this example, I will enable pings only for the domain profile.

enable firewall rule

I do not recommend enabling pings on your public profile.

With pings enabled you should now be able to ping this system. I enabled pings on PC2 so I’ll test this from another computer.

test ping

Yes, pings are now working.

If you need to enable ping requests for multiple computers then group policy is a better option, see the next section for example.

Related: 11 Windows Firewall Best Practices

Enable Ping Request Using Group Policy

If you need to enable pings on multiple computers then you should use group policy. This will also prevent someone from disabling it.

These GPO settings will work with Windows 10, Server 2008, and later versions.

Open the group policy management console.

Create and link and new GPO to an OU. In this example, I’m going to enable pings on all computers in my ADPRO Computers OU.

create new gpo firewall rule

Give the GPO a name, I’ll name mine “Computer – Allow Pings”

Edit the new GPO and navigate to “Policies -> Windows Settings -> Security Settings -> Windows Defender Firewall with Advanced Security”

Click on inbound rules, right-click and select “New Rule”

new inbound rule

Select “Predefined”

In the dropdown select “File and Printer Sharing”

select file and printer sharing

Uncheck all rules except “File and Printer Sharing (Echo Request -ICMPv4-in)

icmpv4 in rule

Click Next.

Select “Allow the Connection” and click Finish.

The rule is now created but we need to change the profiles.

Double click the rule and click on the Advanced tab. Unselect any profiles you don’t need. I just need the domain profile enabled so I will unselect “private” and “public” and then click apply.

select advanced settings

This rule will enable ping requests on any system that the GPO is applied to. It will also prevent changing the rule on the local computer as it is now controlled by group policy. Below is a screenshot of the rule on a local computer. it is locked down and cannot be edited since it is controlled by group policy.

gpo controlled firewall rule

How to Enable Ping Requests in Server 2016

The steps are the same as a Windows 10 computer. The only difference is the firewall is called “Windows Firewall with Advanced Security”

server 2016 windows firewall ping

Enable the “File and Printer Sharing (Echo Request – ICMPv4-in) rule and pings will be allowed.

Allow Ping Requests and Limit Scope

For added security, you can use the scope settings to limit which systems can accept and return pings. This is a nice feature as it lets you enable firewall rules with added security.

For example, I need to allow ping requests on my 2016 server but there is no reason Lenny’s computer in finance should have access to ping the server. I can use the scope option to limit which IP addresses can send pings to the server.

windows firewall scope settings

In the picture above, I added the IP addresses of the systems that my 2016 server will accept pings from.

So if I send a ping from my PC2 (192.168.100.103) the ping fails.

test ping failed

Now I’ll send a ping from the server (192.168.100.10)

test ping success

The ping works because this IP is allowed by the firewall scope settings.

This is a great way to add additional security using the Windows Firewall. I use this setting all the time with various rules.

So that is how you enable ping requests in the Windows Firewall. If you liked this guide then check out more of my Active Directory Security tips for Windows domain environments.

If you have questions post them in the comment section below.

Are you unable to test network connectivity because the firewall blocks the ping? Know how to allow ICMP echo request through Windows 11 firewall.

The ping command is a popular method to troubleshoot network connectivity issues and check the stability of the internet connection. However, with the built-in Windows Firewall enabled on your Windows 11 computer, the ping requests will get blocked by default.

To remove this impediment, you need to enable ping in the Windows firewall. Check out how to allow ICMP echo request with top methods. But first, let’s have a basic understanding of the ping request and its safety to fix network problems more effectively and efficiently.

Contents

  • 1 What Is Ping Request, and Should You Allow It in Firewall?
  • 2 How to Allow Ping Through Win 11 Firewall With Best Approaches
    • 2.1 Method 1: Allow Ping From Windows Security Settings
    • 2.2 Method 2: Enable ICMP Echo Request Using Command Prompt
    • 2.3 Method 3: Allow Ping Through Firewall Using Advanced Settings
    • 2.4 Method 4: Allow ICMP Echo Request Using PowerShell
    • 2.5 Method 5: Allow Ping Using Local Group Policy
  • 3 Conclusion

What Is Ping Request, and Should You Allow It in Firewall?

A ping request, or Internet Control Message Protocol (ICMP) echo request, is a kind of network packet. It is transferred between devices to test the connectivity between those devices.

Ping requests are often used to diagnose network problems, network responsiveness, and packet loss, while for an ordinary user, the common use of ICMP request is to determine network latency. This command-line utility is available on most operating systems, including Windows, Linux, and macOS.

Now comes the burning question of whether to allow ping through the Windows 11 firewall or not. Computers that allow ICMP echo request are comparatively more vulnerable to cyber attacks if it has a poorly configured firewall or it got other security vulnerabilities. But allowing ping requests through the Windows Firewall can help you test network connectivity or troubleshoot network issues.

For this reason, you can allow ping requests on computers belonging to a secure environment and with a properly configured firewall. Otherwise, it’s better to block ping requests if you’re using public WiFi.

How to Allow Ping Through Win 11 Firewall With Best Approaches

There are different methods to allow ICMP echo request through the firewall of your Windows 11 PC. You can choose any of these depending on your choice and convenience.

Method 1: Allow Ping From Windows Security Settings

The most commonly used approach to allow ping in Windows 11 firewall is to change settings for apps that are allowed to go through the firewall.

  • Type Windows Security on the Windows 11 search bar and hit Enter.
  • Windows Security app will open. Select Firewall & network protection from the left panel.
  • Click on Allow an app through firewall hyperlink.
  • Allowed apps window will appear on your screen.
  • Click on the Change settings button.
Check the boxes beside File and Printer Sharing to enable ping through firewall

Check the boxes beside File and Printer Sharing to enable ping through firewall
  • Scroll through the list to find the File and Printer Sharing option.
  • Now, make sure to tick the boxes next to this option.
  • Click on the OK button to save the changes and allow ping through the firewall.

Method 2: Enable ICMP Echo Request Using Command Prompt

It’s also feasible to enable the ping with the help of a command prompt on a Windows 11 computer or laptop.

  • Press Windows + R keys to open the Run box and type cmd there.
  • Now, press Ctrl + Shift + Enter keys to open the command prompt with Admin access.
  • Type the following command and hit Enter:
netsh advfirewall firewall add rule name="ICMPv4 Allow Ping Requests" protocol=icmpv4:8,any dir=in action=allow
Use Command Prompt to allow ICMP Echo Request on Windows 11

Use Command Prompt to allow ICMP Echo Request on Windows 11
  • Next, type this command and press the Enter key to allow another type of ICMP request:
netsh advfirewall firewall add rule name="ICMPv6 Allow Ping Requests" protocol=icmpv6:8,any dir=in action=allow

  • Once the commands are executed successfully on the command prompt, you can easily enable ping through the Windows 11 firewall.

Method 3: Allow Ping Through Firewall Using Advanced Settings

There is another technique that allows ping to go through the firewall by running the advanced security settings for Windows Defender Firewall. For that, you need to follow these steps:

  • First, you need to open the Run box by pressing Windows + R keys.
  • Type wf.msc and press Enter.
  • Windows Defender Firewall with Advanced Security window will appear on your screen.
  • On the right panel, under the actions section, click on New Rule.
Click on New Rule to add new rule regarding ping through firewall

Click on New Rule… to add a new rule regarding ping through firewall
  • New Inbound Rule Wizard will pop up on the screen.
  • Select the Custom button and click on Next.
  • Choose All programs button and click on Next.
  • Click on the Protocol type to open the drop-down list.
  • From there, select ICMPv4 or ICMPv6, depending on which one you want to allow.
Choose ICMPV4 or ICMPV6 from the Protocol type drop-down menu

Choose ICMPV4 or ICMPV6 from the Protocol type drop-down menu
  • Click on the Customize… button on the same screen.
  • On the Customize ICMP Settings wizard, select the Specific ICMP types button.
  • Check the Echo Request option and click OK.
  • This wizard will close you’ll be taken to the Inbound Rule Wizard. Click Next.
  • With Any IP address option being selected for both options, click on Next.
  • Select Allow the connection option before clicking on Next.
  • Under the Profile section, select Domain, Private, and Public before clicking Next.
  • Add a name for this new rule and click on the Finish button.

Method 4: Allow ICMP Echo Request Using PowerShell

If you’re more comfortable with using PowerShell, you can use that to allow ICMP echo request.

  • Type PowerShell in your search bar.
  • On the right panel, click on Run as Administrator.
  • Once the PowerShell window opens, type the following code before hitting Enter:
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
  • It’ll create a new firewall rule for allowing incoming ICMPv4 echo requests.
Use commands on PowerShell to allows ICMP echo request or ping through firewall

Use commands on PowerShell to allow ICMP echo request or ping through the firewall
  • Now, you can type another code to allow ping over IPv6.
netsh advfirewall firewall add rule name="ICMP Allow incoming V6 echo request" protocol=icmpv6:128,any dir=in action=allow
  • Press Enter and let the command get executed.
  • Close the PowerShell window.

Method 5: Allow Ping Using Local Group Policy

You can also allow ping through the firewall using the local group policy editor.

  • Open the Run box by pressing Windows + R keys.
  • Type gpedit.msc and hit Enter to open the Local Group Policy Editor.
  • On the left panel, select Computer Configuration.
  • Double-click on Windows Settings to expand that.
  • Choose Security Settings and double-click to expand Windows Firewall with Advanced Security.
Find out how to navigate to the inbound rules section on Local GPE tool

Find out how to navigate to the inbound rules section on Local GPE tool
  • Select the Inbound Rules and right-click on it.
  • Click on New Rule…
  • In the new wizard, select the Custom button and click on Next.
  • Select All Programs and click on Next.
An example of the new inbound rule wizard All programs

An example of the new inbound rule wizard All programs
  • Open the Protocol type drop-down menu and choose ICMPv4 or ICMPv6, depending on which one you want to allow.
  • Click on Customize button from the same screen.
  • Select the Specific ICMP types button and tick the box for Echo Request. Click on Next.
How to select Echo Request in Specific ICMP types

How to select Echo Request in Specific ICMP types
  • Select Any IP address for both options and click on Next again.
  • Click on the radio button for Allow the connection button and click Next.
  • Tick the boxes for all the options: Domain, Private, Public.
  • Finally, add a name for the new rule and click on Finish to complete the process for allowing ping.

Conclusion

Allowing ping request may not be the safest choice in all situations, but you must allow it to some extent for network troubleshooting. It also helps you understand if there is some network latency issue. Now that you know how to allow ping through Windows 11 firewall, you shouldn’t have any trouble enabling ICMP echo request.

Which method did you find to be the most useful? Tell us in the comment section. Don’t forget to share this article with your friends and colleagues. Up next, how to fix Windows Online Troubleshooting Service is disabled.

В Windows Server  2016, 2019 и 2022 ICMP или Ping отключены по умолчанию, делает систему более безопасной, но иногда это приносит с собой некие сложности в мониторинге. 

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

Если Вам для каких-то своих целей или же для мониторинга необходимо включить ICMP пакеты, или же ping, то можно воспользоваться ниже приведенной инструкцией.

Его можно включить вручную без использования групповых политик.

Если ICMP пакеты на вашем компьютере не включены, вы получите сообщение об истечении времени ожидания.

Как включить Ping в брандмауэре Windows

Чтобы включить проверку связи в брандмауэре, выполните следующие действия:

Откройте брандмауэр, нажав Win+R и напишите команду firewall.cpl.

В открывшемся окне нажмите Advanced Settings  на правой панели.

Выберите Inbound Rules на левой панели и на правой панели New Rule.

Выберите File and Printer Sharing в разделе PredefinedRules. И нажмите Next

Выберите следующие два правила:

  • Общий доступ к файлам и принтерам (Echo Request – ICMPv6-In )
  • Общий доступ к файлам и принтерам (Echo Request – ICMPv4-In )

И нажмите Next.

Выберите пункт Allow the connectionНажмите Finish .

Как включить ICMP (Ping) с командной строки или PowerShell

Для этого откройте командную строку, нажав Win+R и напишите команду cmd.

Разрешить пинг IPv4 с командной строки:

netsh advfirewall firewall add rule name="ICMP Allow Ping V4" protocol="icmpv4:8,any" dir=in action=allow

Разрешить ping IPv4 с помощью PowerShell:

New-NetFirewallRule -DisplayName "ICMP Allow Ping V4" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress <localsubnet> -Action Allow

Если после тестирования и настроек необходимо отключить ICMP пакеты, то так же можем воспользоваться командной строкой для этого.

Заблокировать ping IPv4 с командной строки:

netsh advfirewall firewall add rule name="ICMP Allow Ping V4" protocol="icmpv4:8,any" dir=in action=block

Заблокировать ping IPv4 с помощью PowerShell:

New-NetFirewallRule -DisplayName "ICMP Allow Ping V4" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress <localsubnet> -Action Block

Также предлагаем рассмотреть другие полезные статьи:

  • Как подключиться к серверу по FTP, SFTP и SCP
  • Как установить и настроить FTP-сервер IIS на Windows Server 2019
  • Как подключиться к Docker контейнеру по sFTP

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Настройка onedrive windows 11
  • Acer e1 530g windows 7
  • Realtek alc1200 windows 10 нет звука
  • Восстановление загрузки windows xp mbr
  • Контроль запуска приложений windows