Useful Tips

How to enable ip routing?

Pin
Send
Share
Send
Send


Hello. How to enable IP routing in Windows to connect to the Internet?

IP routing is a necessary tool for organizing access to the Internet. Initially, the routing of TCP / IP packets in the Windows operating system between network adapters is disabled. It must be enabled.

To do this, click the "Start" button to bring up the main menu and go to the "Run" line there. Enter regedit 32 in the input field to load the registry editor.

Then you need to go to the "HKEY_LOCAL_MACHINE" section, then select "SYSTEM", then "CurrentControlSet", then "Services", there "Tcpip" and finally "Parameters", where you need to make changes. The parameter that must be changed is called IPEnableRouter, the value must be set to "1", the data type REG _ DWORD. This is necessary to enable TCP / IP packet routing of all network connections.

It is necessary to select the “General” section, and then right-click on the “General” field to call the context menu where to select “Properties”.

Then you can select the checkbox next to "Keep only error logs", which is necessary to keep a log of various errors that are possible with ip routing.

You can set the switch to the “Log errors and warnings” position to expand the error fixing parameters.

If you stop opposite the "Log all events", then the log of all ip-routing events will be kept.

Checking the box next to "Disable event log" will completely cancel the recording of what is happening.

You can also select your preferred preferences for using data from various routes using the “Preference Levels” tab.

The most reliable is the local route.

Using the buttons "Lower level" and "Increase level" will allow you to change the settings of preference levels for other routes.

You can then specify the multicast areas that are served by the router on the Multicast Scopes tab. Why use the "Add" button and the "Change" button to configure this parameter.

After that, you need to return to the "General" and again call up the service menu, for which you need to right-click on the "General" field and add a new interface.

To add a new interface, select “New interface”, and then set the desired interface for routing. Then click on “OK”.

You must select the "New routing protocol" in the service menu that was used previously in order to add a new protocol. In the proposed list, the desired protocol is selected, then the selection is confirmed by clicking “OK”.

Then you need to return to the "General" and select the desired device in the list, which is located on the right side of the window. Call the interface menu again by right-clicking on the interface field, and then the “Properties” submenu.

Checking the box next to “Enable IP routing manager” will allow routing to run through this interface.

You can also use the settings options on the Multicast Pulse tab and the Multicast Boundaries tab of the Properties window.

It is important to remember that changing the values ​​of the system registry may entail a complete inoperability of the system and the need to reinstall the operating system.

It is recommended that you use the Network and Dial-Up Networking window to change the TCP / IP protocol settings of the network board.

Instruction manual

Data Type: REG_DWORD

