CentOS8 Network Card Configuration File

  • 2021-07-01 08:35:22
  • OfStack

1. Introduction

Centos8 system update, the new version makes people feel comfortable. At this time, someone will configure the network card of CentOS8 system to make the system surf the Internet, and the configured network card will not take effect. Think about it and configure CentOS7. The biggest change in CentOS8 update is the network card, and then configure the network card under 1;

2. Configuration

Network card configuration file:/etc/sysconfig/network-scripts/ifcfg-ens33


[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls   # You'll see 1 Configuration files for configuring network cards 
 [root@localhost network-scripts]# vim ifcfg-ens33 # Enter the network card configuration file 

The following configuration files: red bold is modified; Add when yellow background; Bold black is the added comment.


TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPADDR=192.168.10.111
NETMASK=255.255.255.0
GATEWAY=192.168.10.1
DNS1=114.114.114.114
IPV4_FAILURE_FATAL=no
#IPV6INIT=yes
#IPV6_AUTOCONF=yes
#IPV6_DEFROUTE=yes
#IPV6_FAILURE_FATAL=no
#IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=7afc67d5-b767-4d89-97b4-2558f8dc33c3
DEVICE=ens33
ONBOOT=yes
[root@localhost network-scripts]# nmcli c reload  # Restart the network card 

Seeing here, do you feel the gap with CentOS7 system?

3. nmcli command interpretation

nacli uses:

Usage: nmcli [Option] OBJECT

Options:

-o [verview] Overview Mode (Hide Default)

-t [erse] concise output

-p [retty] neat output

-m [ode] tabularmultiline Output Mode

-c [olors] Does autoyesno use color in output

-e [scape] yesno semantic column delimiters in values

-a [sk] Query for missing parameters

-s [how-secrets] Allow password display

-w [ait] Sets the timeout wait time for completed operations

-v [ersion] Display Program Version

-h [elp] Outputs this help

Object:

General Status and Operation of g [eneral] Network Manager (NetworkManager)

n [etworking] Overall Networking Control

r [adio] Network Manager Radio Switch

Connections for c [onnection] Network Manager

d [evice] Devices Managed by Network Manager

a [gent] Key (secret) Agent or polkit Agent for Network Manager

m [onitor] Monitor Network Manager Changes

1 Use c:


[root@localhost network-scripts]# nmcli c  In fact, in fact, the -help  # Options to view help 

COMMAND := { show | up | down | add | modify | clone | edit | delete | monitor | reload | load | import | export }

Summarize


Related articles: