题:修改本机网卡IP 为192.168.1.223/24 网关192.168.1.1 DNS 8.8.8.8。

方法1:修改本地网卡文件(需要重启网卡)

# vi /etc/sysconfig/network-scripts/ifcfg-ens32

# 使用静态IP
BOOTPROTO=static
# IP地址
IPADDR=192.168.1.233
# 子网掩码
NETMASK=255.255.255.0
# 网关
GATEWAY=192.168.1.1
# DNS
DNS1=8.8.8.8

更多详情:https://www.cnblogs.com/xiangsikai/p/8435927.html

 

方法2:图形化配置

# nmtui

修改系统地址掩码网关

 

方法3:命令行配置

# nmcli connection add con-name ‘static-ip’ ifname eth0 type Ethernet ip4 192.168.1.223/24 gw4 192.168.1.1

# nmcli connection modify static-ip ipv4.dns 8.8.8.8

# nmcli connection modify static-ip ipv4.method manual

# nmcli connection modify static-ip connection.autoconnect yes

# nmcli connection up static-ip

 

相关文章:

  • 2021-12-02
  • 2022-02-22
  • 2021-12-29
  • 2021-06-06
猜你喜欢
  • 2021-08-22
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-01-13
  • 2021-12-01
  • 2022-01-04
相关资源
相似解决方案