Files
linux-wiki/content/小白手册/疑难解答/更改ip地址.md
2021-10-21 14:57:58 +08:00

38 lines
859 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
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地址
```bash
cd /etc/sysconfig/network-scripts/
vi ifcfg-***
```
注意ifcfg打头的文件可能有多个建议逐个排查
以我的为例我的叫ifcfg-eno16780032打开后是以下内容
```bash
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eno16780032"
UUID="71d75a18-06fc-4fbd-be98-d76ddb1a7cde"
DEVICE="eno16780032"
ONBOOT="yes"
IPADDR="192.168.51.199"
PREFIX="24"
GATEWAY="192.168.51.254"
DNS1="119.29.29.29"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_PRIVACY="no"
```
按“a”编写按“esc”完成编写
编写完成后按“:” 如果保存就用“w”代表write如果不保存就按“q!"强制退出q代表quit代表强制