to enable TCP / IP packet routing for all network connections.

  • Select the "General" section and open the context menu with a right-click on the "General" field and select "Properties".
  • Check the box for "Only log errors" to fix the various errors that may occur during IP routing.
  • Check the box for "Log errors and warnings" to expand the commit parameters.
  • Check the box next to "Log all events" to fully display all IP routing events.
  • Check the "Disable event log" check box to undo what is happening.
  • Select your preferred preferences for using information from various route sources on the Preferences Levels tab.

    The most reliable is the local route.

    Use the “Level Up” and “Level Down” buttons to change preference level settings for other routes. Set the multicast areas served by the router on the Multicast Scopes tab.

    Use the “Add” and “Change” buttons to modify this parameter.

  • Return to the "General" branch and call up the service menu with the right mouse button on the "General" field to add a new interface.
  • Select "New Interface" and select the desired interface for routing.

    Click OK to execute the command. Select “New Routing Protocol” in the same service menu to add a new protocol.

    Specify the desired protocol in the window list and click OK to apply the command.

  • Return to the "General" branch and select the required device in the list on the right side of the window. Call the service menu with the right mouse button on the interface field and select the "Properties" item.
  • Check the box next to “Enable IP routing manager” to enable routing through the selected interface.
  • Use the desired configuration options on the Multicast Boundaries and Multicast Pulse tabs of the Properties window. Tip added August 25, 2011 Tip 2: How to remove routing To configure modern local networks, you just need to be able to handle routers. Sometimes you have to drastically change existing settings when adding new devices.

    How to register a static route in windows using the route command line utility

    How to register a static route in windows using the route command line utility

    add windows route

    Hello everyone today, I’ll tell you how to register a static route in windows using the route command line utility and how to see the Windows routing table. The route utility displays and modifies entries in the local IP routing table. When you may need to add a windows route, you don’t need to go far for an example, the simplest thing is that you need to direct traffic to a specific local network, it is clear that the default gateway must know all the routes, but it is not always possible to do this for several reasons and may not proper network construction. By the way, if anyone is interested, I told you how to configure routes in centos, I advise you to look to broaden your horizons.

    Adding a windows route

    Adding a Windows route begins by examining the syntax of the command responsible for this, open the command line as administrator, and enter the following command:

    Running without parameters, the route command displays help.

    Route Command Line Utility

    • -f Clears the routing table from all entries that are not host routes (routes with a subnet mask of 255.255.255.255), a network loopback route (routes with an endpoint of 127.0.0.0 and a subnet mask of 255.0.0.0), or a multicast route (routes with an endpoint of 224.0.0.0 and a subnet mask of 240.0.0.0). When using this parameter together with one of the commands (such as add, change or delete), the table is cleared before the command is executed.
    • -p When using this option with the add command, the specified route is added to the registry and is used to initialize the IP routing table each time the TCP / IP protocol starts. By default, added routes are not saved when starting the TCP / IP protocol. When using a parameter with the print command, a list of permanent routes is displayed. All other commands ignore this parameter. Permanent routes are stored in the registry at HKEY_LOCAL_MACHINE SYSTEM CurrentControlSet Services Tcpip Parameters PersistentRoutes command Specifies the command to be run on the remote system. The following table provides a list of valid parameters.
    • add> Add route
    • change> Change an existing route
    • delete> Delete a route or routes
    • print> Print route or routes

    The endpoint defines the endpoint of the route. The endpoint can be a network IP address (where the bits of the node in the network address are 0), the IP address of the route to the node, or 0.0.0.0 for the default route. mask netmask Specifies the netmask (also known as subnet mask) according to the destination. The network mask can be a subnet mask corresponding to the network IP address, for example 255.255.255.255 for the route to the host or 0.0.0.0. for the default route. If this parameter is omitted, the subnet mask 255.255.255.255 is used. An endpoint cannot be more accurate than the corresponding subnet mask. In other words, the value of bit 1 in the endpoint address is not possible if the value of the corresponding bit in the subnet mask is 0. gateway Indicates the IP address of the forwarding or next hop at which the set of addresses defined by the endpoint and subnet mask is available. For locally connected subnet routes, the gateway address is the IP address assigned to the interface that is connected to the subnet. For remote routes that are accessible through one or more routers, the gateway address is the directly accessible IP address of the nearest router. metric metric Defines an integer metric of the route cost (ranging from 1 to 9999) for the route, which is used when selecting one of several routes in the routing table that most closely matches the destination address of the forwarded packet. The route with the least metric is selected. The metric reflects the number of transitions, the speed of the path, the reliability of the path, the throughput of the path and administrative tools. if interface Indicates the index of the interface through which the destination is accessible. Use the route print command to list the interfaces and their corresponding indexes. Interface index values ​​can be either decimal or hexadecimal. 0x is entered before the hexadecimal numbers. If the if parameter is omitted, the interface is determined from the gateway address. /? Displays help on the command line.

    Large values ​​in the metric column of the routing table are the result of the ability of the TCP / IP protocol to automatically determine the route metrics of the routing table based on the configuration of the IP address, subnet mask, and standard gateway for each LAN interface. Auto-detection of the interface metric, enabled by default, sets the speed of each interface and route metrics for each interface so that the fastest interface creates routes with the least metric. To remove large metrics, disable automatic detection of interface metrics in the advanced TCP / IP protocol properties for each LAN connection.

    Names can be used for the endpoint parameter if there is a corresponding entry in the Networks database file located in the system_root System32 Drivers Etc folder. Names can be specified in the gateway parameter as long as they resolve to IP addresses using standard methods for resolving hosts, such as querying the DNS service, using the local Hosts file located in the system_root system32 drivers etc folder, or NetBIOS name resolution .

    If the command is print or delete, the gateway parameter is omitted and wildcards are used to indicate the destination and the gateway. The endpoint value may be a wildcard value, which is indicated by an asterisk (*). If there is an asterisk (*) or a question mark (?) In the description of the endpoint, they are considered as substitutions, then only routes corresponding to the destination are printed or deleted. An asterisk matches any sequence of characters, and a question mark matches any one character. 10. *. 1, 192.168. *, 127. * and * 224 * are valid examples of using an asterisk as a wildcard.
    When using an invalid combination of endpoint and subnet mask (netmask) values, the following error message is displayed: “Route: Invalid gateway address subnet mask”. An error occurs when one or more bits in the endpoint address is 1, and the corresponding bits in the subnet mask are 1. To check this state, express the end point and subnet mask in binary format. The binary subnet mask consists of a sequence of single bits representing a portion of the network address of the endpoint, and a sequence of zero bits representing a portion of the address of the endpoint node. Check for single bits in the address part of the destination, which is the host address (as defined by the subnet mask).
    The -p option is supported in the route command only on Windows NT 4.0, Windows 2000, Windows Millennium Edition, and Windows XP. This parameter is not supported by the route command on Windows 95 and Windows 98.

    This command is available only if Internet Protocol (TCP / IP) is installed as a component in the properties of the network adapter in the Network Connections object.
    Examples

    Physics and logic of the inter-link routing process

    What happens at this time with your data?

    The last time we discussed what happens if you try to connect to a device from the same subnet as you are.
    By the same subnet we mean the following.
    For example, the following is configured on your computer:
    IP: 172.16.3.2
    Mask: 255.255.255.0
    GW: 172.16.3.1

    All devices whose addresses will be in the range 172.16.3.1-172.16.3.254 with the same mask as yours will be members of your subnet. What happens to the data if you send it to a device with an address in this range?
    Repeat this with some additions.
    To send data, they must be packed into an Ethernet frame, in the header of which the MAC address of the remote device must be inserted. But where to get it?
    To do this, your computer sends out a broadcast ARP request. The IP address of the destination host will be placed in the IP packet with this request as the IP address of the destination host. When encapsulated, the network card indicates the MAC address FF: FF: FF: FF: FF: FF - this means that the frame is intended for all devices. Then it goes to the nearest switch and copies are sent to all ports of our Vlan (well, except, of course, the port from which the frame was received). Recipients see that the request is broadcast and they may turn out to be the desired host, therefore, they extract data from the frame. All those devices that do not have the IP address specified in the ARP request simply ignore the request, but the real receiver will respond to it and send its original MAC address to the original sender. The sender (in this case, our computer) places the received MAC in its IP / MAC address mapping table aka ARP cache. What does the ARP cache look like on your computer right now, you can see with the command arp -a

    Then your useful data is packed into an IP packet, where the address you specified in the command / application is put as the recipient, then into the Ethernet frame, in the header of which the MAC address received by the ARP request is placed. Next, the frame is sent to the switch, which, according to its table of MAC addresses, decides which port to forward it to.

    But what happens if you try to reach the device in another vlan? An ARP request will not return anything, because broadcast L2 messages end on the router (i.e., within the broadcast L2 domain), the desired network is located behind it, and the switch will not allow frames from one vlan to another port. And for this, you need a default gateway on your computer.
    That is, if the recipient device is in your own subnet, the frame is simply sent to the port with the mac address of the final recipient. If the message is addressed to any other subnet, the frame is sent to the default gateway, therefore, the MAC address of the receiver is set to the MAC address of the router.

    We follow the course of events.

    1) The PC with the address 172.16.3.2/24 wants to send data to the computer with the address 172.16.4.5.

    He sees that the address is from a different subnet, therefore, the data should go to the default gateway. But in this case, the PC needs the MAC address of the gateway. The PC checks its ARP cache to find the match. The IP address of the gateway is the MAC address and cannot find the right one.

    2) The PC sends a broadcast ARP request to the local network. ARP request structure:
    - at the channel level, as the recipient - the broadcast address (FF: FF: FF: FF: FF: FF), as the sender - the MAC address of the interface of the device trying to find out the IP
    - on the network - actually the ARP request, it contains information about which IP and by whom it is searched.

    3) The switch to which the frame was sent sends its copies to all ports of this vlan (the one to which the original host belongs), except where it was received from.

    4) Все устройства, получив этот кадр и, видя, что он широковещательный, предполагают, что он адресован им.

    5) Распаковав кадр, все хосты, кроме маршрутизатора, видят, что в ARP-запросе не их адрес. А маршрутизатор посылает unicast’овый ARP-ответ со своим MAC-адресом.

    6) Изначальный хост получает ARP-ответ, теперь у него есть MAC-адрес шлюза. Он формирует пакет из тех данных, что ему нужно отправить на 172.16.4.5. В качестве MAC-адреса получателя ПК ставит адрес шлюза. Wherein IP-адрес получателя в пакете остаётся 172.16.4.5

    7) Кадр посылается в сеть, коммутаторы доставляют его на маршрутизатор.

    8) На маршрутизаторе, в соответствии с меткой влана, кадр принимается конкретным сабинтерфейсом. Данные канального уровня откидываются.

    9) Из заголовка IP-пакета, рутер узнаёт адрес получателя, а из своей таблицы маршрутизации видит, что тот находится в непосредственно подключенной к нему сети на определённом сабинтерфейсе (в нашем случае FE0/0.102).

    C 172.16.0.0/24 is directly connected, FastEthernet0/0.3
    C 172.16.1.0/24 is directly connected, FastEthernet0/0.2
    C 172.16.2.16/30 is directly connected, FastEthernet0/1.5
    C 172.16.3.0/24 is directly connected, FastEthernet0/0.101
    C 172.16.4.0/24 is directly connected, FastEthernet0/0.102
    C 172.16.5.0/24 is directly connected, FastEthernet0/0.103
    C 172.16.6.0/24 is directly connected, FastEthernet0/0.104

    10) The router sends an ARP request from this subinterface - it recognizes the MAC address of the recipient.

    11) Original IP packet, not changing encapsulated in new frame, wherein:

    - the gateway interface address is indicated as the source MAC address
    - IP address of the source - the address of the original host (in our case, 172.16.3.2)
    - the destination host address is indicated as the destination MAC address
    - IP address of the recipient - address of the final host (in our case 172.16.4.5)

    and is sent to the network from the FastEthernet0 / 0.102 sinterface, receiving the label of the 102nd vlan.

    12) The frame is delivered by the switches to the destination host.

    Moscow. Arbat

    msk-arbat-gw1 (config) #interface FastEthernet 0 / 1.4
    msk-arbat-gw1 (config-subif) #description Saint-Petersburg
    msk-arbat-gw1 (config-subif) #encapsulation dot1Q 4
    msk-arbat-gw1 (config-subif) #ip address 172.16.2.1 255.255.255.252

    msk-arbat-gw1 (config) #interface FastEthernet 0 / 1.5
    msk-arbat-gw1 (config-subif) #description Kemerovo
    msk-arbat-gw1 (config-subif) #encapsulation dot1Q 5
    msk-arbat-gw1 (config-subif) #ip address 172.16.2.17 255.255.255.252

    Of course, we will not build the entire network of the provider. Instead, we just put the switch, because in fact, the provider's network from our point of view will be one huge abstract switch.

    Everything is simple: we accept the trunk from the Arbat to one port by trunk and send them to the remote nodes from the other two ports. Once again we want emphasizethat all these 3 ports do not belong to one switch - they are spaced hundreds of kilometers away, between them is a complex MPLS network with a bunch of switches.

    Set up the “provider emulator”:

    Switch (config) #vlan 4
    Switch (config-vlan) #vlan 5
    Switch (config) #interface fa0 / 1
    Switch (config-if) #switchport mode trunk
    Switch (config-if) #switchport trunk allowed vlan 4-5
    Switch (config-if) #exit
    Switch (config) #int fa0 / 2
    Switch (config-if) #switchport trunk allowed vlan 4
    Switch (config-if) #int fa0 / 3
    Switch (config-if) #switchport trunk allowed vlan 5

    St. Petersburg. Vasilievsky island

    Now turn to our spb-vsl-gw1. Here we also have 2 ports, but we will solve the issue of lack of ports otherwise: add a board here. A board with two FastEthernet ports and two slots for WIC is fine.

    Let the built-in ports be for the local network, and we use the ports on the additional board for uplink and communication with Ozerki.

    Here you can see the difference in port numbering and understand their meaning.
    FastEthernet is the type of port (Ethernet, Fastethernet, GigabitEthernet, POS, Serial, or others)
    x / y / z.w = Slot / Sub-slot / Interface.Sub-interface.

    How the provider will give you the channel here - trunk or access, you decide together. As a rule, none of the options would be a problem for him.
    But we have already configured the trunk, so we accordingly configure the port on the tsiska:

    spb-vsl-gw1 (config) interface FastEthernet1 / 0.4
    spb-vsl-gw1 (config-if) description Moscow
    spb-vsl-gw1 (config-if) encapsulation dot1Q 4
    spb-vsl-gw1 (config-if) ip address 172.16.2.2 255.255.255.252

    spb-vsl-gw1 (config) #int fa0 / 0
    spb-vsl-gw1 (config-if) #description LAN
    spb-vsl-gw1 (config-if) #ip address 172.16.16.1 255.255.255.0

    We will return to Moscow. With msk-arbat-gw1 we can see the address 172.16.2.2:

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.2.2, timeout is 2 seconds:
    .
    Success rate is 100 percent (5/5), round-trip min / avg / max = 2/7/13 ms

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.16.1, timeout is 2 seconds:

    Success rate is 0 percent (0/5)

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
    C 172.16.0.0/24 is directly connected, FastEthernet0 / 0.3
    C 172.16.1.0/24 is directly connected, FastEthernet0 / 0.2
    C 172.16.2.0/30 is directly connected, FastEthernet0 / 1.4
    C 172.16.3.0/24 is directly connected, FastEthernet0 / 0.101
    C 172.16.4.0/24 is directly connected, FastEthernet0 / 0.102
    C 172.16.5.0/24 is directly connected, FastEthernet0 / 0.103
    C 172.16.6.0/24 is directly connected, FastEthernet0 / 0.104

    msk-arbat-gw1 (config) #ip route 172.16.16.0 255.255.255.0 172.16.2.2

    msk-arbat-gw1 # sh ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
    D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
    N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
    E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
    i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
    * - candidate default, U - per-user static route, o - ODR
    P - periodic downloaded static route

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 9 subnets, 2 masks
    C 172.16.0.0/24 is directly connected, FastEthernet0 / 0.3
    C 172.16.1.0/24 is directly connected, FastEthernet0 / 0.2
    C 172.16.2.0/30 is directly connected, FastEthernet0 / 1.4
    C 172.16.2.16/30 is directly connected, FastEthernet0 / 1.5
    C 172.16.3.0/24 is directly connected, FastEthernet0 / 0.101
    C 172.16.4.0/24 is directly connected, FastEthernet0 / 0.102
    C 172.16.5.0/24 is directly connected, FastEthernet0 / 0.103
    C 172.16.6.0/24 is directly connected, FastEthernet0 / 0.104
    S 172.16.16.0/24 [1/0] via 172.16.2.2

    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 172.16.16.1, timeout is 2 seconds:
    .
    Success rate is 100 percent (5/5), round-trip min / avg / max = 4/10/24 ms

    Here, it would seem to be happiness, but let's check the connection from the computer:

    What's the matter?!
    The computer knows where to send the packet to its gateway 172.16.3.1, the router also knows to the host 172.16.2.2. The packet goes there, spb-vsl-gw1 is accepted, which knows that the pinged address 172.16.16.1 belongs to it. And you need to send a packet back to the address 172.16.3.3, but it does not have a route to the network 172.16.3.0. And packets whose destination network is unknown are simply dropped - discarded.

    Gateway of last resort is not set

    172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
    C 172.16.2.0/30 is directly connected, FastEthernet1 / 0.4
    C 172.16.16.0/24 is directly connected, FastEthernet0 / 0

    But, why, you ask, from msk-arbat-gw1 until 172.16.16.1 there was a ping? What is the difference 172.16.3.1 or 172.16.3.2? Everything is simple.
    It can be seen from the routing table that the next hop is 172.16.2.2, and the address from 172.16.2.1 belongs to the interface of this router, so it is put in the header as the IP address of the sender, and not 172.16.3.1. The packet is sent to spb-vsl-gw1, it receives it, passes the data to the ping application, which generates an echo-reply. The response is encapsulated in an IP packet, where 1 appears as the recipient address

    Pin
    Send
    Share
    Send
    Send