This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3145|Reply: 1

Alibaba Cloud replaces the private network (virtual switch) network is unreachable

[Copy link]
Posted on 3/20/2024 10:24:13 PM | | | |
After using the Alibaba Cloud control panel to replace the ECS instance with a private network and virtual switch, you cannot log back in to the server using SSH.



Operating system: CentOS 7.4 64-bit

Cause of the issue: When you run the ip route command, you find that the default routing configuration starting with default is missing. (IP protocol packets transmitted over the network need to be routed to determine the destination of their next hop.) If no matching route entry can be found in the routing table, it is impossible to determine where the packet should be traveled, reflecting that the destination address is unreachable. )



Temporary solution

Add default routes without modifying the network card configuration and restarting network services, howeverIt will not work after shutdown or restart, the command is as follows:

Permanent solution

Edit the main NIC configuration file, modify the /etc/sysconfig/network-scripts/ifcfg-eth0 file, and set the static IP address as follows:

After the modification is completed, use the following command to restart the network service:


Finally, consulting Alibaba Cloud engineers may be due to system dhclient version issues (because I have another server on another system, there is no problem after changing the private network, and the network card automatically obtains the IP address).

Run the following command to obtain the MAC address of the NIC of the instance.
curlhttp://100.100.100.200/latest/meta-data/network/interfaces/macs/
Run the following command to obtain the private IP address of the NIC.
curlhttp://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_Address]/primary-ip-address
Run the following command to obtain the mask address of the NIC.
curlhttp://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_Address]/netmask
Run the following command to obtain the gateway for the NIC
curlhttp://100.100.100.200/latest/meta-data/network/interfaces/macs/[$MAC_Address]/gateway



Reference:
The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.





Previous:.NET Core gets the unique identity of the assembly
Next:Relational database design: a popular understanding of the three paradigms
 Landlord| Posted on 3/20/2024 10:27:08 PM |
Alibaba Cloud ECS and Lightweight Cloud Server interoperate with the regional intranet
https://www.itsvse.com/thread-10680-1-1.html

Reserve the IP address CIDR block of the IPv4 private network
https://www.itsvse.com/thread-10679-1-1.html

CIDR: Read the CIDR address description in one article
https://www.itsvse.com/thread-10676-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com