当前位置:网站首页>How to restore the default route for Tencent cloud single network card machine
How to restore the default route for Tencent cloud single network card machine
2022-06-24 03:51:00 【shawyang】
perform ipconfig /all Take a look at the default gateway , I'll use it later
perform route print -4, Network card found , It's usually Tencent VirtIO Ethernet Adapter, Leftmost ... The number in front is the network card number to be used later
below cmd In code %gwip%、%idx1% It's the gateway IP And network card number , Mass replacement %gwip%、%idx1% After the specific value found above , Open console VNC stay cmd The command line is executed
route delete 10.0.0.0/8 2>nul 1>nul
route -p add 10.0.0.0/8 %gwip% IF %idx1% 2>nul 1>nul
route delete 100.64.0.0/10 2>nul 1>nul
route -p add 100.64.0.0/10 %gwip% IF %idx1% 2>nul 1>nul
route delete 172.16.0.0/12 2>nul 1>nul
route -p add 172.16.0.0/12 %gwip% IF %idx1% 2>nul 1>nul
route delete 192.168.0.0/16 2>nul 1>nul
route -p add 192.168.0.0/16 %gwip% IF %idx1% 2>nul 1>nul
route delete 169.254.0.0/16 2>nul 1>nul
route -p add 169.254.0.0/16 %gwip% IF %idx1% 2>nul 1>nul
route delete 183.60.83.19 2>nul 1>nul
route delete 183.60.82.98 2>nul 1>nul
route -p add 183.60.83.19 %gwip% IF %idx1% 2>nul 1>nul
route -p add 183.60.82.98 %gwip% IF %idx1% 2>nul 1>nul
route delete 255.255.255.255 2>nul 1>nul
route -p add 255.255.255.255 %gwip% IF %idx1% 2>nul 1>nul
route delete 0.0.0.0/0 2>nul 1>nul
route -p add 0.0.0.0/0 %gwip% IF %idx1% 2>nul 1>nul
If it is some special intranet IP, such as 9 Lead 、11 Lead ……, All in all , No 172 and 192 The first , Open console VNC stay powershell Execute the following code
If the former 2 There is a problem in the execution of the sentence, and the correct value is not obtained , There is a problem with the subsequent batch replacement , To make sure that there is no risk , It is recommended to check the gateway manually IP And network card number , Then execute after batch replacement
$gw=(Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'").DHCPServe
$idx=(Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'").InterfaceIndex
route delete 10.0.0.0 mask 255.0.0.0 2>$null
route add -p 10.0.0.0 mask 255.0.0.0 $gw metric 1 IF $idx 2>$null
route delete 172.16.0.0 mask 255.240.0.0 2>$null
route add -p 172.16.0.0 mask 255.240.0.0 $gw metric 1 IF $idx 2>$null
route delete 192.168.0.0 mask 255.255.0.0 2>$null
route add -p 192.168.0.0 mask 255.255.0.0 $gw metric 1 IF $idx 2>$null
route delete 100.64.0.0 mask 255.192.0.0 2>$null
route add -p 100.64.0.0 mask 255.192.0.0 $gw metric 1 IF $idx 2>$null
route delete 9.0.0.0 mask 255.0.0.0 2>$null
route add -p 9.0.0.0 mask 255.0.0.0 $gw metric 1 IF $idx 2>$null
route delete 11.0.0.0 mask 255.0.0.0 2>$null
route add -p 11.0.0.0 mask 255.0.0.0 $gw metric 1 IF $idx 2>$null
route delete 30.0.0.0 mask 255.0.0.0 2>$null
route add -p 30.0.0.0 mask 255.0.0.0 $gw metric 1 IF $idx 2>$null
route delete 0.0.0.0 mask 0.0.0.0 2>$null
route add -p 0.0.0.0 mask 0.0.0.0 $gw metric 1 IF $idx 2>$null
边栏推荐
- Tell you about mvcc
- Clickhouse optimize table comprehensive analysis
- Why install code signing certificate to scan and eliminate virus software from security
- Modstartcms enterprise content site building system (supporting laravel9) v4.2.0
- Brief ideas and simple cases of JVM tuning - how to tune
- How the new operator works
- Flutter series: offstage in flutter
- The importance of the computer room to the stable operation of the server
- The quick login of QQ cannot be directly invoked through remote login, and the automatic login of QQ can be invoked using VNC
- Web penetration test - 5. Brute force cracking vulnerability - (1) SSH password cracking
猜你喜欢

在pycharm中pytorch的安装
![[numpy] numpy's judgment on Nan value](/img/aa/dc75a86bbb9f5a235b1baf5f3495ff.png)
[numpy] numpy's judgment on Nan value

Brief ideas and simple cases of JVM tuning - how to tune

Koom of memory leak

Black hat SEO actual combat search engine snapshot hijacking

Ar 3D map technology

Do you understand TLS protocol?

Clickhouse (02) Clickhouse architecture design introduction overview and Clickhouse data slicing design

SQL注入绕过安全狗思路一

An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!
随机推荐
ClickHouse Buffer
Grpc: how to add API log interceptors / Middleware?
web rdp Myrtille
Mocktio usage (Part 2)
How do websites use CDN? What are the benefits of using it?
A Tencent interview question
一次 MySQL 误操作导致的事故,「高可用」都顶不住了!
Received status code 502 from server: Bad Gateway
Dialogue with Google technical experts: soundstream is expected to be used for general audio coding in the future
Some basic knowledge of data center server cabinet
web渗透测试----5、暴力破解漏洞--(7)MYSQL密码破解
Do you understand TLS protocol?
Prometheus pushgateway
NLP task summary introduction and understanding
黑帽SEO实战之通用301权重pr劫持
An open source monitoring data collector that can monitor everything
Browser rendering mechanism
Black hat SEO practice: General 301 weight PR hijacking
618 promotion: mobile phone brand "immortal fight", high-end market "who dominates the ups and downs"?
ModStartCMS 主题入门开发教程