Mac VMware Fusion CentOS7 Configuration of Static IP Tutorial Diagram

Time:2019-8-15

Install CentOS 7

Here we want to install the CentOS 7 64 bit, so choose the CentOS 7 64 bit configuration.

When we click on storage, VMware will automatically create a virtual machine for us, but we haven’t added mirrors yet, so we need to shut it down first.

Set up an image for the newly created virtual machine

Here is the reason for setting up English, because English is a more international language. After setting up English, the system will have problems with English error prompts. It is easier to search for solutions through English error prompts on the Internet. It is more difficult to find solutions if mistakes are made in Chinese.

Set the time zone. The default is New York. It’s Shanghai, China.

Configure static IP

1. Change network configuration to NAT mode

Enter Vmnet8 directory of VMware Fusion through Mac terminal

cd /Library/Preferences/VMware\ Fusion/vmnet8

View nat.conf content

cat nat.conf

Keep in mind the data in the red box. The following configuration needs to be used

Check cat dhcpd.conf

cat dhcpd.conf

Note that range is the range of static IP addresses allowed by the virtual machine. Customized static IP addresses must be within this range (this article intends to use 172.16.104.130 as an example).

Get DNS (Preference Settings in Mac System – > Network – >)

Log on to CentOS7

Enter the network-scripts directory of the virtual machine

cd /etc/sysconfig/network-scripts

Find the file at the beginning of ifcfg-en. In the figure above, my file is ifcfg-ens33.

Edit the file through VI

The following figure is the default configuration

We changed it to the following configuration

After saving, restart the service to make the changes take effect

service network restart

Take a look at Baidu and Ping successfully arrives at Baidu.

Then we can connect remotely through tools such as SecureCRT. One thing to remember is that if you go online in another place, you may find that your virtual machine is not working. That’s because the DNS address has changed. At this time, you just need to edit the ifcfg-enxxx file again, and then add the DNS address of your current network. that will do

Such as:

DNS1=192.168.0.1DNS2=114.114.114.114

Let’s test it through SecureCRT connection

summary

The above is a tutorial illustration of MacVMware Fusion CentOS7 configuration static IP introduced by Editor Xiaobian. I hope it will be helpful to you. If you have any questions, please leave me a message and Editor will reply to you in time. Thank you very much for your support to developpaer.
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!