Set the gateway under CMD

Source: Internet
Author: User

Author:Innfen

This was unfortunately lost during the last Database Import. Today, when the injection attack happened, the database machine did not set up a gateway, so add one first, if the problem persists, you can directly access the internet. If the ip address of the gateway is unknown, you have to write a batch for detection.

FOR/L % I in (255, 100) do ping 192.168.1.% I-n 1-w> c: ping.txt

Then, the results of ping.txt are written and tested by one server.
For/l % p in (1,1, 254) do @ ping 192.168.1.% p-n 1 | find "reply from"/I> c: ping.txt

The above command can separately sort out the machines that can be pinged.
The command to modify the gateway is as follows:
Cmd/c netsh interface ip set address name = "Local Connection" source = static addr = 192.168.1.100 mask = 255.255.255.0 gateway = 192.168.1.1 gwmetric = 1

Modify DNS
Cmd/c netsh interface ip set dns name = "Local Connection" source = static addr = 61.134.1.9

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.