Windows firewall blocking all ports

How to Block or Open a Port in Windows Firewall

According to your needs, you can configure Windows Firewall settings (block or open port in Windows 10/8/7) and restore defaults if you are unsatisfied with the default Windows Firewall settings. However, for this, you need to get to the advanced settings of the firewall. This is simple, simply open up the control panel and in its search box type – Firewall. Then open Firewall and click on its ‘Advanced Settings’ link.

We have already seen how to manage Windows Firewall. In this post, we will see in detail how to block or open a port in Windows 10/8/7 firewall.

Block port in Windows Firewall

When in the ‘Advanced Settings’ of Windows 8 firewall, click the Advanced settings link in the left-hand pane of the main firewall dialog. This will bring up the Windows Firewall with Advanced Security window.

Now, if you see the firewall window shows a list of rules on the left side. From the list, select Inbound Rules to display the inbound rules section.

Then, from the right pane select the ‘New Rule’ option.

Doing so will open the ‘New Inbound Rule Wizard’ window.

From it, select ‘Port’ as the new Rule Type and click Next. For safety purposes, I tried blocking TCP port. Click on Specific local ports. Then choose one port like 80 as shown in the screenshot below.

Click Next to continue.

Next, select ‘Block the connection’ as the Action and click Next.

Later, select all the profiles available for different types of connections (Domain, Private and Public) and click Next to continue.

Give a name of your choice to the new rule. I used ‘block suspicious ports’. If you want, you can add the description to the new rule. This step is however optional.

Finally, click the Finish button to configure the settings.

Open port in Windows Firewall

At times, you may feel the need of opening a port in the Windows firewall to let a specific IP communicate with your computer. For example, while playing games. The procedure to open a port remains more or less the same. All you need to do is follow the instructions in the New Inbound Rule wizard, specify the Port and select Allow the connection.

Port Scanning application like Free Port Scanner helps you identify open ports and services available on a network host. It thoroughly scans specific ports for a given IP and reveals vulnerable access points thereby letting you initiate action and close them to attackers.

Windows firewall blocking all ports

This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.

Answered by:

Question

I’ve got a problem during a Windows 7 deployment project. We want to configure the integrated Windows Firewall to block all outbound network traffic when the client is on a «public» network (public firewall profile). We only want to open the necessary ports that are needed for a VPN into the enterprise environment. These are in our situation DHCP, DNS, different rules for CRLs (for checking the client certificate) and the rules for the VPN itself. These rules are working well, but we have got a problem with the network profile identification.

We configured the firewall with a GPO, that all unknown networks are identified as public networks. The user can’t change the network profile to «Home» or «Work». So the network profiles can only be «public» or «domain».

We have a problem by opening only the ports mentioned above. When our client was on a «public» network it can’t find the way back to the domain profile. This may has something to do with the network identification by Network Location Awareness (NLA). Therefore we logged all dropped packages and found out there were many dropped packages on the following ports:

— 389 (TCP/UDP)
— 135, 137, 138 (UDP/TCP)
— 88 (Kerberos)
— 15032 .

We opened port 389 for UDP and TCP. After that we can sucessfully jump between public networks and the domain network.

But when we are on a public network and connecting to the VPN, the VPN network adapter do not find the way to the «domain» profile. It stays always on the «public» profile. Afterwards we opened the port 88 (Kerberos) and then the network profile on the VPN adapter changed to public with a yellow exclamation mark as the profile icon and the status «(Not authenticated)».

Читайте также:  Mysql workbench ��� ��������� ������ mac os

After opening the NetBios ports (135. ) and the strange port 15032, the VPN network adapter could change to the domain profile.

Can anyone tell me which ports are needed for a correct network profile identification by Network Location Awareness (NLA)? And why are these ports needed? It is very important for us to have a clear statement why we should open all these ports, because it is a high secure environment.

I hope you can help me with this problem. I can’t find any documentation from Microsoft about blocking all outbound connections in Windows Firewall.

