Windows Network Profiles

Practice



In the Windows operating system, network profiles are used to define network and security settings depending on the type of network the computer is connected to. Determining the network profile type allows Windows to apply the appropriate settings to ensure safe and efficient network operation.

Windows has three types of network profiles:

  1. Public network profile: This profile is applied when the computer is connected to a public-access network, such as an open Wi-Fi network in a cafe, airport, or public library. In this mode, Windows applies security settings that restrict shared resources and minimize the computer's visibility on the network.

  2. Private network profile: This profile is used when the computer is connected to a home or office network. In this mode, Windows provides more flexible security settings, allowing users to share files, printers, and other resources within the network.

  3. Domain network profile: This profile is activated when the computer is connected to a corporate domain network (typically used in organizations). In this mode, the security policies set by the domain administrator are applied.

What is sometimes frankly lacking in Windows in terms of network management? In particular, what tool do system administrators lack most when they have to manage computers (usually laptops) that turn up in different places (different offices, or sometimes the office and sometimes home, etc.)? Network profiles.

Let's imagine a situation: there is a laptop. Suppose this laptop is used both at work and at home. A special case is when the settings are obtained via DHCP in both places, but that's the simple case. In our case, for example, a static IP must be used to connect to the network at work, while at home the IP is obtained via DHCP. Or even worse — in both cases the network settings are static, but different.

What should be done? More advanced users could, of course, write themselves a note like "at work enter these numbers here, and at home — these ones." However:

  1. Not all users will figure it out (well, yes, true);
  2. Not all users will even want to bother with manually editing network properties.



Solution.

So, let's come up with our own so-called network profiles.

Network settings can be managed from the command line.

So what's stopping us from whipping up a couple of bat files, stuffing them with the necessary network settings lines, and putting shortcuts to these bat files on the user's desktop with names like "Internet Home" and "Internet Office"? Nothing, really.

Let's give examples of such bat files. In our examples the network adapter is called "Подключение по локальной сети" ("Local Area Connection"), DHCP is used at home, and statically assigned settings are used at work.


internet_home.bat:

@echo off
netsh interface ip set address name="Подключение по локальной сети" source=dhcp
netsh interface ip set dns name="Подключение по локальной сети" source=dhcp


internet_office.bat:

@echo off
netsh interface ip set address name="Подключение по локальной сети" source=static addr=10.0.50.30 mask=255.255.255.0 gateway=10.0.50.1 gwmetric=1
netsh interface ip set dns "Подключение по локальной сети" static 10.0.0.1
netsh interface ip add dns "Подключение по локальной сети" 10.1.0.1


Now we just put shortcuts to these files on the employee's desktop — and they can switch between network profiles themselves.

The first time it connects to a new network, Windows asks the user for the network profile type. You can also change the profile type manually via the network settings:

  1. Right-click the network icon in the taskbar (usually a computer image or a Wi-Fi signal icon).
  2. Select "Open Network and Sharing Center".
  3. Find the active connection (Ethernet or Wi-Fi) and click on its name.
  4. In the window that opens, click "Properties".
  5. On the "Network" tab, select the network location type (private, public, or work).

The selected network profile determines the security settings and shared resources available on the network. It is important to correctly determine the network profile type in order to ensure safe and efficient computer operation under various network conditions.

See also

  • Network interface

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Operating Systems and System Programming"

Terms: Operating Systems and System Programming