Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does Centos7 configure static IP addresses?

Shulou Source: shulou.com Published: 2022-06-03 06:10:37 09月21日 Update

I. the method of configuring static IP address without using the network manager nmcli

Go to the / etc/sysconfig/network-scripts directory and find the configuration file (ifcfg-enp0s3) for the interface

Open configuration file to modify ifcfg-enp0s3BOOTPROTO and change it to static to join IPADDR, NETMASK, GATEWAY

3. Save the changes and restart the network service using the following command:

Systemctl restart network.service

4. Now verify that the interface is configured correctly:

Ip add

Network connectivity

2. The method of configuring static IP address by using network manager nmcli

1. View all connections

Nmcli connection show

two。 Configure static ip

Nmcli c modify enp0s3 ipv4.address 192.168.68.166 ipv4.gateway 192.168.68.1 ipv4.method manual

3. Restart the network service takes effect. Check ip.

Systemctl restart network.serviceip add

Tags: Configuration network static address interface file method network service network management service management command directory authentication Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB MySQL Shulou Information OPPO Reno Linux