Thanks a lot!
fox

Answers

Generally speaking, blocking all «outbound» traffic can be very problematic and is not typically recommended. You need to to know and control every port used for communications on the network. For applications that use RPC, this means restricting the ports on which communication can occur.

For more on controlling this behavior, see the following article «How to configure RPC dynamic port allocation to work with firewalls»
http://support.microsoft.com/kb/154596

Though it may not be acceptable due to being a high security environment, you might consider testing a rule allowing all, or at least a wider range of, traffic to the specific IP of the authenticating DC. AuthIP can be tested to enhance security by requiring that a security principle be authenticated before allowing the connection. This is still not without risk if the box is compromised, but then again so are any open ports.

VPN virtual adaptors can also pose a unique challenge. 3rd Party vendors can often times present unique behaviors in the face of NLA. Some, totally ignore the process and will always follow the profile of the physical adaptor. Others, implement a block on all traffic other than what you specifically allow. Still others, force interface configuration information that prevents NLA from operating. It is not stated here, and we may be using the Windows native client making this a moot point, but I offer the info merely to illustrate the added level of complexity introduced by virtual adaptors.

DNS 53, Kerb 88, and LDAP 389 are required for resolving and connecting to the Domain Controller, but you may also see traffic from various name resolution / registration providers, such as NbtNs, LLMNR, WSDiscovery, SSDP, etc. Additional traffic may be required for the VPN authentication. The 15032 is an unknown, but it may be something specific to that box, perhaps even specific to the VPN client software itself if using 3rd party, or RPC. More information from a trace taken using Network Monitor 3.4 may be helpful, for example; additional detail about the frame and the destination IP might provide a little insight. With NetMon you can also add the «Process» column which may help identify the generating process.

Ketan Thakkar | Microsoft Online Community Support

Firewall — Blocking Outbound Connections Issues

Hi guys! Just set WF to block all outbound connection except those in the allowed list (rules), but have some issues. When add a allow rule for i.e. Internet Explorer, Chrome, etc. they don’t work, losing ability to enter Internet. Try a lot of things associated some services with them like svchost.exe but no luck.

Replies (6) 

Welcome to Microsoft Community Forum.

I understand how frustrating it could be when things do not work as expected.

Please do not worry I will try my best to resolve it.

I would like to inform you that apart from svchost.exe there may be number of dependency services and files that you may have disabled.

Before we proceed I would require some more information to assist you better.

1. What all outbound rules have you disconnected?

I would suggest you to try the following steps:

Step 1: Understanding Windows Firewall Settings.

1. Windows Firewall has mainly three settings:

i. Block all incoming connections, including those in the list of allowed programs.
ii. Notify me when Windows Firewall blocks a new program.
iii. Turn off Windows Firewall (not recommended).

2. You can apply the first setting and give exceptions to other programs or devices that you don’t want to block.

1. By default, most programs are blocked by Windows Firewall to help make your computer more secure.

Note: The article explains to open the port, you can block the port by understanding the steps from the article.

Note: The article explains to allow a program to communicate, you can block the program by understanding the steps from the article.

Important: Keep the port 8080 open then, do NOT need to “tighten” the security, as long as you have the Windows Firewall turned on and you have antivirus, and antispyware then your system is secure.

Читайте также:  Как установить драйвера линукс убунту

Configuring the Default Outbound Firewall Behavior to Block

Hope the information helps. Let us know if you need further assistance with Windows related issues. We will be happy to help.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for keeping us updated on the status of the issue.

Have you tried the suggestions provided in the earlier post?

Please reply with results so that we can assist you further.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Did not work any of above sorry mate!

For proper working of MS firewall i must open ports 80, 443 and the Internet Explorer and Chrome working. For other software i have not such problems atm for windows update i don’t know.

But still firewall is buggy don’t show which critical process, services are being blocked.

I’m using currently MS Windows 7 Ultimate firewall + MSSE but think to go with 3rd party firewall again something like agnitum outpost firewall pro or private firewall.

