---
title: "Connect a network volume to a dedicated Windows server"
sidebar_label: "Connect a network volume to a Windows server"
description: "How to connect a network volume to a dedicated Windows server"
sidebar_position: 4
toc_max_heading_level: 2
---

import Formbricks from '@theme/MDXComponents/Formbricks';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { TabItemLabel } from '@selectel/docux/components';
import CopyIcon from '@selectel/docux/icons/copy';
import SanBlockStorage from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/dedicated/block-storage/san-of-block-storage.mdx';
import ConnectBlockStorageInPanel from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/dedicated/block-storage/connect-block-storage-to-server-in-panel.mdx';

# Connect the network volume to a dedicated server with Windows OS

Read more about network volumes in the [General Product Information for Network volumes](/block-storage/about/about-block-storage.mdx) guide.

1. [Create a SAN network](#create-san).
2. [Connect the network volume to the server](#connect-block-storage-to-server-in-panel).
3. [Connect the network volume to the server in the server OS](#connect-block-storage-to-server-in-os).
4. [Configure MPIO](#configure-mpio).
5. [Optional: connect the network volume to another server](#connect-block-storage-to-additional-server).
6. [Prepare the network volume for operation](#prepare-block-storage-for-operation).

## 1. Create a SAN network \{#create-san}

<SanBlockStorage />

## 2. Connect the network volume to the server \{#connect-block-storage-to-server-in-panel}

<ConnectBlockStorageInPanel />

## 3. Connect the network volume to the server in the server OS \{#connect-block-storage-to-server-in-os}

You can connect a network volume to the server manually or using a ready-made script that is generated in the control panel. You can use the script only on Ubuntu OS — for more details, see the instructions [Connect a network volume to a dedicated Linux server](/block-storage/manage/connect-block-storage-to-linux.mdx).

If Hyper-V is used on your server, the network volume will not work. This is because a disk over an iSCSI connection does not support SCSI-3 Persistent Reservations required for Hyper-V to run in a Failover Cluster mode.

The process of connecting a network volume in the server OS through a private subnet depends on the number of ports:

* if the server has two local ports, use the instructions for two ports;
* if the server has only one local port or [MC-LAG is configured](/dedicated/networks/mc-lag.mdx#configure-mc-lag), use the instructions for one port.

<Tabs queryString="connect-block-storage">
  <TabItem value="configuration-san" default>
    <TabItemLabel>
      SAN network
    </TabItemLabel>

    1. [Connect to the server via SSH](/dedicated/manage/connect-to-server.mdx#connect-via-ssh) or via [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

    2. Run PowerShell as an administrator.

    3. Print the list of network interfaces:

       ```bash
       Get-NetIPInterface
       ```

    4. Add IP addresses to the network interfaces connected to the SAN switch:

       ```bash
       New-NetIPAddress -InterfaceAlias "<eth_name_1>" -IPAddress <ip_address_1> -PrefixLength <mask_1> -DefaultGateway <next_hop_1>
       New-NetIPAddress -InterfaceAlias "<eth_name_2>" -IPAddress <ip_address_2> -PrefixLength <mask_2> -DefaultGateway <next_hop_2>
       ```

       Specify:

       * `<eth_name_1>` - the name of the first network interface you obtained in step 3;
       * `<ip_address_1>` - IP address of the first port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Configuring network interfaces** → column **Port IP address**;
       * `<mask_1>` - destination subnet mask for the first port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` - gateway for the first port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<eth_name_2>` - the name of the second network interface you obtained in step 3;
       * `<ip_address_2>` - IP address of the second port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Configuring network interfaces** → column **Port IP address**;
       * `<mask_2>` - destination subnet mask for the second port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` - gateway for the second port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    5. Configure static routes to access iSCSI targets:

       ```bash
       route add <destination_subnet_1> mask <mask_1> <next_hop_1> -p
       route add <destination_subnet_2> mask <mask_2> <next_hop_2> -p
       ```

       Specify:

       * `<destination_subnet_1>` - destination subnet for the first port on the network card. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<mask_1>` – the destination subnet mask for the first network card port in IPv4 mask format. For example: `255.255.252.0` for `/22`, `255.255.255.0` for `/24`, `255.255.255.252` for `/30`. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` — gateway for the first network card port. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<destination_subnet_2>` — destination subnet for the second network card port. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<mask_2>` – the destination subnet mask for the second network card port in IPv4 mask format. For example: `255.255.252.0` for `/22`, `255.255.255.0` for `/24`, `255.255.255.252` for `/30`. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **Network volumes and Storage** → tab **Network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` — gateway for the second network card port. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    6. Check that the static routes configured in step 5 have been applied:

       ```bash
       route print -4
       ```

    7. Check that the speed of each interface is at least 10 Gbit/s:

       ```bash
       Get-NetAdapter | Where-Object { $_.Name -eq "<eth_name_1>" } | Select-Object -Property Name,LinkSpeed
       Get-NetAdapter | Where-Object { $_.Name -eq "<eth_name_2>" } | Select-Object -Property Name,LinkSpeed
       ```

       Specify `<eth_name_1>` and `<eth_name_2>` – the names of the network interfaces configured in step 4.

    8. If the speed is lower than 10 Gbit/s, [create a ticket](https://my.selectel.ru/tickets/create/).

    9. Check that the iSCSI target is available:

       ```bash
       ping <iscsi_target_ip_address_1>
       ping <iscsi_target_ip_address_2>
       ```

       Specify:

       * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
       * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**.

    10. Get information about the Microsoft iSCSI Initiator Service:

        ```bash
        Get-Service MSiSCSI
        ```

        The response will show the service status. For example:

        ```bash
        Status   Name               DisplayName
        ------   ----               -----------
        Running  MSiSCSI            Microsoft iSCSI Initiator Service
        ```

        Here in the `Status` field, the current service status is displayed.

    11. If the Microsoft iSCSI Initiator Service is in the `Stopped` status, start it:

        ```bash
        Start-Service MSiSCSI
        ```

    12. Enable the automatic startup of the Microsoft iSCSI Initiator Service:

        ```bash
        Set-Service -Name MSiSCSI -StartupType Automatic
        ```

    13. Set the iSCSI initiator name:

        ```bash
        iscsicli NodeName "<initiator_name>"
        ```

        Specify `<initiator_name>` – the iSCSI initiator name. Can be viewed in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Initiator name**.

    14. Connect the iSCSI target portals:

        ```bash
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_1> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_1>
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_2> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_2>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
        * `<ip_address_1>` – IP address of the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Port IP address**;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**;
        * `<ip_address_2>` – IP address of the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Port IP address**.

    15. Configure authentication on the iSCSI target via iSCSI interfaces:

        ```bash
        $iusr="<username>"
        $ipasswd="<password>"
        $sts=$(Get-IscsiTarget | Select-Object -ExpandProperty NodeAddress)

        foreach ($st in $sts) {
            $tpaddr=($st -split ":")[-1]
            Connect-IscsiTarget -NodeAddress $st -TargetPortalAddress $tpaddr -TargetPortalPortNumber 3260 -IsPersistent $true -AuthenticationType ONEWAYCHAP -ChapUsername $iusr -ChapSecret $ipasswd
        }
        ```

        Specify:

        * `<username>` — username for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Username**;
        * `<password>` — password for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Password**.

    16. Print the list of iSCSI targets:

        ```bash
        Get-IscsiTarget
        ```

        The response will show the list of iSCSI targets. For example:

        ```bash
        IsConnected NodeAddress                                                  PSComputerName
        ----------- -----------                                                  --------------
            True    iqn.2001-07.com.ceph:user-target-99999:203.0.113.101
            True    iqn.2001-07.com.ceph:user-target-0398327:203.0.113.102
        ```

    17. Make sure that the `IsConnected` parameter for each iSCSI target is set to `True`.

    18. Check that the network volume has appeared in the list of available disks:

        ```bash
        Get-Disk | Select-Object Number, FriendlyName, SerialNumber, BusType, OperationalStatus
        ```

        The response will show the list of disks. For example:

        ```bash
        Number FriendlyName           SerialNumber       BusType  OperationalStatus
        ------ ------------           ------------       -------  -----------------
        0      Samsung SSD 860 EVO    Z3AZNF0N123456     SATA     Online
        1      WDC WD2003FZEX-00Z4SA0 WD-1234567890      SATA     Online
        2      Virtual iSCSI Disk     0001-9A8B-CD0E1234 iSCSI    Online
        3      SanDisk Ultra USB      4C531001230506      USB     Online
        ```

        Where:

        * `BusType` — disk type;
        * `2` — network volume number;
        * `OperationalStatus` — network volume status, `Offline` or `Online`.

    19. If the network volume status is `Offline`, set it to `Online`:

        ```bash
        Set-Disk -Number <block_storage_number> -IsOffline $false
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 18.

    20. Initialize the network volume:

        ```bash
        Initialize-Disk -Number <block_storage_number> -PartitionStyle GPT
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 18.

    21. If you are connecting the network volume to the server for the first time, create and format a partition on the network volume:

        21.1. Create a partition on the network volume:

        ```bash
        New-Partition -DiskNumber <block_storage_number> -UseMaximumSize -AssignDriveLetter
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 18.

        21.2. Format the network volume partition to the desired file system:

        * if you are connecting the network volume to only one server, format the network volume partition to the NTFS file system:

          ```bash
          Format-Volume -DriveLetter <volume_letter> -FileSystem NTFS -NewFileSystemLabel "<label>"
          ```

          Specify:

          * `<volume_letter>` — volume letter;
          * `<label>` — file system (volume) label.

        * if you are connecting one network volume to two or more servers, you must use the ReFS file system in conjunction with CSV (Cluster Shared Volumes) — see more in the [Resilient File System (ReFS) overview](https://learn.microsoft.com/windows-server/storage/refs/refs-overview) in the Microsoft documentation.
  </TabItem>

  <TabItem value="configuration-one-lan">
    <TabItemLabel>
      Private network: one port
    </TabItemLabel>

    1. [Connect to the server via SSH](/dedicated/manage/connect-to-server.mdx#connect-via-ssh) or via [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

    2. Run PowerShell as an administrator.

    3. Print the list of network interfaces:

       ```bash
       Get-NetIPInterface
       ```

    4. Add an IP address to the local port network interface:

       ```bash
       New-NetIPAddress -InterfaceAlias "<eth_name>" -IPAddress <ip_address> -PrefixLength <mask_1> -DefaultGateway <next_hop_1>
       New-NetIPAddress -InterfaceAlias "<eth_name>" -IPAddress <ip_address> -PrefixLength <mask_2> -DefaultGateway <next_hop_2>
       ```

       Specify:

       * `<eth_name>` — name of the private network interface, which is configured on the local network card port;
       * `<ip_address>` — free IP address for the local network card port from the private subnet you configured when [connecting the network volume to the server](#connect-block-storage-to-server-in-panel) in step 7;
       * `<mask_1>` – mask of the first destination subnet on the local network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` — the first gateway on the local network card port that you configured when you [connected the network volume to the server](#connect-block-storage-to-server-in-panel) in step 6. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<mask_2>` – mask of the second destination subnet on the local network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` — the second gateway on the local network card port that you configured when you [connected the network volume to the server](#connect-block-storage-to-server-in-panel) in step 6. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    5. Configure static routes to access iSCSI targets:

       ```bash
       route add <destination_subnet_1> mask <mask_1> <next_hop_1> -p
       route add <destination_subnet_2> mask <mask_2> <next_hop_2> -p
       ```

       Specify:

       * `<destination_subnet_1>` — first destination subnet on the local network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Destination Subnet**;
       * `<mask_1>` – mask of the first destination subnet. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` — the first gateway on the local network card port that you configured when you [connected the network volume to the server](#connect-block-storage-to-server-in-panel) in step 6. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<destination_subnet_2>` — second destination subnet on the local network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Destination Subnet**;
       * `<mask_2>` – mask of the second destination subnet. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` — the second gateway on the local network card port that you configured when you [connected the network volume to the server](#connect-block-storage-to-server-in-panel) in step 6. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    6. Check that the static routes configured in step 5 have been applied:

       ```bash
       route print -4
       ```

    7. Check that the iSCSI targets are available:

       ```bash
       ping <iscsi_target_ip_address_1>
       ping <iscsi_target_ip_address_2>
       ```

       Specify:

       * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
       * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**.

    8. Get information about the Microsoft iSCSI Initiator Service:

       ```bash
       Get-Service MSiSCSI
       ```

       The response will show the service status. For example:

       ```bash
       Status   Name               DisplayName
       ------   ----               -----------
       Running  MSiSCSI            Microsoft iSCSI Initiator Service
       ```

       Here in the `Status` field, the current service status is displayed.

    9. If the Microsoft iSCSI Initiator Service is in the `Stopped` status, start it:

       ```bash
       Start-Service MSiSCSI
       ```

    10. Enable the automatic startup of the Microsoft iSCSI Initiator Service:

        ```bash
        Set-Service -Name MSiSCSI -StartupType Automatic
        ```

    11. Set the iSCSI initiator name:

        ```bash
        iscsicli NodeName "<initiator_name>"
        ```

        Specify `<initiator_name>` – the iSCSI initiator name. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Initiator name**.

    12. Connect the iSCSI target portals:

        ```bash
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_1> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address>
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_2> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
        * `<ip_address>` – private IP address that you assigned to the local port interface in step 4;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**.

    13. Configure authentication on the iSCSI target via iSCSI interfaces:

        ```bash
        $iusr="<username>"
        $ipasswd="<password>"
        $sts=$(Get-IscsiTarget | Select-Object -ExpandProperty NodeAddress)

        foreach ($st in $sts) {
            $tpaddr=($st -split ":")[-1]
            Connect-IscsiTarget -NodeAddress $st -TargetPortalAddress $tpaddr -TargetPortalPortNumber 3260 -IsPersistent $true -AuthenticationType ONEWAYCHAP -ChapUsername $iusr -ChapSecret $ipasswd
        }
        ```

        Specify:

        * `<username>` — username for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Username**;
        * `<password>` — password for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Password**.

    14. Print the list of iSCSI targets:

        ```bash
        Get-IscsiTarget
        ```

        The response will show the list of iSCSI targets. For example:

        ```bash
        IsConnected NodeAddress                                                  PSComputerName
        ----------- -----------                                                  --------------
            True    iqn.2001-07.com.ceph:user-target-99999:203.0.113.101
            True    iqn.2001-07.com.ceph:user-target-0398327:203.0.113.102
        ```

    15. Make sure that the `IsConnected` parameter for each iSCSI target is set to `True`.

    16. Check that the network volume has appeared in the list of available disks:

        ```bash
        Get-Disk | Select-Object Number, FriendlyName, SerialNumber, BusType, OperationalStatus
        ```

        The response will show the list of disks. For example:

        ```bash
        Number FriendlyName           SerialNumber       BusType  OperationalStatus
        ------ ------------           ------------       -------  -----------------
        0      Samsung SSD 860 EVO    Z3AZNF0N123456     SATA     Online
        1      WDC WD2003FZEX-00Z4SA0 WD-1234567890      SATA     Online
        2      Virtual iSCSI Disk     0001-9A8B-CD0E1234 iSCSI    Online
        3      SanDisk Ultra USB      4C531001230506      USB     Online
        ```

        Where:

        * `BusType` — disk type;
        * `2` — network volume number;
        * `OperationalStatus` — network volume status, `Offline` or `Online`.

    17. If the network volume status is `Offline`, set it to `Online`:

        ```bash
        Set-Disk -Number <block_storage_number> -IsOffline $false
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

    18. Initialize the network volume:

        ```bash
        Initialize-Disk -Number <block_storage_number> -PartitionStyle GPT
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

    19. If you are connecting the network volume to the server for the first time, create and format a partition on the network volume:

        19.1. Create a partition on the network volume:

        ```bash
        New-Partition -DiskNumber <block_storage_number> -UseMaximumSize -AssignDriveLetter
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

        19.2. Format the network volume partition to the desired file system:

        * if you are connecting the network volume to only one server, format the network volume partition to the NTFS file system:

          ```bash
          Format-Volume -DriveLetter <volume_letter> -FileSystem NTFS -NewFileSystemLabel "<label>"
          ```

          Specify:

          * `<volume_letter>` — volume letter;
          * `<label>` — file system (volume) label.

        * if you are connecting one network volume to two or more servers, you must use the ReFS file system in conjunction with CSV (Cluster Shared Volumes) — see more in the [Resilient File System (ReFS) overview](https://learn.microsoft.com/windows-server/storage/refs/refs-overview) in the Microsoft documentation.
  </TabItem>

  <TabItem value="configuration-two-lan" default>
    <TabItemLabel>
      Private network: two ports
    </TabItemLabel>

    1. [Connect to the server via SSH](/dedicated/manage/connect-to-server.mdx#connect-via-ssh) or via [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

    2. Run PowerShell as an administrator.

    3. Print the list of network interfaces:

       ```bash
       Get-NetIPInterface
       ```

    4. Add IP addresses to the network interfaces of the local ports:

       ```bash
       New-NetIPAddress -InterfaceAlias "<eth_name_1>" -IPAddress <ip_address_1> -PrefixLength <mask_1> -DefaultGateway <next_hop_1>
       New-NetIPAddress -InterfaceAlias "<eth_name_2>" -IPAddress <ip_address_2> -PrefixLength <mask_2> -DefaultGateway <next_hop_2>
       ```

       Specify:

       * `<eth_name_1>` – name of the network interface on the first local network card port, which you obtained in step 3;
       * `<ip_address_1>` — free IP address for the first local port from the private subnet you configured when [connecting the network volume to the server](#connect-block-storage-to-server-in-panel) in step 7;
       * `<mask_1>` – mask of the destination subnet for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` — gateway for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<eth_name_2>` – the name of the network interface on the second local network card port, which you obtained in step 3;
       * `<ip_address_2>` — free IP address for the second local port from the private subnet you configured when [connecting the network volume to the server](#connect-block-storage-to-server-in-panel) in step 7;
       * `<mask_2>` – mask of the destination subnet for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` — gateway for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    5. Configure static routes to access iSCSI targets:

       ```bash
       route add <destination_subnet_1> mask <mask_1> <next_hop_1> -p
       route add <destination_subnet_2> mask <mask_2> <next_hop_2> -p
       ```

       Specify:

       * `<destination_subnet_1>` — destination subnet for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<mask_1>` – mask of the destination subnet for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_1>` — gateway for the first network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**;
       * `<destination_subnet_2>` — destination subnet for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<mask_2>` – mask of the destination subnet for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Static routes for connecting to iSCSI targets** → column **Destination Subnet**;
       * `<next_hop_2>` — gateway for the second network card port. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring network interfaces** → column **Next hop (gateway)**.

    6. Check that the static routes configured in step 5 have been applied:

       ```bash
       route print -4
       ```

    7. Check that the iSCSI target is available:

       ```bash
       ping <iscsi_target_ip_address_1>
       ping <iscsi_target_ip_address_2>
       ```

       Specify:

       * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
       * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**.

    8. Get information about the Microsoft iSCSI Initiator Service:

       ```bash
       Get-Service MSiSCSI
       ```

       The response will show the service status. For example:

       ```bash
       Status   Name               DisplayName
       ------   ----               -----------
       Running  MSiSCSI            Microsoft iSCSI Initiator Service
       ```

       Here in the `Status` field, the current service status is displayed.

    9. If the Microsoft iSCSI Initiator Service is in the `Stopped` status, start it:

       ```bash
       Start-Service MSiSCSI
       ```

    10. Enable the automatic startup of the Microsoft iSCSI Initiator Service:

        ```bash
        Set-Service -Name MSiSCSI -StartupType Automatic
        ```

    11. Set the iSCSI initiator name:

        ```bash
        iscsicli NodeName "<initiator_name>"
        ```

        Specify `<initiator_name>` – the iSCSI initiator name. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Initiator name**.

    12. Connect the iSCSI target portals:

        ```bash
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_1> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_1>
        New-IscsiTargetPortal -TargetPortalAddress <ip_address_portal_2> -TargetPortalPortNumber 3260 -InitiatorPortalAddress <ip_address_2>
        ```

        Specify:

        * `<iscsi_target_ip_address_1>` — IP address of the first iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 1**;
        * `<ip_address_1>` – IP address for the first local port from the private subnet that you assigned in step 4;
        * `<iscsi_target_ip_address_2>` — IP address of the second iSCSI target. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **IP address of the iSCSI target 2**;
        * `<ip_address_2>` – IP address for the second local port from the private subnet that you assigned in step 4;

    13. Configure authentication on the iSCSI target via iSCSI interfaces:

        ```bash
        $iusr="<username>"
        $ipasswd="<password>"
        $sts=$(Get-IscsiTarget | Select-Object -ExpandProperty NodeAddress)

        foreach ($st in $sts) {
            $tpaddr=($st -split ":")[-1]
            Connect-IscsiTarget -NodeAddress $st -TargetPortalAddress $tpaddr -TargetPortalPortNumber 3260 -IsPersistent $true -AuthenticationType ONEWAYCHAP -ChapUsername $iusr -ChapSecret $ipasswd
        }
        ```

        Specify:

        * `<username>` — username for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Username**;
        * `<password>` — password for iSCSI initiator authorization. You can view it in the [control panel](https://my.selectel.ru/servers/shd/block-storage/disks): in the top menu, click **Products** → **Dedicated Servers** → section **network volumes and Storage** → tab **network volumes** → disk page → block **Configuring an iSCSI connection** → field **Password**.

    14. Print the list of iSCSI targets:

        ```bash
        Get-IscsiTarget
        ```

        The response will show the list of iSCSI targets. For example:

        ```bash
        IsConnected NodeAddress                                                  PSComputerName
        ----------- -----------                                                  --------------
            True    iqn.2001-07.com.ceph:user-target-99999:203.0.113.101
            True    iqn.2001-07.com.ceph:user-target-0398327:203.0.113.102
        ```

    15. Make sure that the `IsConnected` parameter for each iSCSI target is set to `True`.

    16. Check that the network volume has appeared in the list of available disks:

        ```bash
        Get-Disk | Select-Object Number, FriendlyName, SerialNumber, BusType, OperationalStatus
        ```

        The response will show the list of disks. For example:

        ```bash
        Number FriendlyName           SerialNumber       BusType  OperationalStatus
        ------ ------------           ------------       -------  -----------------
        0      Samsung SSD 860 EVO    Z3AZNF0N123456     SATA     Online
        1      WDC WD2003FZEX-00Z4SA0 WD-1234567890      SATA     Online
        2      Virtual iSCSI Disk     0001-9A8B-CD0E1234 iSCSI    Online
        3      SanDisk Ultra USB      4C531001230506      USB     Online
        ```

        Where:

        * `BusType` — disk type;
        * `2` — network volume number;
        * `OperationalStatus` — network volume status, `Offline` or `Online`.

    17. If the network volume status is `Offline`, set it to `Online`:

        ```bash
        Set-Disk -Number <block_storage_number> -IsOffline $false
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

    18. Initialize the network volume:

        ```bash
        Initialize-Disk -Number <block_storage_number> -PartitionStyle GPT
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

    19. If you are connecting the network volume to the server for the first time, create and format a partition on the network volume:

        19.1. Create a partition on the network volume:

        ```bash
        New-Partition -DiskNumber <block_storage_number> -UseMaximumSize -AssignDriveLetter
        ```

        Specify `<block_storage_number>` is the network volume number you obtained in step 16.

        19.2. Format the network volume partition to the desired file system:

        * if you are connecting the network volume to only one server, format the network volume partition to the NTFS file system:

          ```bash
          Format-Volume -DriveLetter <volume_letter> -FileSystem NTFS -NewFileSystemLabel "<label>"
          ```

          Specify:

          * `<volume_letter>` — volume letter;
          * `<label>` — file system (volume) label.

        * if you are connecting one network volume to two or more servers, you must use the ReFS file system in conjunction with CSV (Cluster Shared Volumes) — see more in the [Resilient File System (ReFS) overview](https://learn.microsoft.com/windows-server/storage/refs/refs-overview) in the Microsoft documentation.
  </TabItem>
</Tabs>

## 4. Configure MPIO \{#configure-mpio}

MultiPath-IO (MPIO) - Multi-path I/O to improve the fault tolerance of data transfer to a network volume.

1. Disconnect iSCSI sessions:

   ```bash
   $session = Get-IscsiSession
   ```

2. Install MPIO components:

   ```bash
   Install-WindowsFeature Multipath-IO
   ```

3. Enable MPIO:

   ```bash
   Enable-WindowsOptionalFeature -Online -FeatureName MultiPathIO
   ```

4. Get the list of devices that support MPIO:

   ```bash
   mpclaim.exe -e
   ```

   The command output will display devices that support MPIO. For example:

   ```bash
   "Target H/W Identifier   "   Bus Type     MPIO-ed      ALUA Support
   -------------------------------------------------------------------------------
   "LIO-ORG TCMU device     "   iSCSI        NO           Implicit Only
   ```

   Here `LIO-ORG TCMU device` is the network volume ID.

5. Enable MPIO support for the network volume:

   ```bash
   mpclaim.exe -r -i -d "<block_storage_device>"
   ```

   Specify `<block_storage_device>` is the network volume ID you obtained in step 4. Note that the ID must be entered with spaces.

6. Check the MPIO status:

   ```bash
   Get-MPIOAvailableHW
   ```

   The command output will display the MPIO status for the network volume. For example:

   ```bash
   VendorId ProductId        IsMultipathed   IsSPC3Supported BusType
   -------- ---------        -------------   --------------- -------
   LIO-ORG  TCMU device      True            True            iSCSI
   ```

   Here, the `IsMultipathed` field displays the MPIO status.

7. Make sure the mechanism for checking path availability to MPIO devices is enabled:

   ```bash
   (Get-MPIOSetting).PathVerificationState
   ```

   The command output will display the status of the device path availability mechanism for MPIO. For example:

   ```bash
   Enabled
   ```

8. If the MPIO device pathing mechanism is set to `Disabled`, enable it:

   ```bash
   Set-MPIOSetting -NewPathVerificationState Enabled
   ```

9. Associate the volumes on the network volume with logical partitions in the server OS:

   ```bash
   iscsicli.exe BindPersistentDevices
   ```

10. Allow the server OS to access the contents of the network volume volumes:

    ```bash
    iscsicli.exe BindPersistentVolumes
    ```

11. Make sure the network volume is registered in the server OS configuration as a persistent device:

    ```bash
    iscsicli.exe ReportPersistentDevices
    ```

    The response will show information about the network volume as a persistent device. For example:

    ```bash
    Persistent Volumes
    "D:\"
    ```

    Here `D:\` is a volume on the network volume.

## 5. Optional: connect the network volume to another server \{#connect-block-storage-to-additional-server}

1. [Connect the network volume to the server in the Control Panel](#connect-block-storage-to-server-in-panel).
2. [Connect the network volume to the server in the server OS](#connect-block-storage-to-server-in-os).
3. [Configure MPIO](#configure-mpio).

## 6. Prepare the network volume for operation \{#prepare-block-storage-for-operation}

You can format the network volume that you connected to the server to the desired file system:

* ReFS (Resilient File System) is a resilient file system designed to increase data availability, scale large data sets in workloads, and ensure data integrity with protection against corruption. If you are connecting one network volume to two or more servers, you must use the ReFS file system in conjunction with CSV (Cluster Shared Volumes) — for more details, see the [Resilient File System (ReFS) overview](https://learn.microsoft.com/windows-server/storage/refs/refs-overview) in the official Microsoft documentation;
* a standard file system, for example, NTFS (New Technology File System). Please note that the NTFS file system does not support simultaneous read-write access from multiple servers to avoid data corruption. Use specialized file systems for shared access from multiple servers.

<Formbricks />
