Open nat windows 10

Содержание
  1. Как изменить тип NAT со строгого на открытый — Вокруг-Дом — 2021
  2. Table of Contents:
  3. Шаг 1
  4. Шаг 2
  5. Шаг 3
  6. Шаг 4
  7. Шаг 5
  8. Шаг 6
  9. Шаг 7
  10. OPEN NAT как правильно настроить ПК, консоль (ps4, XboxOne) роутер чтобы получать хоста и побеждать (Апрель 2021).
  11. Set up a NAT network
  12. NAT Overview
  13. Create a NAT virtual network
  14. Connect a virtual machine
  15. Configuration Example: Attaching VMs and Containers to a NAT network
  16. Docker for Windows (Linux VM) and Windows Containers
  17. Multiple Applications using the same NAT
  18. Troubleshooting
  19. Multiple NAT networks are not supported
  20. Настройка сети NAT Set up a NAT network
  21. Обзор NAT NAT Overview
  22. Создание виртуальной сети NAT Create a NAT virtual network
  23. Соединение с виртуальной машиной Connect a virtual machine
  24. Пример конфигурации. Подключение виртуальных машин и контейнеров к сети NAT Configuration Example: Attaching VMs and Containers to a NAT network
  25. Docker для Windows (для виртуальных машин Linux) и компонент контейнеров Windows Docker for Windows (Linux VM) and Windows Containers
  26. Несколько приложений, использующих одну систему NAT Multiple Applications using the same NAT
  27. Диагностика Troubleshooting
  28. Несколько сетей NAT не поддерживается. Multiple NAT networks are not supported
  29. Ссылки References

Как изменить тип NAT со строгого на открытый — Вокруг-Дом — 2021

Table of Contents:

Трансляция сетевых адресов, или NAT, позволяет одному IP-адресу служить идентифицирующим адресом для нескольких компьютеров и устройств в локальной сети. В случаях, когда вам нужно настроить сервер, вам нужно установить тип NAT как «открытый», чтобы обеспечить возможность подключения к различным портам и от них. Еще одна распространенная причина открыть свой тип NAT — это онлайн-игра на игровых приставках, таких как PS3 или Xbox 360. Когда для NAT установлен строгий режим, вы не сможете вести игру, использовать голосовой чат или в некоторых случаях играть. совсем. Если у вас есть услуга интернет-телефонии, возможно, вы не сможете совершать или принимать звонки со строгим NAT.

Шаг 1

Введите «cmd» (без кавычек) в поле поиска Windows. Выберите командную строку, чтобы открыть командное окно.

Шаг 2

Введите «ipconfig / all» (без кавычек) и нажмите «Enter», чтобы выполнить команду.

Шаг 3

Просматривайте список имен, пока не увидите «Шлюз по умолчанию» или «Шлюз IPV4» и запишите числа, следующие за этими именами. Числа будут выглядеть как «192.168.0.0».

Шаг 4

Откройте Internet Explorer, введите IP-адрес шлюза в адресной строке и нажмите «Enter», чтобы открыть страницу конфигурации маршрутизатора.

Шаг 5

Введите пароль вашего роутера. Если вы не знаете пароль, вам может потребоваться связаться с производителем. Однако для многих устройств пароль по умолчанию — «admin».

Шаг 6

Нажмите на ссылку «Администрирование» на вашем роутере. Измените настройку «UPnP» с «Отключено» на «Включено».

Шаг 7

Нажмите кнопку «Сохранить настройки» или «Сохранить изменения» внизу страницы. Выйдите из инструмента настройки маршрутизатора.

