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

Beginners to configure IP and restart the network for Linux in the virtual machine

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Friends who have just come into contact with the virtual machine, or have just installed linux in the virtual machine, need to configure the IP address themselves because the system is installed in the virtual machine.

Configure this IP address in several steps:

Step 1: open your virtual machine, open linux, and log in using your root account.

As shown in the picture, I am using the CentOS7.2 system. Click to log in, enter the interface of typing instructions, and enter vi / etc/sysconfig/network-scripts/ifcfg-eth0 (each computer behind the eth is different, you can press the tab key to complete it. )

Follow the above instructions to enter the interface for configuring IP, as shown in the figure

Since I have already configured it, I will have three more fields than you (IPADDR,GATEWAY,NETMASK).

Press the I key to enter insert mode

Set BOOTTPROTO to static

Set ONBOOT to yes

Join the IPADDR (static IP) instance 192.168.2.200 GATEWAY (gateway) 192.168.2.1 NETMASK (subnet mask) 255.255.255.0

When you are finished, press shift+ Q, type: wq, save and exit.

Then go back to your virtual machine interface, click Edit in the virtual machine, select the virtual network editor, add a network and select host-only mode. Then modify the subnet IP of the network you just added to 192.168.2.0 (in my example), the first three bits should be the same as your IP address.

As shown in the figure

Click OK after completing the above steps, and then right-click your virtual machine, select Settings, and modify your network adapter for the network you just created.

As shown in the figure

Enter service network restart to restart the network service after exiting

Then you can use Xshell or Xftp to connect to your server. If the connection is successful, it means that your IP address has been successfully configured and you can connect.

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