How to modify the IP address of the Linux system in a VMware virtual machine

1. Click Edit in VMware-Virtual Network Editor
Insert picture description here

2. In the virtual network editor, select the bridge mode
Insert picture description here

3. View the network configuration file :
cd /etc/sysconfig/network-scripts

ll You can see that there are two files ifcfg-ens33 and ifcfg-lo at the top, mainly focusing on ifcfg-ens33

Insert picture description here

4. View the ip address :
ip addryou can see the name of the network card corresponding to the above, mainly focusing on the mac address and ip address
Insert picture description here

5. Modify ip address :
vim /etc/sysconfig/network-scripts/ifcfg-ens33
(Note: use the administrator to edit , or can only be read but not changed, switch administrator command: su root)

Will be BOOTPROTO="static"changed to static , so that the ip address will not be dynamically allocated, that is, it will not change

The following part, if there is, modify it, if not, add it in
IPADDR=192.168.0.244//this is the ip address given by yourself
GATEWAY=192.168.0.1//gateway, write your own
DNS1=218.104.111.114//network service provider DNS
NETMASK=255.255.255.0//subnet mask
HWADDR=00:0c:29:13:b4:c4//mac address queried above , Paste it

Insert picture description here

6. Restart the network card :
ifdown ens33
ifup ens33

Insert picture description here

7. Check the ip address again :
ip addr

You can see that the ip address has been modified to what you want (if it is still the original address, then restart the network card a few times, if it still fails, check the network configuration file)
Insert picture description here

Any questions are welcome to discuss. much love!

Guess you like

Origin blog.csdn.net/wanyanwanyan_/article/details/112919000