镜像地址
阿里镜像
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11No9VDh
下载地址: https://mirrors.aliyun.com/centos/
centos中文站
https://www.centoschina.cn/downloads
设置静态ip
设置虚拟机采用NAT模式
查看虚拟机分配的ip地址和子网掩码, /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf(VMware Fusion 文件名中间有空格符号)
$cat /Library/Preferences/VMware\ Fusion/vmnet8/dhcpd.conf
allow unknown-clients;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
subnet 192.168.145.0 netmask 255.255.255.0 {
range 192.168.145.128 192.168.145.254;
option broadcast-address 192.168.145.255;
option domain-name-servers 192.168.145.2;
option domain-name localdomain;
default-lease-time 1800; # default is 30 minutes
max-lease-time 7200; # default is 2 hours
option netbios-name-servers 192.168.145.2;
option routers 192.168.145.2;
}
host vmnet8 {
hardware ethernet 00:50:56:C0:00:08;
fixed-address 192.168.145.1;
option domain-name-servers 0.0.0.0;
option domain-name "";
option routers 0.0.0.0;
}
其中 range 192.168.145.128 192.168.145.254; 这个是虚拟机允许选择的静态ip地址范围,自定义的静态ip地址必须要在这个范围内。
option routers 192.168.145.2; 是网关地址
修改centOS7中的网络配置
vi /etc/sysconfig/network-scripts/ifcfg-ens33
- BOOTPROTO=static(ip地址设置为静态的)
- IPADDR=上面mac中找到的ip范围中设置一个(在192.168.145.128 192.168.145.254之间)
- NETMASK=255.255.255.0(也是从上面得到)
- GATEWAY=设置上面mac中看到的gatway地址,即router路由地址(192.168.145.2)
- ONBOOT=yes
- DNS1=x.x.x.x
阿里云的公共DNS:https://www.alidns.com/
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=4f54be13-ef5b-4252-b39c-ddb19c632b0a
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.145.130
NETMASK=255.255.255.0
GATEWAY=192.168.145.2
DNS1=223.5.5.5
DNS2=8.8.8.8
重启网络
systemctl restart network.service
[
](https://www.oschina.net/sharing-plan/apply)