当前位置:网站首页>When the VPC main network card has multiple intranet IP addresses, the server cannot access the network internally, but the server can be accessed externally. How to solve this problem
When the VPC main network card has multiple intranet IP addresses, the server cannot access the network internally, but the server can be accessed externally. How to solve this problem
2022-06-24 06:29:00 【shawyang】
Reprint windows many IP Specify the outlet for traffic outbound visit IP
This document really helped me solve the problem
scene :
early vpc I won't support it dhcp, Can only be manually configured with static IP, There is one like this vpc The machine has only one primary network card ( There is a primary intranet by default IP 172.19.16.114), An auxiliary intranet is added to the console manually IP 172.19.16.2, Then add static... Inside the machine IP Put this auxiliary intranet IP add , Plus before , The server traffic is normal , And after , The remote server is normal , But the server can't access the Internet
0.0.0.0/0 The default route goes to the auxiliary intranet IP 172.19.16.2, The internal network of the server cannot be accessed
screening : The firewall is closed 、IP The security policy is empty 、 The security group releases all ,netsh int ipv4 show dynamicport tcp It's normal , Nor is it banned , All in all , Other possibilities are ruled out , Find out 0.0.0.0/0 The default route goes to the auxiliary intranet IP 172.19.16.2, How to confirm that this is the reason ?
First , Auxiliary Intranet IP On the console, I am not bound to the Internet IP Of , So if you go out with it, you can't connect to the Internet
Next use ping -S $srcip $dstip It can be determined that this is the reason for
-S Specify primary Intranet IP You can go out , Specify the secondary intranet IP Couldn't go out
Next, how to solve ?
empiricism :powershell perform ( Do not execute separately , Just hit enter once in a row to execute , Only once , Execution section 2 An error will be reported if it is executed for times or times , But it doesn't matter , It doesn't affect the result )
route delete 0.0.0.0 mask 0.0.0.0 " Main network card gateway " ; route add 0.0.0.0 mask 0.0.0.0 " The intranet of the primary network card IP" ; route -p add 0.0.0.0 mask 0.0.0.0 " Main network card gateway "
perhaps
route delete 0.0.0.0/0 " Main network card gateway " ; route add 0.0.0.0/0 " The intranet of the primary network card IP" ; route -p add 0.0.0.0/0 " Main network card gateway "
for example
route delete 0.0.0.0 mask 0.0.0.0 172.19.16.1 ; route add 0.0.0.0 mask 0.0.0.0 172.19.16.114 ; route -p add 0.0.0.0 mask 0.0.0.0 172.19.16.1
or
route delete 0.0.0.0/0 172.19.16.1 ; route add 0.0.0.0/0 172.19.16.114 ; route -p add 0.0.0.0/0 172.19.16.1
After this, the machine can access the Internet , But to perform route print View routes , It is found that the default route has not changed , Or the auxiliary intranet IP 172.19.16.2
When you scratch your ears and cheeks in every way , See this document windows many IP Specify the outlet for traffic outbound visit IP
Found key parameters skipAsSource=true
Specific measures :
1、 Delete the auxiliary intranet manually IP 172.19.16.2( After deletion route print It is found that the default route has gone through the main intranet IP 了 )
2、 adopt skipassource=true Parameter add auxiliary intranet IP 172.19.16.2
netsh int ipv4 add address " Ethernet " 172.19.16.2 255.255.255.0 skipassource=true
notes : The command form is general ≥2008 System ;2012R2 The default for the Chinese version is “ Ethernet ”, If it's another name , You need to change the name in the command
3、 perform route print Check the default route or the main intranet IP That's right
边栏推荐
- Web automation test (3): Selenium basic course of web function automation test
- Excellent tech sharing | research and application of Tencent excellent map in weak surveillance target location
- Network review
- Continuously evolving cloud native application delivery
- Reasons for automatic allocation failure of crawler agent IP
- How accurate are the two common methods of domain name IP query
- How fast? Good province!
- How does easyplayer RTSP configure sending heartbeat information to the server?
- At the trusted cloud conference, Tencent securely unlocked a number of new certifications!
- What is the difference between a white box test and a black box test
猜你喜欢

Technology is a double-edged sword, which needs to be well kept

What is the difference between a white box test and a black box test

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales

解读AI机器人产业发展的顶层设计
Fault analysis | using --force to batch import data leads to partial data loss

Solution to the 39th weekly game of acwing

Manual for automatic testing and learning of anti stepping pits, one for each tester
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database
Oracle case: ohasd crash on AIX
随机推荐
Reasons for automatic allocation failure of crawler agent IP
Basic concepts of complex networks
Easyscreen live streaming component pushes RTSP streams to easydss for operation process sharing
When should I use Apache Druid
Tencent security release data security compliance capability map
5 minutes, online from 0 to 1!
The influence of TLS protocol and cipher on remote RDP
Multi objective Optimization Practice Based on esmm model -- shopping mall
Several methods for reinstalling the system:
The installation method of apache+mysql+php running environment under Windows
Operation and maintenance dry goods | how to improve the business stability and continuity through fault recovery?
How to check whether the domain name is filed? Must the domain name be filed for use?
Double non students, self-taught programming, counter attack Baidu one year after graduation!
Interpreting the new features of Appstore: Customizing product pages and a/b test tools
How to apply for a domain name? How much does it cost to apply for a domain name?
WordPress pill applet build applet from zero to one [install and configure WordPress site]
Nature Neuroscience: challenges and future directions of functional brain tissue characterization
[fault announcement] one stored procedure brings down the entire database
TensorFlow 2 quickstart for beginners
Neighbor vote: use proximity voting to optimize monocular 3D target detection (ACM mm2021)