Network knowledge popularization: What is the knowledge under dual NICs, what is the knowledge about route tables and gateways?

Source: Internet
Author: User

Important:

As a developer, it is beneficial to deal with the Internet all day and learn some basic network knowledge.UpgradePersonal professional skills.

In addition, this article only introduces the network knowledge, and has nothing to do with fan wall. Please refer to the above for details. The following is the body content.

 

May 1 is coming soon:

It was originally intended to release CYQ. Data V5 or write some technical articles about CYQ. Data,

Later I thought about it, and I don't want to tangle with everyone about professional and technical issues.

Today, I wrote a draft article that has been archived for many years and told everyone something untechnical.

 

If you have two NICs, one local Nic and one wireless Nic, and both of them are getting online, do you know which Nic does you use to access the Internet?

If you have a local network card and have pulled the VPN to the server, and both of them are getting online, then you know which network card you use to access the Internet?

 

I don't know. Let's take a look at the following content, which involves the route table and gateway, to explain the general knowledge for your instance:

 

-------------------------------------Invincible Separator---------------------------------

Simulate dual-NIC:

 

To learn how the dual network adapter, route table, and gateway are going, it is best to have a dual network adapter environment. For this reason, a simple VPN is used to simulate it.

 

VPN basics:

In a private network, the port number can be pulled to the specified server and connected to the specified server in a LAN. After the port number is pulled, a gateway is added, which is equal to a dual gateway.

 

What are the necessary VPN conditions?

You have to go to an internet cafe when pulling the number. How do you get online? This still needs to go out through the "local route Gateway". Therefore, the IP address of the dial-up must first ensure that the local network card can access the Internet.

 

How many gateways do I use after the VPN number is successfully pulled?

When you use a VPN, it means that you have two NICs, one is local and the other is remote. In this case, two gateways are generated, and you can only select one.

 

What is a gateway?

A lot of technical staff may not have the concept yet. Cut a picture for everyone:

Let's see the "Default Gateway". Simply put, it is the IP address of the router. Just like all your requests, they will all go out of the router. This router is common sense, so everyone knows it.

 

What is dual Gateway?

A: The dual gateway is a default gateway for each of the two NICs. In addition, there are two "default gateways". Simply put, there are two routers. 

 

Which one is on the internet?

A: Normally, the gateway of the backend network will be in the front, so it is usually accessed through the network card that follows.

 

Similarly, we can see the following two actual scenarios:

 

Scenario 1: VPN is used to connect to the local area. The network where the VPN is located cannot be connected to the Internet.

Because VPN is post-drawn, all requests will go out of the VPN gateway, and the local network will become invalid.

If the remote VPN Server cannot access the Internet, there will be consequences of failing to access the network after the VPN is unplugged.

For the solution, see: how to solve the problem that the local network cannot access the Internet after the Vpn is pulled

This situation applies to: VPN is only intended to use the LAN function, rather than surfing through the VPN gateway.

 

Case 2: The key point is that the VPN network can be connected to the Internet.

In solution 1, the gateway with the unsigned and unsigned is the default gateway, so that the network goes out locally. However, sometimes you still want to use the second gateway to allocate resources reasonably.

 

I have some ideas about dual gateway. Can I allocate resources reasonably?

At this time, I have another requirement. Can I specify some requests to go through the VPN, and some other requests to go through the local Gateway?

For example, Q is used to view videos using VPN and browse webpages using local resources, so as to rationally allocate resources? How can this problem be solved?

 

How can we narrow down the distance between ideas and methods?

 

If you have any idea, you can find Google:

 

The following is the process of finding a great God for your reference only:

 

1: Search Keyword:

Keyword 1: "vpn qq web pages go through different gateways ";

Keyword 2: "route table ";

Keyword 3: "qq server address"
Keyword 4: "route table interface"

 

2: The URL is as follows:

Arrangement of VPN connection and simultaneous Internet access problems: http://community.kingdee.com/pages/lzgyl/blog/archive/2008/08/27/316165.aspx

The problem of connecting VPN to the Internet at the same time: http://bbs.winos.cn/thread-80456-1-1.html

VPN and route table: http://www.storyday.com/html/y2011/2843_vpn_route_tables.html

How to view the login QQ Server IP Address: http://www.iwebs.cn/space.php? Uid = 2 & do = blog & id = 209.

How to read route table: http://www.net130.com/2004/6-4/12539.html

Reading route print route tables: http://www.xker.com/page/e2009/0319/70236.html

 

Idea to method, zero distance

 

Solution:

1: Disable the gateway settings of the default VPN. The default setting is local.

, Do not check, the steps shown in the figure, see the article: how to solve the problem of local network disconnection failure after Vpn dial-up

 

2: Know the gateway of two NICs

Doscommand print route table: route print

The second is 10.2.0.31 under the Gateway.

 

3: Add a specified IP address, which is the IP address of the QQ or video, and let it go through the 10.2.0.31 gateway.

1: First, find the same IP address as the server on QQ or video station, as mentioned above.

2: Add a route table:

Route add 121.14.78.0 mask 255.255.255.0 10.2.0.31
Route add 119.147.18.0 mask 255.255.255.0 10.2.0.31
Route add 121.14.75.0 mask 255.255.255.0 10.2.0.31
Route add 219.133.49.0 mask limit 255.255.0 10.2.0.31
Route add 220.250.64.0 mask 255.255.255.0 10.2.0.31
Route add 112.90.140.0 mask 255.255.255.0 10.2.0.31
Route add 58.61.165.0 mask limit 255.0 10.2.0.31
Route add 119.147.18.0 mask 255.255.255.0 10.2.0.31
Route add 112.95.240.0 mask 255.255.255.0 10.2.0.31
Route add 121.14.96.0 mask limit 255.0 10.2.0.31

After each disconnection, You have to copy one by one to cmd for execution, which is a bit tangled. Fortunately, you can use only three of them.

 

4: You can assign different IP addresses to Other gateways by specifying the route table to allocate network resources.

 

Summary:

 

This article involves a lot of network knowledge. If you don't have any idea, try again.

 

Readers can try: experience the gateway allocation of dual NICs in the local Nic and wireless network card to make reasonable use of network resources.

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.