Viewpoint: helps you quickly understand static route tables

Source: Internet
Author: User

For general route users, it is very important to understand the static route table. We can solve some common problems in a timely manner. Our school has the following network environment. The 450 nodes in the school are divided into five subnets, and the network numbers of each subnet are 19216810 ~ 19216850, all gateways are 19216811. Each subnet accesses the R2600 egress router through the Huawei S2026B L2 Switch, And the egress accesses Interne through the optical fiber at a bandwidth of Mbps.

The county now sets up an electronic government affairs network, requiring the computer of leading cadres at or above the county departments to be able to directly access the county e-government affairs network server 192168206/24. The county e-government affairs network office assigned our school a subnet number of 101260, the mask is 255255255192, the gateway is 101261, and the e-government network cannot access the Internet. The county e-government network server is hosted by the Telecommunications Bureau, so the Telecommunications Bureau opened a 10 Mbps optical fiber connection to our school. The advice of the Telecommunications Bureau is to install two NICs for the computer that our school needs to directly access the e-government network, and set up two network gateways respectively to access the e-government network and Ineternet at the same time.

Manually add static routes

The above network needs are actually to solve the problem of accessing different targets in the two subnets of 19216800 and 101260. As the office building of our school has embedded the network cables connecting various offices to the network center into the wall during construction, if you install a network adapter for each computer that needs to directly access the county e-government network, you need to separately lay a network cable, regardless of the difficulty of laying and the layout of the office space, this is not a good solution. If you use the network cable of the original campus network and set two gateways on the computer that needs to connect to the E-Government network, you need to manually switch the gateways, this is also a major cause. We decided not to adopt the recommendations of the Telecommunications Board, but to manually add static route tables to achieve seamless switching between the two gateways.

1. Connect the optical fiber connected to the E-Government Network to the original S2006B switch.

2. Add an IP address with a network condition of 101260 to the computer that needs to access the e-government network, for example, 101262, with a mask of 255255255192. The procedure is as follows: Select "Internet protocol TCP/IP) properties → advanced → ipsettings → Add ". Note that the 101261 gateway cannot be added after an IP address is added. For details, see the further analysis in the following section.

3. Enter the doscommand mode and enter: ip route add 192168200 mask 2552552550 101261 after the prompt is met, so as to manually add a static route.

4. To enable the command to be automatically executed at startup, you can write it into a batch processing file because the method for creating a batch processing file is relatively simple and will not be mentioned here.

After the above four steps, you can use the route print command in the command line mode to view a new static route table of the local static route table to the 192168200 network, in this case, the local computer can access both the Internet and the e-government network, and the user cannot feel the gateway switching process during use. From the above introduction, we can see that this method has two highlights:

One is that the same switch can connect to different networks. In normal use, the general fixed thinking is that a switch can only connect to the same network. In fact, we can know from the principle of the switch that this way of thinking is incorrect, because the switch is in the data link layer of the OSI reference model and belongs to the bridge. The switch acts as a bridge, because some switches can access multiple different networks. The above scheme is using this point, thus eliminating unnecessary hardware investment.

The second is to use a static route instead of a 101260 gateway. So why cannot I set two gateways? This starts from the role of the Gateway. When setting the Gateway, a default route is added to the route table of the local computer.

00000000 gateway IP address local interface hops if the path of the target network cannot be found in the static route table, the packet is sent to the Gateway in this default route. If the gateway corresponding to the local machine is deleted, the default route will also be deleted in the route table. If two IP addresses are set on the local machine and the sub-table corresponds to the two gateways, two default routes are added to the static routing table on the local machine, when the local machine sends data, it does not know how to handle it. However, manually adding a static route is different from directly setting the Gateway access route path, data will be transmitted according to the path specified in the static routing table in the file issuance process. With the above method, you can achieve seamless access to different networks through a single Nic.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.