
not need to perform this procedure unless the interface is listed as
unmanaged
. Follow the steps below to allow it to be
managed by NetworkManager:
a) Remove the line NM_CONTROLLED-no from the
file /etc/sysconfig/network-scripts/ifcfg-<interface>
, where
interface
is the interface name listed in the
nmcli d
command. If there is no file with this name, then you do not
need to perform this procedure.
b) NetworkManager must be told to read the configuration files again. To do this, give the following command:
nmcli connection reload
Manual changes to any
ifcfg
file will not be noticed by NetworkManager until the following command is issued:
nmcli connection reload
Note
Step 2
Make sure that there is no current configuration for the interface that you want to configure. If you want the configuration
that you create to be the default for the interface and there are multiple configurations associated with an interface, it
may lead to confusion when the system reboots. The
nmcli c
command lists the existing configurations. If you see any
existing configurations, examine them to see if they apply to the interface you want to configure. An easy way to do this
is to use the following command:
nmcli con show <config> | grep <interface>
If you see any output, you should remove the configuration
<config>
with the command:
nmcli con delete <config>
There is often a configuration called "Wired connection 1" which needs to be deleted.
Note
Step 3
Create the configuration and associate it with the interface (device) in one command. This command only creates the
configuration and associates it with the interface, it does not apply it to the interface.
nmcli con add type ethernet con-name <config> ifname <interface> ip4 <ip>/<netmaskwidth> gw4 <gateway>
where
<config>
is the name of the configuration, which can be anything (including the name of the interface),
<interface>
is the name of the interface (device),
<ip>
is the IPv4 address,
<netmaskwidth>
is the network mask width, and
<gateway>
is the IPv4 gateway address.
Example (type all in one line):
nmcli con add type ethernet con-name my-office ifname ens160 ip4 10.10.24.25/24 gw4 10.10.20.174
Step 4
Add the DNS server to the configuration for the interface (device):
nmcli con mod <config> ipv4.dns <dnsip>
where
<dnsip>
is the IPv4 address of the DNS server and
<config>
is the name of the configuration.
Example:
nmcli con mod my-office ipv4.dns 72.63.128.140
You can add two DNS addresses as given below:
nmcli con mod my-office ipv4.dns "72.63.128.140 72.63.111.120"
This will replace any previously set DNS servers. To add to an previously set DNS entry, use the + before
ipv4.dns as shown below:
nmcli con mod test-lab +ipv4.dns "72.63.128.140 72.63.111.120"
Note
Step 5
Apply the configuration to the interface, which will bring up the interface if it was not already running:
nmcli con up <config>
where
<config>
is the name of the configuration.
Cisco Prime Network Registrar 9.1 Installation Guide
68
Configuring Network Access on CentOS 7.3 Using nmcli
Configuring Network Access on CentOS 7.3 Using nmcli
Содержание SH060
Страница 12: ...Cisco Prime Network Registrar 9 1 Installation Guide 6 Configuration Options Three Machine DNS Configuration ...
Страница 72: ...Cisco Prime Network Registrar 9 1 Installation Guide 66 Hardening Guidelines Hardening Guidelines ...
Страница 82: ...Cisco Prime Network Registrar 9 1 Installation Guide IN 4 Index ...