Windows routing default gateway

Default gateway route doesn’t appear in the Routing Table after you re-add a Routing and Remote Access interface

This article provides a solution to an issue where default gateway route doesn’t appear in the Routing Table.

Original product version: В Windows 10 — all editions
Original KB number: В 816905

Symptoms

When you add a network interface to a remote access server in the Routing and Remote Access utility, a default route for that interface may not appear in the routing table.

Cause

This issue may occur if both of the following conditions are true:

  • You remove a network interface from the remote access server.
  • You re-add that network interface to the remote access server.

To work around this issue, use one of the following methods.

Workaround 1: Manually add the default route for the Interface

Use the Route Add command to manually add the default route for the network interface that you added.

Click Start, click Run, type cmd in the Open box, and then click OK.

Type route print, and then press ENTER to view the routing table. Note the interface number of the network interface that you re-added.

Type the following command, and then press ENTER route add 0.0.0.0 mask 0.0.0.0 gateway IP metric 30 if Interface number
where gateway IP is the IP address of the default gateway for this interface, and where Interface number is the number that corresponds to the network interface that you added (for example, 2). For example, if your default gateway IP address is 192.168.1.1 and the interface number is 2, type the following command, and then press ENTER:

Type route print to verify that the new default route appears in the routing table.

Close the command prompt.

Workaround 2: Restart the remote access service

Restart the remote access service. The default route for the re-added network interface is added to the Windows routing table.

  1. Start the Routing and Remote Access utility.
  2. Under Routing and Remote Access, right-click the server where you re-added the network interface, point to All Tasks, and then click Restart.

Workaround 3: Restart the server

Restart the remote access server. The default route for the re-added network interface is added to the Windows routing table.

Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

route route

Область применения: Windows Server (половина ежегодного канала), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Отображает и изменяет записи в локальной таблице маршрутизации IP. Displays and modifies the entries in the local IP routing table. Если используется без параметров, команда Route выводит справку из командной строки. If used without parameters, route displays help at the command prompt.

Эта команда доступна, только если протокол Internet Protocol (TCP/IP) установлен в качестве компонента в свойствах сетевого адаптера в окне Сетевые подключения. This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.

Синтаксис Syntax

Параметры Parameters

Параметр Parameter Описание Description
/f /f Очищает таблицу маршрутизации всех записей, не являющихся маршрутами узла (маршруты с сетевой маской 255.255.255.255), маршрутом сети замыкания на себя (маршруты с назначением 127.0.0.0 и сетевой маской 255.0.0.0) или маршрутом многоадресной рассылки (маршруты с назначением 224.0.0.0 и сетевой маской 240.0.0.0). Clears the routing table of all entries that are not host routes (routes with a netmask of 255.255.255.255), the loopback network route (routes with a destination of 127.0.0.0 and a netmask of 255.0.0.0), or a multicast route (routes with a destination of 224.0.0.0 and a netmask of 240.0.0.0). Если используется в сочетании с одной из команд (например, Add, Change или DELETE), таблица удаляется перед выполнением команды. If this is used in conjunction with one of the commands (such as add, change, or delete), the table is cleared prior to running the command.
/p /p При использовании с командой Add указанный маршрут добавляется в реестр и используется для инициализации таблицы IP-маршрутизации при каждом запуске протокола TCP/IP. When used with the add command, the specified route is added to the registry and is used to initialize the IP routing table whenever the TCP/IP protocol is started. По умолчанию при запуске протокола TCP/IP добавленные маршруты не сохраняются. By default, added routes are not preserved when the TCP/IP protocol is started. При использовании с командой print отображается список постоянных маршрутов. When used with the print command, the list of persistent routes is displayed. Этот параметр игнорируется для всех остальных команд. This parameter is ignored for all other commands. Постоянные маршруты хранятся в папке реестра HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes. Persistent routes are stored in the registry location HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\PersistentRoutes.
Указывает команду, которую требуется выполнить. Specifies the command you want to run. К допустимым командам относятся: The valid commands include:
  • Добавить — добавляет маршрут. add — Adds a route.
  • Change — изменяет существующий маршрут. change — Modifies an existing route.
  • Удалить: — удаляет маршрут или маршруты. delete: — Deletes a route or routes.
  • Печать — печать маршрута или маршрутов. print — Prints a route or routes.