OPEN NAT как правильно настроить ПК, консоль (ps4, XboxOne) роутер чтобы получать хоста и побеждать (Апрель 2021).


  • Set up a NAT network

    Windows 10 Hyper-V allows native network address translation (NAT) for a virtual network.

    This guide will walk you through:

    • creating a NAT network
    • connecting an existing virtual machine to your new network
    • confirming that the virtual machine is connected correctly
    • Windows 10 Anniversary Update or later
    • Hyper-V is enabled (instructions here)

    Note: Currently, you are limited to one NAT network per host. For additional details on the Windows NAT (WinNAT) implementation, capabilities, and limitations, please reference the WinNAT capabilities and limitations blog

    NAT Overview

    NAT gives a virtual machine access to network resources using the host computer’s IP address and a port through an internal Hyper-V Virtual Switch.

    Network Address Translation (NAT) is a networking mode designed to conserve IP addresses by mapping an external IP address and port to a much larger set of internal IP addresses. Basically, a NAT uses a flow table to route traffic from an external (host) IP Address and port number to the correct internal IP address associated with an endpoint on the network (virtual machine, computer, container, etc.)

    Additionally, NAT allows multiple virtual machines to host applications that require identical (internal) communication ports by mapping these to unique external ports.

    For all of these reasons, NAT networking is very common for container technology (see Container Networking).

    Create a NAT virtual network

    Let’s walk through setting up a new NAT network.

    Open a PowerShell console as Administrator.

    Create an internal switch.

    Find the interface index of the virtual switch you just created.

    You can find the interface index by running Get-NetAdapter

    Your output should look something like this:

    The internal switch will have a name like vEthernet (SwitchName) and an Interface Description of Hyper-V Virtual Ethernet Adapter . Take note of its ifIndex to use in the next step.

    Configure the NAT gateway using New-NetIPAddress.

    Here is the generic command:

    In order to configure the gateway, you’ll need a bit of information about your network:

    IPAddress — NAT Gateway IP specifies the IPv4 or IPv6 address to use as the NAT gateway IP.
    The generic form will be a.b.c.1 (e.g. 172.16.0.1). While the final position doesn’t have to be .1, it usually is (based on prefix length)

    A common gateway IP is 192.168.0.1

    PrefixLength — NAT Subnet Prefix Length defines the NAT local subnet size (subnet mask). The subnet prefix length will be an integer value between 0 and 32.

    0 would map the entire internet, 32 would only allow one mapped IP. Common values range from 24 to 12 depending on how many IPs need to be attached to the NAT.

    A common PrefixLength is 24 — this is a subnet mask of 255.255.255.0

    InterfaceIndex — ifIndex is the interface index of the virtual switch, which you determined in the previous step.

    Run the following to create the NAT Gateway:

    Configure the NAT network using New-NetNat.

    Here is the generic command:

    In order to configure the gateway, you’ll need to provide information about the network and NAT Gateway:

    Name — NATOutsideName describes the name of the NAT network. You’ll use this to remove the NAT network.

    InternalIPInterfaceAddressPrefix — NAT subnet prefix describes both the NAT Gateway IP prefix from above as well as the NAT Subnet Prefix Length from above.

    The generic form will be a.b.c.0/NAT Subnet Prefix Length

    From the above, for this example, we’ll use 192.168.0.0/24

    For our example, run the following to setup the NAT network:

    Congratulations! You now have a virtual NAT network! To add a virtual machine, to the NAT network follow these instructions.

    Connect a virtual machine

    To connect a virtual machine to your new NAT network, connect the internal switch you created in the first step of the NAT Network Setup section to your virtual machine using the VM Settings menu.

    Since WinNAT by itself does not allocate and assign IP addresses to an endpoint (e.g. VM), you will need to do this manually from within the VM itself — i.e. set IP address within range of NAT internal prefix, set default gateway IP address, set DNS server information. The only caveat to this is when the endpoint is attached to a container. In this case, the Host Network Service (HNS) allocates and uses the Host Compute Service (HCS) to assign the IP address, gateway IP, and DNS info to the container directly.

    Configuration Example: Attaching VMs and Containers to a NAT network

    If you need to attach multiple VMs and containers to a single NAT, you will need to ensure that the NAT internal subnet prefix is large enough to encompass the IP ranges being assigned by different applications or services (e.g. Docker for Windows and Windows Container – HNS). This will require either application-level assignment of IPs and network configuration or manual configuration which must be done by an admin and guaranteed not to re-use existing IP assignments on the same host.

    Docker for Windows (Linux VM) and Windows Containers

    The solution below will allow both Docker for Windows (Linux VM running Linux containers) and Windows Containers to share the same WinNAT instance using separate internal vSwitches. Connectivity between both Linux and Windows containers will work.

    Читайте также:  Все драйвера для windows 10 offline

    User has connected VMs to a NAT network through an internal vSwitch named “VMNAT” and now wants to install Windows Container feature with docker engine

    Docker/HNS will assign IPs to Windows containers and Admin will assign IPs to VMs from the difference set of the two.

    User has installed Windows Container feature with docker engine running and now wants to connect VMs to the NAT network

    Docker/HNS will assign IPs to Windows containers and Admin will assign IPs to VMs from the difference set of the two.

    In the end, you should have two internal VM switches and one NetNat shared between them.

    Multiple Applications using the same NAT

    Some scenarios require multiple applications or services to use the same NAT. In this case, the following workflow must be followed so that multiple applications / services can use a larger NAT internal subnet prefix

    We will detail the Docker 4 Windows — Docker Beta — Linux VM co-existing with the Windows Container feature on the same host as an example. This workflow is subject to change

    C:> net stop docker

    Stop Docker4Windows MobyLinux VM

    PS C:> Get-ContainerNetwork | Remove-ContainerNetwork -force

    PS C:> Get-NetNat | Remove-NetNat
    Removes any previously existing container networks (i.e. deletes vSwitch, deletes NetNat, cleans up)

    New-ContainerNetwork -Name nat -Mode NAT –subnetprefix 10.0.76.0/24 (this subnet will be used for Windows containers feature) Creates internal vSwitch named nat
    Creates NAT network named “nat” with IP prefix 10.0.76.0/24

    Remove-NetNAT
    Removes both DockerNAT and nat NAT networks (keeps internal vSwitches)

    New-NetNat -Name DockerNAT -InternalIPInterfaceAddressPrefix 10.0.0.0/17 (this will create a larger NAT network for both D4W and containers to share)
    Creates NAT network named DockerNAT with larger prefix 10.0.0.0/17

    Run Docker4Windows (MobyLinux.ps1)
    Creates internal vSwitch DockerNAT
    Creates NAT network named “DockerNAT” with IP prefix 10.0.75.0/24

    Net start docker
    Docker will use the user-defined NAT network as the default to connect Windows containers

    In the end, you should have two internal vSwitches – one named DockerNAT and the other named nat. You will only have one NAT network (10.0.0.0/17) confirmed by running Get-NetNat. IP addresses for Windows containers will be assigned by the Windows Host Network Service (HNS) from the 10.0.76.0/24 subnet. Based on the existing MobyLinux.ps1 script, IP addresses for Docker 4 Windows will be assigned from the 10.0.75.0/24 subnet.

    Troubleshooting

    Multiple NAT networks are not supported

    This guide assumes that there are no other NATs on the host. However, applications or services will require the use of a NAT and may create one as part of setup. Since Windows (WinNAT) only supports one internal NAT subnet prefix, trying to create multiple NATs will place the system into an unknown state.

    To see if this may be the problem, make sure you only have one NAT:

    If a NAT already exists, delete it

    Make sure you only have one “internal” vmSwitch for the application or feature (e.g. Windows containers). Record the name of the vSwitch

    Check to see if there are private IP addresses (e.g. NAT default Gateway IP Address – usually x.y.z.1) from the old NAT still assigned to an adapter

    If an old private IP address is in use, please delete it

    Removing Multiple NATs
    We have seen reports of multiple NAT networks created inadvertently. This is due to a bug in recent builds (including Windows Server 2016 Technical Preview 5 and Windows 10 Insider Preview builds). If you see multiple NAT networks, after running docker network ls or Get-ContainerNetwork, please perform the following from an elevated PowerShell:

    Reboot the operating system prior executing the subsequent commands ( Restart-Computer )

    See this setup guide for multiple applications using the same NAT to rebuild your NAT environment, if necessary.

    Настройка сети NAT Set up a NAT network

    Windows 10 Hyper-V разрешает использовать для виртуальной сети собственное преобразование сетевых адресов (NAT). Windows 10 Hyper-V allows native network address translation (NAT) for a virtual network.

    В этом руководство рассматриваются следующие темы: This guide will walk you through:

    • Создание сети NAT creating a NAT network
    • Подключение существующей виртуальной машины к новой сети connecting an existing virtual machine to your new network
    • Проверка правильности подключения виртуальной машины confirming that the virtual machine is connected correctly
    • Юбилейное обновление Windows 10 или более поздняя версия Windows 10 Anniversary Update or later
    • Hyper-V включен (инструкции см. здесь) Hyper-V is enabled (instructions here)

    Примечание. Сейчас можно создать только одну сеть NAT для узла. Note: Currently, you are limited to one NAT network per host. Дополнительные сведения о реализации, возможностях и ограничениях NAT для Windows (WinNAT) см. в блоге, посвященном возможностям и ограничениям WinNAT. For additional details on the Windows NAT (WinNAT) implementation, capabilities, and limitations, please reference the WinNAT capabilities and limitations blog

    Обзор NAT NAT Overview

    NAT предоставляет виртуальной машине доступ к сетевым ресурсам с помощью IP-адреса и порта главного компьютера через внутренний виртуальный коммутатор Hyper-V. NAT gives a virtual machine access to network resources using the host computer’s IP address and a port through an internal Hyper-V Virtual Switch.

    Преобразования сетевых адресов (NAT) — это сетевой режим, предназначенный для экономии IP-адресов за счет сопоставления внешнего IP-адреса и порта с гораздо большим набором внутренних IP-адресов. Network Address Translation (NAT) is a networking mode designed to conserve IP addresses by mapping an external IP address and port to a much larger set of internal IP addresses. По сути, NAT использует таблицу потоков для маршрутизации трафика с внешнего IP-адреса (адреса узла) и номера порта на правильный внутренний IP-адрес, связанный с конечной точкой в сети (виртуальной машиной, компьютером, контейнером и т. д.). Basically, a NAT uses a flow table to route traffic from an external (host) IP Address and port number to the correct internal IP address associated with an endpoint on the network (virtual machine, computer, container, etc.)

    Кроме того, NAT позволяет нескольким виртуальным машинам размещать приложения, которым требуются одинаковые (внутренние) порты связи, сопоставляя их с уникальными внешними портами. Additionally, NAT allows multiple virtual machines to host applications that require identical (internal) communication ports by mapping these to unique external ports.

    По всем этим причинам NAT часто применяется в технологии контейнеров (см. статью Сетевые подключения контейнеров). For all of these reasons, NAT networking is very common for container technology (see Container Networking).

    Создание виртуальной сети NAT Create a NAT virtual network

    Давайте рассмотрим настройку новой сети NAT. Let’s walk through setting up a new NAT network.

    Читайте также:  Быстрое переключение между рабочими столами linux

    Откройте консоль PowerShell от имени администратора. Open a PowerShell console as Administrator.

    Создайте внутренний коммутатор. Create an internal switch.

    Найдите индекс интерфейса созданного виртуального коммутатора. Find the interface index of the virtual switch you just created.

    Этот индекс интерфейса можно определить, выполнив команду Get-NetAdapter You can find the interface index by running Get-NetAdapter

    Выходные данные должны иметь следующий вид: Your output should look something like this:

    Внутренний коммутатор будет иметь такое имя, как vEthernet (SwitchName) , и описание интерфейса Hyper-V Virtual Ethernet Adapter . The internal switch will have a name like vEthernet (SwitchName) and an Interface Description of Hyper-V Virtual Ethernet Adapter . Запишите его ifIndex для использования на следующем шаге. Take note of its ifIndex to use in the next step.

    Настройте шлюз NAT с помощью New-NetIPAddress. Configure the NAT gateway using New-NetIPAddress.

    Ниже приведена общая команда: Here is the generic command:

    Чтобы настроить шлюз, вам потребуется некоторая информация о сети: In order to configure the gateway, you’ll need a bit of information about your network:

    IPAddress — «NAT Gateway IP» задает IP-адрес шлюза NAT в формате IPv4 или IPv6. IPAddress — NAT Gateway IP specifies the IPv4 or IPv6 address to use as the NAT gateway IP.
    Общая форма имеет вид a.b.c.1 (например, 172.16.0.1). The generic form will be a.b.c.1 (e.g. 172.16.0.1). Хотя последняя позиция необязательно должна быть равна 1, обычно используется именно это значение (в зависимости от длины префикса). While the final position doesn’t have to be .1, it usually is (based on prefix length)

    Общий IP-адрес шлюза имеет значение 192.168.0.1. A common gateway IP is 192.168.0.1

    PrefixLength — «NAT Subnet Prefix Length» определяет размер локальной подсети NAT (маску подсети). PrefixLength — NAT Subnet Prefix Length defines the NAT local subnet size (subnet mask). Длина префикса подсети является целым числом от 0 до 32. The subnet prefix length will be an integer value between 0 and 32.

    Значение 0 соответствует всему Интернету, а значение 32 — всего одному IP-адресу. 0 would map the entire internet, 32 would only allow one mapped IP. Обычно используются значения в диапазоне от 24 до 12 в зависимости от того, сколько IP-адресов необходимо подключить к NAT. Common values range from 24 to 12 depending on how many IPs need to be attached to the NAT.

    Общее значение PrefixLength равно 24. Это маска подсети 255.255.255.0. A common PrefixLength is 24 — this is a subnet mask of 255.255.255.0

    InterfaceIndex: ifIndex — это индекс интерфейса виртуального коммутатора, который вы определили на предыдущем шаге. InterfaceIndex — ifIndex is the interface index of the virtual switch, which you determined in the previous step.

    Выполните следующую команду, чтобы создать шлюз NAT: Run the following to create the NAT Gateway:

    Настройте сеть NAT с помощью New-NetNat. Configure the NAT network using New-NetNat.

    Ниже приведена общая команда: Here is the generic command:

    Чтобы настроить шлюз, потребуется указать информацию о сети и шлюзе NAT: In order to configure the gateway, you’ll need to provide information about the network and NAT Gateway:

    Name — NATOutsideName описывает имя сети NAT. Name — NATOutsideName describes the name of the NAT network. Оно используется для удаления сети NAT. You’ll use this to remove the NAT network.

    InternalIPInterfaceAddressPrefix — «NAT subnet prefix» задает описанные ранее префикс IP-адреса шлюза NAT и длину префикса подсети NAT. InternalIPInterfaceAddressPrefix — NAT subnet prefix describes both the NAT Gateway IP prefix from above as well as the NAT Subnet Prefix Length from above.

    Общая форма имеет вид a.b.c.0/NAT Subnet Prefix Length. The generic form will be a.b.c.0/NAT Subnet Prefix Length

    Учитывая приведенные выше данные, для этого примера мы используем 192.168.0.0/24. From the above, for this example, we’ll use 192.168.0.0/24

    В рамках данного примера выполните следующую команду для настройки сети NAT: For our example, run the following to setup the NAT network:

    Поздравляем! Congratulations! Теперь у вас есть виртуальная сеть NAT. You now have a virtual NAT network! Чтобы добавить виртуальную машину в сеть NAT, выполните эти инструкции. To add a virtual machine, to the NAT network follow these instructions.

    Соединение с виртуальной машиной Connect a virtual machine

    Чтобы подключить виртуальную машину к новой сети NAT, подключите внутренний коммутатор, созданный на первом шаге в разделе Настройка сети NAT, к виртуальной машине с помощью меню параметров виртуальной машины. To connect a virtual machine to your new NAT network, connect the internal switch you created in the first step of the NAT Network Setup section to your virtual machine using the VM Settings menu.

    Так как служба WinNAT сама по себе не выделяет и не назначает IP-адреса конечным точкам (например, виртуальной машины), вам потребуется сделать это вручную в виртуальной машине, т. е. задать IP-адреса в диапазоне внутреннего префикса NAT, задать IP-адрес шлюза по умолчанию, указать данные DNS-сервера. Since WinNAT by itself does not allocate and assign IP addresses to an endpoint (e.g. VM), you will need to do this manually from within the VM itself — i.e. set IP address within range of NAT internal prefix, set default gateway IP address, set DNS server information. Единственной оговоркой является наличие подключения конечной точки к контейнеру. The only caveat to this is when the endpoint is attached to a container. В этом случае служба HNS выделяет и использует службу HCS для назначения IP-адреса, IP-адреса шлюза и сведений о DNS непосредственно контейнеру. In this case, the Host Network Service (HNS) allocates and uses the Host Compute Service (HCS) to assign the IP address, gateway IP, and DNS info to the container directly.

    Пример конфигурации. Подключение виртуальных машин и контейнеров к сети NAT Configuration Example: Attaching VMs and Containers to a NAT network

    Чтобы подключить несколько виртуальных машин и контейнеров к одной сети NAT, необходимо убедиться, что внутренний префикс подсети NAT имеет размер, достаточный для охвата диапазонов IP-адресов, назначенных различными приложениями или службами (например, Docker для Windows и компонент контейнеров Windows — HNS). Для этого потребуется назначить IP-адреса на уровне приложения, а также выполнить сетевую настройку или настройку вручную силами администратора, исключив повторное использование существующих назначений IP-адресов в том же узле. If you need to attach multiple VMs and containers to a single NAT, you will need to ensure that the NAT internal subnet prefix is large enough to encompass the IP ranges being assigned by different applications or services (e.g. Docker for Windows and Windows Container – HNS). This will require either application-level assignment of IPs and network configuration or manual configuration which must be done by an admin and guaranteed not to re-use existing IP assignments on the same host.

    Docker для Windows (для виртуальных машин Linux) и компонент контейнеров Windows Docker for Windows (Linux VM) and Windows Containers

    Приведенное ниже решение позволит Docker для Windows (виртуальным машинам Linux с контейнерами Linux) и компоненту контейнеров Windows совместно использовать общий экземпляр WinNAT с помощью отдельных внутренних коммутаторов vSwitch. The solution below will allow both Docker for Windows (Linux VM running Linux containers) and Windows Containers to share the same WinNAT instance using separate internal vSwitches. Будет работать подключение между контейнерами Linux и Windows. Connectivity between both Linux and Windows containers will work.

    Пользователь подключил виртуальные машины к сети NAT через внутренний коммутатор vSwitch с именем VMNAT и теперь хочет установить компонент «Контейнеры Windows» с подсистемой Dосker. User has connected VMs to a NAT network through an internal vSwitch named “VMNAT” and now wants to install Windows Container feature with docker engine

    Читайте также:  Linux show all files by size

    Docker или HNS назначит IP-адреса контейнерам Windows, а администратор назначит IP-адреса виртуальным машинам из разностного набора. Docker/HNS will assign IPs to Windows containers and Admin will assign IPs to VMs from the difference set of the two.

    Пользователь установил компонент «Контейнеры Windows» с работающей подсистемой Docker и хочет подключить виртуальные машины к сети NAT. User has installed Windows Container feature with docker engine running and now wants to connect VMs to the NAT network

    Docker или HNS назначит IP-адреса контейнерам Windows, а администратор назначит IP-адреса виртуальным машинам из разностного набора. Docker/HNS will assign IPs to Windows containers and Admin will assign IPs to VMs from the difference set of the two.

    В итоге вы должны получить два внутренних коммутатора виртуальных машин и один общий для них коммутатор NetNat. In the end, you should have two internal VM switches and one NetNat shared between them.

    Несколько приложений, использующих одну систему NAT Multiple Applications using the same NAT

    В некоторых сценариях требуется, чтобы несколько приложений или служб использовали одну систему NAT. Some scenarios require multiple applications or services to use the same NAT. В этом случае необходимо придерживаться описанной ниже процедуры, чтобы несколько приложений или служб могли использовать больший внутренний префикс подсети NAT. In this case, the following workflow must be followed so that multiple applications / services can use a larger NAT internal subnet prefix

    В качестве примера мы рассмотрим сосуществование Docker 4 Windows — Docker Beta — Linux VM и компонента контейнеров Windows на одном узле. Эта процедура может быть изменена. We will detail the Docker 4 Windows — Docker Beta — Linux VM co-existing with the Windows Container feature on the same host as an example. This workflow is subject to change

    C:> net stop docker C:> net stop docker

    Stop Docker4Windows MobyLinux VM Stop Docker4Windows MobyLinux VM

    PS C:> Get-ContainerNetwork | Remove-ContainerNetwork -force. PS C:> Get-ContainerNetwork | Remove-ContainerNetwork -force

    PS C:> Get-NetNat | Remove-NetNat. PS C:> Get-NetNat | Remove-NetNat
    Позволяет удалить все ранее существовавшие сети контейнера (т. е. удаляется vSwitch, NetNat и выполняется очистка). Removes any previously existing container networks (i.e. deletes vSwitch, deletes NetNat, cleans up)

    New-ContainerNetwork -Name nat -Mode NAT –subnetprefix 10.0.76.0/24 (эта подсеть используется для компонента контейнеров Windows) Создает внутренний vSwitch с именем nat. New-ContainerNetwork -Name nat -Mode NAT –subnetprefix 10.0.76.0/24 (this subnet will be used for Windows containers feature) Creates internal vSwitch named nat
    Позволяет создать сеть NAT с именем «nat» и префиксом IP-адреса 10.0.76.0/24. Creates NAT network named “nat” with IP prefix 10.0.76.0/24

    Remove-NetNAT Remove-NetNAT
    Позволяет удалить сети NAT с именами nat и DockerNAT (сохраняя внутренние коммутаторы Vswitch). Removes both DockerNAT and nat NAT networks (keeps internal vSwitches)

    New-NetNat -Name DockerNAT -InternalIPInterfaceAddressPrefix 10.0.0.0/17 (создает более крупную сеть NAT для совместного использования D4W и контейнерами) New-NetNat -Name DockerNAT -InternalIPInterfaceAddressPrefix 10.0.0.0/17 (this will create a larger NAT network for both D4W and containers to share)
    Позволяет создать сеть NAT с именем DockerNAT и увеличенным префиксом 10.0.0.0/17. Creates NAT network named DockerNAT with larger prefix 10.0.0.0/17

    Run Docker4Windows (MobyLinux.ps1) Run Docker4Windows (MobyLinux.ps1)
    Позволяет создать внутренний vSwitch DockerNAT. Creates internal vSwitch DockerNAT
    Позволяет создать сеть NAT с именем DockerNAT и префиксом 10.0.75.0/24. Creates NAT network named “DockerNAT” with IP prefix 10.0.75.0/24

    Net start docker Net start docker
    Docker использует пользовательскую сеть NAT по умолчанию для подключения к контейнерам Windows. Docker will use the user-defined NAT network as the default to connect Windows containers

    В конце вы должны получить два внутренних коммутатора vSwitch — один с именем DockerNAT, другой с именем nat. In the end, you should have two internal vSwitches – one named DockerNAT and the other named nat. При выполнении Get-NetNat выводится только одна подтвержденная сеть NAT (10.0.0.0/17). You will only have one NAT network (10.0.0.0/17) confirmed by running Get-NetNat. IP-адреса для контейнеров Windows назначаются сетевой службой узлов Windows (HNS) (HNS) из подсети 10.0.76.0/24. IP addresses for Windows containers will be assigned by the Windows Host Network Service (HNS) from the 10.0.76.0/24 subnet. В соответствии с имеющимся сценарием MobyLinux.ps1 IP-адреса для Docker 4 Windows назначаются из подсети 10.0.75.0/24. Based on the existing MobyLinux.ps1 script, IP addresses for Docker 4 Windows will be assigned from the 10.0.75.0/24 subnet.

    Диагностика Troubleshooting

    Несколько сетей NAT не поддерживается. Multiple NAT networks are not supported

    В этом руководстве предполагается, что других NAT на узле нет. This guide assumes that there are no other NATs on the host. Приложениям или службам необходимо использовать NAT, и они могут создать ее в процессе установки. However, applications or services will require the use of a NAT and may create one as part of setup. Поскольку Windows (WinNAT) поддерживает только один внутренний префикс подсети NAT, при попытке создать несколько NAT система переходит в неизвестное состояние. Since Windows (WinNAT) only supports one internal NAT subnet prefix, trying to create multiple NATs will place the system into an unknown state.

    Чтобы понять, является ли это проблемой, убедитесь, что имеется только одна NAT. To see if this may be the problem, make sure you only have one NAT:

    Если NAT уже существует, удалите ее. If a NAT already exists, delete it

    Убедитесь, что для приложения или компонента (например, для контейнеров Windows) имеется всего один «внутренний» vmSwitch. Make sure you only have one “internal” vmSwitch for the application or feature (e.g. Windows containers). Запишите имя vSwitch. Record the name of the vSwitch

    Проверьте, есть ли частные IP-адреса (например, IP-адрес шлюза NAT по умолчанию обычно имеет значение x.y.z.1) старого NAT, по-прежнему назначенные адаптеру. Check to see if there are private IP addresses (e.g. NAT default Gateway IP Address – usually x.y.z.1) from the old NAT still assigned to an adapter

    Если используется старый частный IP-адрес, удалите его. If an old private IP address is in use, please delete it

    Удаление нескольких NAT Removing Multiple NATs
    Мы встречали сообщения о нескольких случайно созданных сетях NAT. We have seen reports of multiple NAT networks created inadvertently. Это вызвано ошибкой, присутствующей в последних сборках (включая Windows Server 2016 Technical Preview 5 и Windows 10 Insider Preview). This is due to a bug in recent builds (including Windows Server 2016 Technical Preview 5 and Windows 10 Insider Preview builds). Если после запуска команд ls или Get-ContainerNetwork сети Docker появится несколько сетей NAT, в командной строке PowerShell с повышенными привилегиями выполните следующее: If you see multiple NAT networks, after running docker network ls or Get-ContainerNetwork, please perform the following from an elevated PowerShell:

    Перезагрузите операционную систему перед выполнением последующих команд ( Restart-Computer ) Reboot the operating system prior executing the subsequent commands ( Restart-Computer )

    При необходимости обратитесь к этому руководству по установке для нескольких приложений, использующих одну NAT для перестройки среды NAT. See this setup guide for multiple applications using the same NAT to rebuild your NAT environment, if necessary.

    Ссылки References

    Дополнительные сведения о сетях NAT Read more about NAT networks

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