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

[Linux] detailed description of how to configure static IP in VMware virtual machine

2025-04-12 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to configure static IP in the VMware virtual machine is explained in detail here.

The figure above is a sketch that roughly illustrates the VMware network. Network segment refers to a certain IP range. For example, a residential building and another residential building are not a network segment.

If you are in area An and your girlfriend is in area B, if you want to contact her, you need to go through the gateway. Hello, your gay friend lives next door, so you don't need to communicate with him through the gateway. VMware

The gateway is simulated for us, so when we configure it, we need to set the network ip according to the VMware virtual machine. We configure windows and Linux in a network segment.

1. View gateways and network segments

[edit]-- "[Virtual Network Editor]

We use NAT mode, so we choose VMnet8. The option of canceling the [use local DHCP] service is not checked, this is a dynamic allocation of IP. Click NAT Settings.

The gateway IP needs to remember that from this we know that our gateway is 192.168.133.2 and the subnet mask is 255.255.255.0. The 192.168.133.0 of subnet IP means

If you want to add machines to this network segment, your machine ip can only be in the range of 192.168.133.0192.168.133.255. Actually, you will find that 192.168.133.2 is

The gateway IP, generally speaking, 192.168.133.255 is broadcast IP, so it is not used, and 192.168.133.0 is generally not used for network segment IP. That is to say, except for the three 02255, the others

You can set the number as you like.

2. Set the virtual machine IP

The list of files involved: / etc/sysconfig/network-scripts/ifcfg-eth0 (network card), / etc/sysconfig/network (hostname), / etc/resolv.conf (DNS).

Nic information modification: vi / etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT: boot up.

NM_CONTROLLED: whether the network management component is enabled or not is not available in the stripped-down version. So you don't need to open it.

BOOTPROTO: network distribution mode, static.

IPPADDR: specify the ip address manually.

NETMASK: subnet mask.

GATEWAY: gateway ip. Save and exit after editing.

DNS configuration: vi / etc/resolv.conf

Nameserver: the ip of the corresponding dns domain name resolution server should be entered here. But I don't know what to fill in, so I fill in the gateway address. You can connect things to the Internet, but

There seems to be no response to ping www.baidu.com. I don't know what's going on, because it doesn't affect my online updates, so I don't pay attention.

Hostname modification: vi / etc/sysconfig/network

Change the host name if necessary, and forget it if you don't need it. Restart the machine after configuring the above 3 files.

3. Use remote tools to connect

1. The Xshell tool is used here, and the ip address is set to the ip address entered above. In the future, he will be the ip of this machine.

2. Click OK, there will be this in the first connection, and you can do so.

3. Enter the user name. The machine you just installed has only one root user. Log in with the root user first.

4. Enter the password. I like that all users have the same password, so that you only need to fill in the user name to log in later. You need to remember the password.

5. After logging in, you can play freely.

4. Windows IP settings

1. Set up the network adapter that VMWare has configured for us, which is the NAT8. Right-click attribute

2. Select IPV4 and click Properties.

3. Set the ip address. In the future, windows will be this ip. The scope of the IP network segment needs to be within the scope given to us by the VMWare virtual machine.

5. Special hint

If you turn off the VMWare virtual machine, you will have an option to run it in the background. In this way, the virtual machine is hung in the background, and it feels like connecting to a remote machine. It's awesome!

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: 261

*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