typora/note/linux/centos/固定ip.md

20 lines
276 B
Markdown
Raw Permalink Normal View History

2024-12-11 21:48:55 -05:00
### 1. 备份网卡配置文件
```bash
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /temp/ifcfg-eth0.bak
```
### 2. 修改网卡配置文件
```shell
BOOTPROTO="static"
ONBOOT="yes"
IPADDR=172.29.208.1
NETMASK=255.255.240.0
GATEWAY=172.29.208.0
DNS1=172.29.208.0
```