BigData-Notes/notes/installation/虚拟机静态IP配置.md
2019-03-22 13:31:05 +08:00

39 lines
739 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 虚拟机静态IP配置
> 虚拟机环境centos 7.6
### 1. 查看当前网卡名称
本机网卡名称为`enp0s3`
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/en0s3.png"/> </div>
### 2. 编辑网络配置文件
```shell
# vim /etc/sysconfig/network-scripts/ifcfg-enp0s3
```
添加如下网络配置指明静态IP和DNS
```shell
BOOTPROTO=static
IPADDR=192.168.200.226
NETMASK=255.255.255.0
GATEWAY=192.168.200.254
DNS1=114.114.114.114
```
修改后完整配置如下:
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/ifconfig.png"/> </div>
### 3. 重启网络服务
```shell
# systemctl restart network
```