p.s. Windows firewall is great but don’t show wich services, process are being block, in the begining i was thinking that svchost.exe was the problem but not i open for it all ports and still not have internet access, sadly. I don’t want to open for all programs ports 80, 443 8080 want only to open for browsers — Google Chrome, Internet Explorer, Firefox, etc. But has not solution for that in the firewall.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

This is slightly off topic, but I had all sorts of similar issues with W7 built in O/G firewall, until I stumbled upon this sort of add-on — http://www.sphinx-soft.com/ I found it at CNET — http://download.cnet.com/Windows-7-Firewall-Control-64-bit/3000-10435_4-10673576.html

There is a basic free version, but you have to buy the full version if you need all the facilities.

Windows7FirewallControl is based on Windows Filtering Platform (WFP), the security core of Windows7/Vista/2008 completely and does not install any third party kernel drivers. The Built-in Firewall is based on the same WFP as well. The both products work independently entirely. You can switch the Built-in Firewall ON or OFF at your option due to complete product independence.

There is a support forum here — http://vistafirewallcontrol.freeforums.org/index.php so you could perhaps sign up and ask any specific questions there before downloading and trying it, to make sure it does what you want.

This is NOT an advert, I do not work for them, but I do use it on my netbook and its certainly easier than the W7 inbuilt rules for O/G.

There are other alternatives to look at as well. See CNET for some examples — http://download.cnet.com/windows/firewall-software/?tag=bc ( like ZoneAlarm for example ) one of which may do what you want and probably certainly easier than the in-built system.

As always fully AV check anything you download before installing it.

If thats not what you are after — Apologies — Just ignore.

Как закрыть или открыть порты в Windows

Проблема

Проблема Брандмауэра Windows (Windows Firewall) заключается не в том как закрыть все порты, а в том, как открыть только необходимые. И главное, что сходу хрен поймешь, каким образом ограничить подключение к некоторым портам по IP адресам клиентов. По отдельности решить эти задачи не сложно, но чтобы было вместе — не встретил ни одного толкового руководства, поэтому и написана данная заметка. Так же, найденное решение не предполагает установки стороннего фаервола.

Недостатки Брандмауэра Windows:
— Если создать запрещающее правило для всех портов, а потом разрешающие для необходимых, то они не попадают в белый список, т.к. запрещающие правила приоритетнее разрешающих. Т.е. если запрет на подключение по порту существует, то разрешение на этот порт работать уже не будет.
— Нет приоритетов правил, как в нормальных фаерволах, чтобы сначала указать открытые порты, а последним задать запрещающее правило для всех остальных.

Читайте также:  Устранение неполадок windows 10 кнопка пуск

Допустим, есть VPS на винде, но у хостера нет внешнего фаервола, которым можно прикрыться. Свежеустановленная винда торчит наружу как минимум 135/tcp, 445/tcp, 49154/tcp и 3389/tcp (если включен RDP) портами даже в публичной сети (Public network), что требует исправления.

Алгоритм

Есть три типа портов, это:
— Общедоступные порты, которые должны быть открыты для всего интернета. Пусть будут 80 и 443 (http и https)
— Фильтруемые порты, доступные только с определенных IP адресов. Возьмем 3389 (RDP)
— Все остальные, должны быть закрыты
Требуется:
1. Создать правило, запрещающее всё, кроме трех вышеобозначенных портов.
2. Для общедоступных больше делать ни чего не требуется.
3. Для фильтруемого создать разрешающее правило, указав белые адреса.

Секрет в том, что при запрещении всех портов надо явно указать разрешенные. Иначе, как было сказано выше, не получится открыть нужные.

Пример

