Ping — утилита командной строки для проверки соединений в сетях TCP/IP. Она является одним из основных средств диагностики сети и входит в состав всех современных сетевых операционных систем. Принцип ее работы заключается в том, что она отправляет запросы (ICMP Echo-Request) протокола ICMP указаному узлу и фиксирует поступающие ответы (ICMP Echo-Reply).
Время между отправкой запроса и получением ответа позволяет определить задержки при передаче и частоту потери пакетов, а также оценить загруженность канала передачи данных. Полное отсутствие ICMP-ответов может означать, что удалённый узел неисправен.
В серверных ОС начиная с Windows Server 2008 входящие эхо-запросы по умолчанию запрещены и блокируются брандмауэром Windows. Сделано это скорее всего с целью предотвратить сетевые атаки типа ICMP Flooding (затопление атакуемого узла пакетами ICMP), которые могут вызвать отказ в обслуживании (Denial of Service, DoS). Безопасность конечно важна, однако в результате при попытке проверить доступность сервера мы получаем ошибку.
Для разрешения входящих эхо-запросов необходимо активировать соответствующее правило брандмауэра Windows. Вот несколько вариантов того, как это сделать.
Оснастка Windows Firewall with Adwanced Security
Самый простой способ разрешить ping — воспользоваться оснасткой «Windows Firewall with Adwanced Security». Для ее запуска нажимаем клавиши Win+R и вводим команду wf.msc.
Заходим в раздел входящих правил (Inbound Rules). Здесь нас интересует предопределенное правило для IPV4 — ″File and Printer Sharing (Echo Request — ICMPv4-In)″. Обратите внимание, что в таблице присутствуют два правила с одинаковым названием. На самом деле это одно и то же правило, просто настроенное для разных профилей — одно для доменного профиля, второе для общего и частного.
Активируем правило, отметив галочкой чекбокс Enabled и проверяем, чтобы в поле Action был выбран пункт ″Allow the connection″.
Переходим на вкладку Advanced и выбираем профили, для которых это правило будет действовать. Сохраняем правило и жмем OK. Теперь сервер можно пинговать.
При необходимости в дополнительных мерах безопасности произведем еще несколько настроек, которые защитят сервер от атак и позволят вам спокойно пользоваться Ping-ом.
Переходим на вкладку Scope и в поле Remote IP address указываем, с каких адресов разрешено принимать входящие запросы. Здесь можно указать один адрес, диапазон адресов либо целиком подсеть.
На вкладке Local Principals указываем локальных пользователей или группы, которым разрешается пинговать данный сервер. Как вариант, можно дать разрешение только группе локальных администраторов.
Групповые политики
В доменной среде разрешить Ping можно централизованно, через групповые политики. Открываем в редакторе групповых политик соответствующую GPO и переходим в раздел Computer Configuration–Policies–Windows Settings–Windows Firewall with Adwanced Security. Раскрываем дерево поддразделов и переходим на вкладку Inbound Rule. Кликаем правой клавишей мыши и в контекстном меню выбираем New Rule.
Выбираем Predefined (предопределенные правила) и находим в списке группу правил «File and Printer Sharing».
Находим правило ICMPv4-In и убираем выделение с остальных.
Выбираем для правила действие Allow the connection (разрешить подключениe) и жмем Finish, сохраняя правило.
После того как правило создано, его можно открыть и отредактировать, точно так же как и в локальной оснастке брандмауэра.
Утилита Netsh
Кроме графических средств для управления правилами можно воспользоваться утилитой командной строки netsh. В качестве примера активируем правило ICMPv4-In для всех профилей брандмауэра и ограничим удаленные IP подсетью 192.168.1.0/24:
netsh adwfirewall firewall set rule name= ″File and Printer Sharing (Echo Request — ICMPv4-In)″ new enable= yes action= allow profile= any remoteip= 192.168.1.0/24
Если вы используете Windows Server 2008 (не R2), то команда будет выглядеть немного по другому. Для включения правила:
netsh firewall set icmpsetting 8
И для отключения:
netsh firewall set icmpsetting 8 disable
PowerShell
Также разрешить эхо-запросы можно с помощью PowerShell. Правда воспользоваться этим способом можно только в Windows Server 2012, в остальных ОС отсутствует соответствующий PowerShell модуль. Для активации правила воспользуемся следующей командой:
Set-NetFirewallRule -Name FPS-ICMP-ERQ-In -Enabled True -Profile Any -Action Allow
Вроде бы все. Хотя нет, вспомнил еще один интересный момент. Для нормальной работы службы каталогов Active Directory необходимо, чтобы брандмауэр пропускал ICMP пакеты от клиентских компьютеров к контроллеру домена. Это нужно для получения клиентами сведений групповой политики. Поэтому на контроллерах домена есть отдельное правило брандмауэра, разрешающее входящий ping — ″Active Directory Domain Controller — Echo Request (ICMPv4-In)″. Это правило активно по умолчанию.
Раздел: Windows
Написано: 13.09.2011
Автор: Antonio
Установили Windows Server 2008 и он не пингуется из сети?
Не беда!
Включить ping в Windows 2008 можно несколькими способами.
1. Простой
Пуск — Настройка — Панель управления — Центр управления сетями — Общий доступ и сетевое обнаружение
Включаем Сетевое обнаружение и Общий доступ к файлам
2. Используя расширенный режим брандмауэра
Пуск — Настройка — Панель управления — Администрирование — Брандмауэр Windows в режиме повышенной безопасности — находим и включаем в правилах для входящих подключений
3. Как включить пинг компьютера в командной строке
Сделать чтобы ваш компьютер можно было пинговать, можно командой
netsh firewall set icmpsetting 8
В Windows Server 2008 R2
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
Фразы: разрешить пинговать компьтер из сети, Windows 2008, Windows Server 2008, как включить пинг в фаерволле? расширенный режим брандмауэра как включить?
Windows · September 28, 2024
Configuring a firewall to allow ping requests on Windows Server 2008 is essential for network diagnostics and monitoring. The ping command is a useful tool for checking the reachability of a host on an Internet Protocol (IP) network. However, by default, Windows Firewall blocks ICMP (Internet Control Message Protocol) packets, which are used by the ping command. This article will guide you through the steps to configure the Windows Firewall to allow ping requests.
Understanding ICMP and Ping
ICMP is a network layer protocol used by network devices to send error messages and operational information. The ping command utilizes ICMP Echo Request and Echo Reply messages to determine if a host is reachable. When a ping is sent, the target host responds with an Echo Reply if it is reachable. If the firewall blocks these messages, the ping will fail, leading to confusion during network troubleshooting.
Steps to Allow Ping on Windows Server 2008
To allow ping requests through the Windows Firewall on a Windows Server 2008 machine, follow these steps:
Step 1: Open Windows Firewall
- Click on the Start button.
- Navigate to Control Panel.
- Select System and Security.
- Click on Windows Firewall.
Step 2: Access Advanced Settings
- In the left pane, click on Advanced settings.
Step 3: Create a New Inbound Rule
- In the Windows Firewall with Advanced Security window, click on Inbound Rules in the left pane.
- In the right pane, click on New Rule….
Step 4: Select Rule Type
- Choose Custom and click Next.
Step 5: Specify Protocol and Ports
- In the Protocol type dropdown, select ICMPv4.
- Click on Next.
Step 6: Configure ICMP Settings
- Click on Customize… under the ICMP settings.
- Select Specific ICMP types.
- Check the box for Echo Request and click OK.
- Click Next.
Step 7: Specify Action
- Select Allow the connection and click Next.
Step 8: Specify Profile
- Select the profiles where you want the rule to apply (Domain, Private, Public) and click Next.
Step 9: Name the Rule
- Provide a name for the rule, such as Allow Ping, and click Finish.
Testing the Configuration
After configuring the firewall, it is essential to test whether the ping requests are now allowed. You can do this by opening the Command Prompt and typing:
ping [IP Address or Hostname]
If the configuration is successful, you should receive replies from the target host. If not, double-check the firewall settings to ensure that the rule was created correctly.
Conclusion
Configuring the Windows Firewall to allow ping requests is a straightforward process that can significantly aid in network diagnostics. By following the steps outlined above, administrators can ensure that their servers are reachable for troubleshooting and monitoring purposes. Proper firewall configuration is crucial for maintaining network security while allowing necessary communication protocols.
For those looking for reliable USA VPS Hosting solutions, understanding firewall configurations is just one aspect of managing a secure and efficient server environment. Explore more about how to optimize your server settings with USAVPS.
Enable Ping Replies on Windows Server 2008
Due to security concern, by default you are not able to Ping a Windows Server 2008 machine. At first I though there is a problem with my network but actually it’s disabled. To enabled Ping reply from Windows Server 2008, goto Window Firewall with Advance Settings from Administrator Tools menu.
Look inside Inbound Rules, scroll down to File and Printer Sharing, right click and enable this rule. (pic below)
After that the check icon will turn green
For Windows Server Core which does not have any UI, you can enable this rule from the command prompt.
netsh firewall set icmpsetting 8
To disable it type
netsh firewall set icmpsetting 8 disable
The netsh advfirewall firewall command-line context is available in Windows Server 2008 and in Windows Vista. This context provides the functionality for controlling Windows Firewall behavior that was provided by the netsh firewall context in earlier Windows operating systems.
This context also provides functionality for more precise control of firewall rules. These rules include the following per-profile settings:
- Domain
- Private
- Public
The netsh firewall command-line context might be deprecated in a future version of the Windows operating system. We recommend that you use the netsh advfirewall firewall context to control firewall behavior.
Note The netsh firewall command line is not recommended for use in Windows Vista.
This article describes how to use the netsh advfirewall firewall context instead of the netsh firewall context to control Windows Firewall behavior in Windows Server 2008 and in Windows Vista.
Important If you are a member of the Administrators group, and User Account Control is enabled on your computer, run the commands from a command prompt with elevated permissions. To start a command prompt with elevated permissions, find the icon or Start menu entry that you use to start a command prompt session, right-click it, and then click Run as administrator.
Some examples of frequently used commands are provided in the following tables. You can use these examples to help you migrate from the older netsh firewall context to the new netsh advfirewall firewall context.
Additionally, the netsh advfirewall commands that you can use to obtain detailed inline help are provided.
Example 1: Enable a program
Old command | New command |
---|---|
netsh firewall add allowedprogram C:\MyApp\MyApp.exe “My Application” ENABLE | netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=”C:\MyApp\MyApp.exe” enable=yes |
netsh firewall add allowedprogram program=C:\MyApp\MyApp.exe name=”My Application” mode=ENABLE scope=CUSTOM addresses=157.60.0.1,172.16.0.0/16,LocalSubnet profile=Domain | netsh advfirewall firewall add rule name=”My Application” dir=in action=allow program=“C:\MyApp\MyApp.exe“ enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain |
netsh firewall add allowedprogram program=C:\MyApp\MyApp.exe name=”My Application” mode=ENABLE scope=CUSTOM addresses=157.60.0.1,172.16.0.0/16,LocalSubnet profile=ALL | Run the following commands:
netsh advfirewall firewall add rule name=“My Application“ dir=in action=allow program=“C:\MyApp\MyApp.exe“ enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain netsh advfirewall firewall add rule name=“My Application“ dir=in action=allow program=“C:\MyApp\MyApp.exe“ enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=private |
For more information about how to add firewall rules, run the following command:
netsh advfirewall firewall add rule ?
Example 2: Enable a port
Old command | New command |
---|---|
netsh firewall add portopening TCP 80 “Open Port 80“ | netsh advfirewall firewall add rule name=“Open Port 80“ dir=in action=allow protocol=TCP localport=80 |
For more information about how to add firewall rules, run the following command:
netsh advfirewall firewall add rule ?
Example 3: Delete enabled programs or ports
Old command | New command |
---|---|
netsh firewall delete allowedprogram C:\MyApp\MyApp.exe | netsh advfirewall firewall delete rule name=rule nameprogram=“C:\MyApp\MyApp.exe“ |
delete portopening protocol=UDP port=500 | netsh advfirewall firewall delete rule name=rule nameprotocol=udp localport=500 |
For more information about how to delete firewall rules, run the following command:
netsh advfirewall firewall delete rule ?
Example 4: Configure ICMP settings
Old command | New command |
---|---|
netsh firewall set icmpsetting 8 | netsh advfirewall firewall add rule name=“ICMP Allow incoming V4 echo request“ protocol=icmpv4:8,any dir=in action=allow |
netsh firewall set icmpsetting type=ALL mode=enable | netsh advfirewall firewall add rule name=“All ICMP V4“protocol=icmpv4:any,any dir=in action=allow |
netsh firewall set icmpsetting 13 disable all | netsh advfirewall firewall add rule name=“Block Type 13 ICMP V4“protocol=icmpv4:13,any dir=in action=block |
For more information about how to configure ICMP settings, run the following command:
netsh advfirewall firewall add rule ?
Example 5: Set logging
Old command | New command |
---|---|
netsh firewall set logging %systemroot%\system32\LogFiles\Firewall\pfirewall.log 4096 ENABLE ENABLE | Run the following commands:
netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Firewall\pfirewall.log netsh advfirewall set currentprofile logging maxfilesize 4096 netsh advfirewall set currentprofile logging allowedconnections enable |
For more information, run the following command:
netsh advfirewall set currentprofile ?
If you want to set logging for a particular profile, use one of the following options instead of the “currentprofile” option:
- Domainprofile
- Privateprofile
- Publicprofile
Example 6: Enable Windows Firewall
Old command | New command |
---|---|
netsh firewall set opmode ENABLE | netsh advfirewall set currentprofile state on |
netsh firewall set opmode mode=ENABLE exceptions=enable | Run the following commands:
Netsh advfirewall set currentprofile state on netsh advfirewall set currentprofile firewallpolicy blockinboundalways,allowoutbound |
netsh firewall set opmode mode=enable exceptions=disable profile=domain | Run the following commands:
Netsh advfirewall set domainprofile state on netsh advfirewall set domainprofile firewallpolicy blockinbound,allowoutbound |
netsh firewall set opmode mode=enable profile=ALL | Run the following commands:
netsh advfirewall set domainprofile state on netsh advfirewall set privateprofile state on |
For more information, run the following command:
netsh advfirewall set currentprofile ?
If you want to set the firewall state for a particular profile, use one of the following options instead of the “currentprofile” option:
- Domainprofile
- Privateprofile
- Publicprofile
Example 7: Restore policy defaults
Old command | New command |
---|---|
netsh firewall reset | netsh advfirewall reset |
For more information, run the following command:
netsh advfirewall reset ?
Example 8: Enable specific services
Old command | New command |
---|---|
netsh firewall set service FileAndPrint | netsh advfirewall firewall set rule group=“File and Printer Sharing“ new enable=Yes |
netsh firewall set service RemoteDesktop enable | netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes |
netsh firewall set service RemoteDesktop enable profile=ALL | Run the following commands:
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes profile=domain netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes profile=private |
source: https://support.microsoft.com/en-us/kb/947709