Указывает сетевой адрес маршрута. Specifies the network destination of the route. Назначением может быть IP-адрес сети (где биты узла сетевого адреса имеют значение 0), IP-адрес для маршрута узла или 0.0.0.0 для маршрута по умолчанию. The destination can be an IP network address (where the host bits of the network address are set to 0), an IP address for a host route, or 0.0.0.0 for the default route.
виде mask Указывает сетевой адрес маршрута. Specifies the network destination of the route. Назначением может быть IP-адрес сети (где биты узла сетевого адреса имеют значение 0), IP-адрес для маршрута узла или 0.0.0.0 для маршрута по умолчанию. The destination can be an IP network address (where the host bits of the network address are set to 0), an IP address for a host route, or 0.0.0.0 for the default route.
Указывает IP-адрес перенаправления или следующего прыжка, по которому можно получить набор адресов, определяемых назначением сети и маской подсети. Specifies the forwarding or next hop IP address over which the set of addresses defined by the network destination and subnet mask are reachable. Для локально подключенных маршрутов подсети адрес шлюза — это IP-адрес, назначенный интерфейсу, подключенному к подсети. For locally attached subnet routes, the gateway address is the IP address assigned to the interface that is attached to the subnet. Для удаленных маршрутов, доступных на одном или нескольких маршрутизаторах, адрес шлюза представляет собой напрямую достижимый IP-адрес, назначенный соседнему маршрутизатору. For remote routes, available across one or more routers, the gateway address is a directly reachable IP address that is assigned to a neighboring router.
шкал metric Указывает целочисленную метрику стоимости (от 1 до 9999) для маршрута, который используется при выборе нескольких маршрутов в таблице маршрутизации, наиболее точно соответствующих адресу назначения перенаправляемого пакета. Specifies an integer cost metric (ranging from 1 to 9999) for the route, which is used when choosing among multiple routes in the routing table that most closely match the destination address of a packet being forwarded. Выбирается маршрут с наименьшей метрикой. The route with the lowest metric is chosen. Метрика может отражать число прыжков, скорость пути, надежность пути, пропускную способность пути или административные свойства. The metric can reflect the number of hops, the speed of the path, path reliability, path throughput, or administrative properties.
наличии if Указывает индекс интерфейса для интерфейса, для которого целевой объект доступен. Specifies the interface index for the interface over which the destination is reachable. Чтобы получить список интерфейсов и их соответствующих индексов интерфейсов, используйте отображение команды route print. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. Для индекса интерфейса можно использовать либо десятичное, либо шестнадцатеричное значение. You can use either decimal or hexadecimal values for the interface index. Для шестнадцатеричных значений перед шестнадцатеричным числом следует указать 0x. For hexadecimal values, precede the hexadecimal number with 0x. Если параметр if опущен, интерфейс определяется по адресу шлюза. When the if parameter is omitted, the interface is determined from the gateway address.
/? /? Отображение справки в командной строке. Displays help at the command prompt.

Комментарии Remarks

Большие значения в столбце метрик таблицы маршрутизации являются результатом того, что TCP/IP автоматически определяет метрику маршрутов в таблице маршрутизации на основе конфигурации IP-адреса, маски подсети и шлюза по умолчанию для каждого интерфейса локальной сети. Large values in the metric column of the routing table are the result of allowing TCP/IP to automatically determine the metric for routes in the routing table based on the configuration of IP address, subnet mask, and default gateway for each LAN interface. Автоматическое определение метрики интерфейса, включенное по умолчанию, определяет скорость каждого интерфейса и корректирует метрики маршрутов для каждого интерфейса, чтобы самый быстрый интерфейс создавал маршруты с наименьшей метрикой. Automatic determination of the interface metric, enabled by default, determines the speed of each interface and adjusts the metrics of routes for each interface so that the fastest interface creates the routes with the lowest metric. Чтобы удалить большие метрики, отключите автоматическое определение метрики интерфейса из дополнительных свойств протокола TCP/IP для каждого подключения к локальной сети. To remove the large metrics, disable the automatic determination of the interface metric from the advanced properties of the TCP/IP protocol for each LAN connection.

Имена могут использоваться для назначения , если в файле локальных сетей , хранящемся в папке, есть соответствующая запись systemroot\System32\Drivers\\ . Names can be used for destination if an appropriate entry exists in the local Networks file stored in the systemroot\System32\Drivers\\ folder. Имена могут использоваться для шлюза при условии, что они могут быть разрешены по IP-адресу с помощью стандартных методов разрешения имен узлов, таких как запросы службы доменных имен (DNS), использование локального файла Hosts, хранящегося в systemroot\system32\drivers\\ папке, и разрешение имен NetBIOS. Names can be used for the gateway as long as they can be resolved to an IP address through standard host name resolution techniques such as Domain Name System (DNS) queries, use of the local Hosts file stored in the systemroot\system32\drivers\\ folder, and NetBIOS name resolution.