Задача 1: оставить открытыми для всего интернета 80, 443 и 3389 порты. Все остальные закрыть.
1. Создать новое правило для входящих подключений
2. Тип правила (Rule Type). Настраиваемые (Custom)
3. Программа (Program). Все программы (All programs)
4. Протокол и порты (Protocol and Ports). Тип протокола (Protocol type) — TCP. Локальный порт (Local port) — Специальные порты (Specific Ports). В поле вписать диапазон портов, за исключением 80, 443 и 3389. Должно выглядеть так — 1-79, 81-442, 444-3388, 3390-65535
5. Область (Scope). Локальный (local) — Любой IP-адрес (Any IP address). Удаленный (remote) — Любой IP-адрес (Any IP address).
6. Действие (Action). Блокировать подключение (Block the connection).
7. Профиль (Profile). Выбрать на свое усмотрение. Если не уверен, то выбрать все.
8. Имя (Name). Назвать его, например, Block_TCP.

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

Задача 2: оставить открытыми для всего интернета 80 и 443 порты. Ограничить подключение на порт 3389 только с разрешенных IP адресов. Все остальные закрыть.
Шаги 1-8 аналогичны предыдущей задаче, т.е. создается правило, разрешающее коннект по трем указанным портам.
Для фильтрации по IP надо создать второе правило:
9. Создать новое правило для входящих подключений
10. Тип правила. Настраиваемые
11. Программа. Все программы
12. Протокол и порты. Тип протокола — TCP. Локальный порт — специальные порты. Вписать порт 3389
13. Область. Локальный — Любой IP-адрес. Удаленный — Указанные IP-адреса. Сюда вписать белый список IPшников или подсетей, которым разрешен коннект по данному порту
14. Действие. Разрешить подключение.
15. Профиль. Выбрать на свое усмотрение. Если не уверен, то выбрать все.
16. Имя. Назвать его, например, RDP.

Если фильтруемых портов несколько, то создается по одному правилу на каждый порт.

Ну и чтобы стать совсем защищенным — создать правило, блокирующее все UDP соединения.

Задача 2 из консоли

Для хард core щиков приведу вторую задачу в виде консольных команд:

В конечном итоге, в гуёвине должно выглядеть так:
Для правила RDP:


Для правила Block_TCP:

UPDATE

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

Похожие записи

Комментарии к посту “ Как закрыть или открыть порты в Windows ”

…да-а-а-а-с… Все це цікаво… Але в мене «4 класи» компьютерної освіти, а пояснення розраховано мабуть на вищу к.о…. Тому скористатись цими поясненнями можна тільки за допомогою спеціаліста… А прочитати варто, щоб мати загальне уявлення яким чином все це робиться…

тут же розписано, що куди вписувати, навіть на скрінах показано, що вибирати і вписувати. Можна просто:
1) натиснути winkey + R (або пуск-выполнить)
2) ввести «cmd» і натиснути enter, з’явиться консоль
3) в консоль по черзі береш з блоку, обведеного пунктиром кожен рядок, копіюєш або вводиш сам і тиснеш enter, потім слідуючий. І так всі, крім останнього (там де «remoteip=x.x.x.x» — туди просто треба вписати ip, з якого ти хочеш мати можливість підключатись віддалено до даного ПК)

правда там ще й пропущено:

netsh advfirewall firewall add rule dir=in action=block protocol=TCP localport=444-3388 name=»Block_TCP_444-3388″

Действительно, пойду добавлю. Спасибо!

Але как же порты 25 110 для почты?

а как открыть порт только для конкретной программы?

Для этого есть вкладка «Программы и службы», там указывайте путь к исполняемому файлу

Возможно я некорректно выразился… Вопрос был в рамках статьи: создаем общее запрещающее правило для всех портов кроме http(s) и нужно для одной из программ открыть еще один порт (к примеру порт 45678, который должен быть открыт только для этой одной программы)

Для того чтобы открыть порт надо обязательно выполнить в брэндмауэре две вещи:
— открыть нужный порт (протокол, номер)
— перестать блокировать вашу конкретную программу (путь, имя) от доступа к любым портам (и открытым, и закрытым)

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

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