5-2 Configure Networking and Hostname Resolution Statically or Dynamically: Network Manager Flashcards Preview

RHCSA Redhat Certified System Administrator Certification > 5-2 Configure Networking and Hostname Resolution Statically or Dynamically: Network Manager > Flashcards

Flashcards in 5-2 Configure Networking and Hostname Resolution Statically or Dynamically: Network Manager Deck (26)
Loading flashcards...
1
Q

/etc/sysconfig/network-scripts

ex:
cat /etc/sysconfig/network-scripts/ifcfg-eth0

A

Location of all configuration files for network cards, etc.

Each connection to system is a configuration, each configuration is attached to a device, each device has a configuration file

ex: for eth0

2
Q

ls /sys/class/net

nmcli dev status

A

2 ways to

View which network cards are attached to the system, or to list all the devices.

3
Q

Display a list of connections

A

nmcli con show

4
Q

Display “device” status

A

nmcli dev status

5
Q

Display help for adding connections

A

nmcli con add help

6
Q

Add a connection

A

nmcli con add con-name
“nameofthecon” type ethernet ifname eth0

ifname is the name of the Ethernet device; can find them by doing ls /sys/class/net
By not specifying a gateway or IP, the connection will attempt to go with DHCP

nmcli con add con-name “nameofthecon”
ifname eth0 autoconnect no type Ethernet ip4 ipaddress gw4 gateway

autoconnect will automatically bring up the network connection when the system starts

7
Q

Modify an existing network connection

ex:

A

nmcli con mod “nameofthecon”

ex:
nmcli con mod “nameofthecon” connection.autocorrect yes

cat /etc/sysconfig/network-scripts/ifcfg-nameofthecon
see if ONBOOT=yes, which means this configuration will automatically connect. if device set to DEVICE=eth0, it will connect to configuration to eth0 device

Press tab twice for auto complete to show options

8
Q

After modifying a network connection, you should reload the configuration

A

nmcli con reload

9
Q

List all devices

A

nmcli dev status

10
Q

Turn off a network device

A

nmcli dev disconnect “device”

11
Q

Turn on a network device

A

nmcli dev connect “device”

12
Q

List all connections (connections are con gurations that are attached to a device)

A

nmcli con show

13
Q

Activate or “bring up” a connection

A

nmcli con up “connectionname”

14
Q

Deactivate or “bring down” a connection

A

nmcli con down “connectionname”

15
Q

Delete a connection

A

nmcli con del “connectionname”

16
Q

Change the method from static IP to DHCP

A

nmcli con mod “con-name ipv4.method manual

17
Q

Example: Add static IP address to eno1 with an IP of 192.168.122.5/24 and gateway of 192.168.1.1

A

nmcli con mod eno1 ipv4.addresses “192.168.122.5/24 192.168.1.1”

18
Q

nm-connection-manager

A

GUI interface to manage connections

19
Q

nm (press tab twice)

A

to see commands that start with nm

20
Q

nmtui

A

network manager text based gui to configure networking

21
Q

nmcli con show –active

A

to display only active connections

22
Q

nmcli con show “con-name”

A

to show a connection by name

23
Q

dhcp vs static

A

static means manually configured

dhcp means the device is configured to find dhcp server to get its ip automatically assigned

these can be configuration differences on diff connection configuration files. Can be diff connections for same device, where connections can be switched between

24
Q

See if a device is connected

A

nmcli dev show

Connected device has GENERAL.STATE has a (connected) value

25
Q

How to see if a connection’s configuration is dhcp?

A

Inside /etc/sysconfig/network-scripts/ifcfg-nameofconnection

BOOTPROTO=dhcp

26
Q

Start and Stop Network Manager

A

systemctl start NetworkManager
systemctl enable NetworkManager
systemctl restart network

If you get lost, use the man page for nmcli-examples to help when configuring nmcli

Decks in RHCSA Redhat Certified System Administrator Certification Class (21):