Connect the laptop to both the wireless Internet and the wired Intranet [zz]

Source: Internet
Author: User

Debug outsideProgram, Intranet is required for debugging programs, and to connect to the Internet, only through wireless connection. However, when a laptop wirelessly connects to the Internet, as long as the Intranet network cable is plugged in, it is found that all the QQ-type connections are offline, the Internet connection will not work, and the web page will not be opened. This is troublesome. After testing the program, you must manually unplug the network cable so that the Internet can be accessed. I feel this is too troublesome. Can I connect my laptop to the Intranet and the Internet at the same time? So I found the information on the Internet and found it. In fact, it is because of Windows default route settings. Each time windows accesses all IP addresses by default, it points to the gateway of the Ethernet or wireless network. When two or more connections are connected at the same time, such a default route will be faulty, you need to manually modify it.

You need to set it through the route command. The following is an example. Enter cmd (started as an administrator ):

For example, if you want to use both the wired network INTRANET and the wireless network Internet, you can set

Route Delete 0.0.0.0 (Delete the default route settings for all IP addresses)

Route add 0.0.0.0 mask 0.0.0.0 192.168.1.1 (Route all IP addresses to the Internet gateway IP address, which is assumed to be 192.168.1.1)

Route add 10.13.4.0 mask 255.255.255.0 10.122.2.1 (Access to a CIDR Block in the Intranet directs to the Intranet gateway address, which is assumed to be 10.122.2.1)

192.168.1.1 is a wireless network gateway and 10.122.2.1 is a wired network gateway. All access requests from all IP addresses go from 192.168.1.1. However, access from addresses starting with 10.13.4 goes from 10.122.2.1. If you want to connect to the Internet over the wired network or over the wireless network, and so on ......

In this way, you no longer need to plug or unplug the network cable to switch the network ......

Tip: the IP address and gateway address of each network interface can be obtained through the ipconfig command.

Related Article

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.