Windows 2012 public networks

Как изменить «Общедоступную сеть» (Public) на «Частную» (Private) в Windows 8.1/Server 2012

Windows 8.1 и Server 2012 R2 порой неправильно определяют тип сетевого подключения. Частная сеть (Private) может быть определена как общедоступная (Public Network) и наоборот, благодаря чему применяются разные правила брандмауэра. И если для домашнего компьютера это не критично, то на серверах такое не допустимо. Так, сервер, у которого в профиле сетевого подключения значится «Общедоступная сеть», не отвечает на пинги даже внутри сети.

Сетевые профили появились в Windows Vista и 2008-ом сервере и отныне являются частью брандмауэра Windows, в котором прописаны различные правила в зависимости от типа сети. В Windows Server 2012 убрали возможность управления типом соединения из графического интерфейса, оставив лишь просмотр примененного профиля (ну это же Microsoft и что у них творится в головах не понятно).

Сменить профиль можно выполнив пару команд в PowerShell. Для начала посмотрим текущие сетевые профили активных подключений командой Get-NetConnectionProfile:

PS C:\Users\Администратор> Get-NetConnectionProfile

Из скриншота видно, что «проблемный» интерфейс имеет индекс 12 и тип сети Public.

Команда Set-NetConnectionProfile позволяет установить категорию сетевого профиля:

PS C:\Users\Администратор> Set-NetConnectionProfile -InterfaceIndex 12 -NetworkCategory Private

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

Изменение профиля «общедоступной сети» на «частную» через редактор реестра

Лично мне этот вариант не очень нравится, но пусть будет в качестве альтернативы. Запускаем редактор реестра и находим ветку, содержащую профили всех сетевых подключений:

Имя интересующего нас профиля можно узнать в «Центре управления сетями и общим доступом». которое указано в ключе реестра ProfileName. Тип сети задается в параметре Category. Доступны следующие значения этого ключа:

  • «0» — Общественная сеть (Public Network)
  • «1» — Частная сеть (Private Network)
  • «2» — Доменная сеть (Domain Network)

Если считаете статью полезной,
не ленитесь ставить лайки и делиться с друзьями.

Комментариев: 5

А что, вполне актуально!

С учетом что пару лет назад майкрософт сняла Win8.1 с поддержки и всем очень сильно рекомендовала пеерйти на Win10

Ваш сарказм не очень уместен. Вы мыслите весьма узко, беря во внимание исключительно домашнюю версию Windows 8/8.1, но не забывайте сколько в работе серверов на Windows Server 2012/R2, которые ещё долгое время будут работать.

Читайте также:  Windows со временем начинает медленно работать

Уважаемый автор, Ваш пост не совсем корректен.

«Windows 8.1 и Server 2012 R2 порой неправильно определяют тип сетевого подключения» — при подключении эти ОС (и не только эти) спрашивают насчёт профиля сети. И если пользователь ответил «га-отвали» или вообще не ответил, то получим то, что получим.

Если уж «для начала», то оболочку PowerShell нужно сначала запустить. Для этого в той же 2012 R2 нужно нажать и отпустить кнопку Windows, затем начать набирать power. Система поиска подскажет полное имя и даст ссылку на запуск PowerShell. Либо можно открыть панель Charms (курсор мыши в правый верхний угол), а затем запустить поиск (значок лупы), далее точно так же набираем название оболочки.

«C:\Users\Администратор>» — совсем не факт, ибо оболочка показывает профиль текущего пользователя, которого необязательно зовут Администратор. Корректнее было бы написать C:\Users\имя_текущего_пользователя>

В остальном — информация, безусловно, полезная.

Zoltan Lisovsky, да вы, как я посмотрю, буквоед 🙂 В таком случае следует начинать с включения компьютера. Полагаю, всем ясно, что PS C:\Users\Администратор> просто дано в качестве примера и сути командлета это не меняет.

Дибилы из MS по какому-то хитрому принципу назначают тип сети (то-ли по наличию прописанного шлюза, то-ли еще по чему) — почему бы не сделать возможность прямого выбора? В любом случае спасибо за подсказку про PowerShell 🙂

Windows 2012 public networks

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

Answered by:

Question

Within Network & Sharing Center there appears to be no options available to change a network type as you could do in Server 2012?

