静态IP地址(又称固定IP地址)是长期分配给一台计算机或网络设备使用的 IP 地址。
Mac 设置固定 IP



Windows 设置固定 IP






CentOS 设置固定 IP
1 2
| // 修改虚拟机固定 ip vim /etc/sysconfig/network-scripts/ifcfg-ens33
|

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| TYPE="Ethernet" PROXY_METHOD="none" BROWSER_ONLY="no" BOOTPROTO="static" # dhcp 自动获取修改为 静态 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="dc48a286-077d-4d19-b6b9-b0eafe7b4899" DEVICE="ens33" ONBOOT="yes" IPADDR=192.168.0.101 # 指定的固定 ip NETMASK=255.255.255.0 # 子网掩码 GATEWAY=192.168.0.1 # 网关 DNS1=8.8.8.8 # DNS 服务器 DNS2=114.114.114.114 # DNS2 服务器
|

1 2 3 4 5 6 7 8 9 10 11
| // 重启网络 systemctl restart network.service
// 查看状态 firewall-cmd --state
// 停止防火墙 systemctl stop firewalld.service
// 禁止防火墙开机自启 systemctl disable firewalld.service
|

