Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Static IP connects to the public network in NAT mode in centos

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

When using the linux virtual machine, the yum command is usually used to install the software, but this command requires downloading the software from the external network, and downloading the jar package with maven also requires the external network. Virtual machines can ping each other in the internal network, but ping can not be connected to the external network, so through experiments, we finally found a solution:

1. In the cmd command line of the physical machine, use the ipconfig command to view the IP configuration. As can be seen from the figure, the subnet IP of the physical machine is 192.168.0.0, the subnet mask is 255.255.255.0, and the gateway is 192.168.0.1.

C:\ Users\ huanongying > ipconfig

two。 Close the virtual machine where IP will be configured, then click Edit-> Virtual Network Editor in the VMware main panel

3. Select NAT mode, and set the subnet IP and subnet mask to be consistent with the physical machine. Refer to the values obtained in step 1.

4. Click the NAT settings, set the gateway to the same value as the physical machine, click OK to save the configuration and go back to the virtual network editor panel. Click apply to take effect in steps 3 and 4 (it is best to click on the application, it is because there is no application at the beginning, so you can't get on the network), and finally click to exit the virtual network editor.

5. Find the VMnet8 network card in the network connection of the physical machine, and configure the IP address, subnet mask and preferred DNS (you cannot connect to the external network without DNS). The network segment of IP is consistent with the physical host is 192.168.0, the host segment is 1, the subnet mask is the same as the physical machine, and DNS

Can be configured to be the same as the gateway of the physical machine

6. Start the virtual machine and configure the static IP. Except for the host segment of the IP address, what I configure here is 131. the other configurations are consistent with the physical host.

7. Restart the network card, ping Baidu to try, through, you can surf the Internet

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report