Если команда печатается или удаляется, параметр шлюза можно опустить, а для назначения и шлюза можно использовать подстановочные знаки. if the command is print or delete, the gateway parameter can be omitted and wildcards can be used for the destination and gateway. Конечным значением может быть подстановочное значение, заданное звездочкой (*) . The destination value can be a wildcard value specified by an asterisk (*) . Если указанное назначение содержит звездочку или вопросительный (*) знак (?), оно рассматривается как подстановочный знак и печатается или удаляется только в соответствующих маршрутах назначения. If the destination specified contains an asterisk (*) or a question mark (?), it’s treated as a wildcard and only matching destination routes are printed or deleted. Звездочка соответствует любой строке, а вопросительный знак соответствует любому отдельному символу. The asterisk matches any string, and the question mark matches any single character. Например,, 10.\*.1, 192.168.\* 127.\* и \*224\* являются допустимыми символами-шаблонами звездочки. For example, 10.\*.1, 192.168.\* , 127.\* , and \*224\* are all valid uses of the asterisk wildcard.

При использовании неподдерживаемого сочетания назначения и маски подсети (маска) отображается сообщение об ошибке «маршрут: неправильная Маска адреса шлюза». Using an unsupported combination of a destination and subnet mask (netmask) value displays a «Route: bad gateway address netmask» error message. Это сообщение об ошибке появляется, если назначение содержит одну или несколько битов, равных 1 в битах, где соответствующий бит маски подсети имеет значение 0. This error message appears when the destination contains one or more bits set to 1 in bit locations where the corresponding subnet mask bit is set to 0. Чтобы протестировать это условие, выразит назначение и маску подсети с помощью двоичной нотации. To test this condition, express the destination and subnet mask using binary notation. Маска подсети в двоичной нотации состоит из последовательности из 1 бит, представляющей часть сетевого адреса назначения, и серии из 0 бит, представляющих часть адреса узла назначения. The subnet mask in binary notation consists of a series of 1 bits, representing the network address portion of the destination, and a series of 0 bits, representing the host address portion of the destination. Установите флажок, чтобы определить наличие в назначении битов, для которых задано значение 1, для части назначения, которая является адресом узла (как определено маской подсети). Check to determine whether there are bits in the destination that are set to 1 for the portion of the destination that is the host address (as defined by the subnet mask).

Примеры Examples

Чтобы отобразить все содержимое таблицы IP-маршрутизации, введите: To display the entire contents of the IP routing table, type:

Чтобы отобразить маршруты в таблице IP-маршрутизации, начинающейся с 10, введите: To display the routes in the IP routing table that begin with 10, type:

Чтобы добавить маршрут по умолчанию с адресом шлюза по умолчанию 192.168.12.1, введите: To add a default route with the default gateway address of 192.168.12.1, type:

Чтобы добавить маршрут к целевому 10.41.0.0 с маской подсети 255.255.0.0 и адресом следующего прыжка 10.27.0.1, введите: To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:

Чтобы добавить постоянный маршрут к целевому 10.41.0.0 с маской подсети 255.255.0.0 и адресом следующего прыжка 10.27.0.1, введите: To add a persistent route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:

Чтобы добавить маршрут к целевому 10.41.0.0 с маской подсети 255.255.0.0, адрес следующего прыжка 10.27.0.1 и метрику стоимости 7, введите: To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and the cost metric of 7, type:

Чтобы добавить маршрут к целевому 10.41.0.0 с маской подсети 255.255.0.0, адрес следующего прыжка 10.27.0.1, а также используя интерфейс 0x3 индекса, введите: To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and using the interface index 0x3, type:

Чтобы удалить маршрут к целевому 10.41.0.0 с маской подсети 255.255.0.0, введите: To delete the route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, type:

Чтобы удалить все маршруты в таблице IP-маршрутизации, начинающейся с 10, введите: To delete all routes in the IP routing table that begin with 10, type:

Чтобы изменить адрес следующего прыжка маршрута с назначением 10.41.0.0 и маской подсети 255.255.0.0 с 10.27.0.1 на 10.27.0.25, введите: To change the next hop address of the route with the destination of 10.41.0.0 and the subnet mask of 255.255.0.0 from 10.27.0.1 to 10.27.0.25, type:

Читайте также:  Windows store connection problems
Оцените статью