Within Network List Manager policies everything is set to «not configured» so this should not be disabling any functionality.

Answers

Firstly, if the server is domain joined, when it starts to detect the network location, the machine will contact a DC via port 389. If this detection successful, it will get the domain profile. And we cannot change it.

However, if the server is not domain joined, the domain was not found or process failed, NLA will let you to determine which firewall profile will be used, private or public.

All the above articles can apply to Windows Server 2012.

How do I make a connection private on Windows Server 2012 R2

After a restart of one of our servers (a Windows Server 2012 R2), all private connections become public and vice versa (this user had the same problem). Stuff like pinging and iSCSI stopped working, and after some investigation it turned out this was the cause.

Читайте также:  Windows live one center

The problem is that I don’t know how to make them private again. Left-clicking the network icon in the tray shows the «modern» sidebar, but it only shows a list of connections, and right-clicking them doesn’t show any options.

What could be the problem, and is there a way to change these settings? I have to make one of the connections public (Internet access), and two of them private (backbone).

7 Answers 7

Powershell. Here is an example of changing the network profile of a network interface called Ethernet1 from whatever it is now to «Private.» I got this info from Get-Help Set-NetConnectionProfile -Full .

A GUI way of making this change:

  1. Hit Winkey + R to open Run prompt and type gpedit.msc
  2. Navigate to: Computer Configuration/Windows Settings/Security Setting /Network List Manager Policies .
  3. Choose your Network name in the right pane.
    Note: To show networks not currently connected, right-click Network List Manager Policies in the left pane and choose Show All Networks.

Go to Network Location tab and change the Location type from Public to Private.

Close Local Policy Editor.

Using Powershell. Here is an example of changing the network profile of a network interface called Ethernet to «Private.» This is a one line command.

This will work on any local computer with Powershell installed.

I’ve had a similar issue for months on my home 2012R2 Domain Controller.

After patching and a reboot I could not connect via RDP.

I have MS firewall turned off in GPO for domain networks. After not being able to connect I found that the primary Ethernet connection was listed as public and therefore the firewall was ON.

Why is the NIC changing from domain to public ?
After researching a few articles on the web, I’ve concluded the following:

After a restart of the only DC in the domain, AD services are not immediately available when the IP stack is initialized.
This results in the OS sensing that this is a public network and it sets the NIC accordingly.

Permanent resolution of this problem on this machine was to set the Network Location Awareness service to delayed start.

This allows AD services to become available and then the OS senses a domain network and sets the NIC accordingly.

Windows 2012 public networks

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

Answered by:

Question

Hi i have a query, how to change network profile to public from domain in a server on Windows 2012?

Best Regards Edgar

Answers

Thanks for your post.

If the server is domain joined, when it starts to detect the network location, the machine will contact a DC via port 389. If this detection successful, it will get the domain profile. And we cannot change it. If the domain was not found or process failed, NLA will let you to determine which firewall profile will be used, private or public.

For more information about Network Location Awareness, you may refer to the following article. It also applies to Windows 2012.

Network Location Awareness (NLA) and how it relates to Windows Firewall Profiles

If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.

Windows 2012 public networks

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

Answered by:

Question

Answers

In order to solve the problem more efficiently I need to clarify some information.

Firstly, is the server domain-joined?

If the server is domain-joined, when it starts to detect the network location, once this detection is successful, it will get the domain profile, and we cannot change it.

Secondly, you mentioned that you have tried the link which provided by Trana, it didn’t work. Would you please tell us how many steps have you completed, and where went wrong?

Thirdly, is the Public Network clickable at Network and Sharing Center?

Here are some steps below which I suggest you try:

  1. Hit Winkey + R to open Run prompt and type gpedit.msc.
  2. Navigate to: Computer Configuration /Windows Settings / Security Setting /Network List Manager Policies.
  3. Choose your Network name from the right pane.
  4. Go to Network Location tab and change the Location type from Public to Private.
  5. Close Local Policy Editor.

Here are some related links below that could be useful to you:

How do you change network location type on Server 2012?

15 Windows 8 Tips and Tricks

Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Please feel free to let us know if this method couldn’t solve the problem.

Читайте также:  Что такое активация windows sp3
Оцените статью