Podcast
Questions and Answers
What command activates a specific network connection using NetworkManager?
What command activates a specific network connection using NetworkManager?
- nmcli connection up (correct)
- nmcli activate connection
- nmcli connection down
- nmcli connection start
Which command is used to deactivate a specific network interface?
Which command is used to deactivate a specific network interface?
- ip link down interface
- systemctl deactivate interface
- nmcli connection down interface (correct)
- ip interface down
In the configuration for a static IP, what does the parameter 'BOOTPROTO=none' indicate?
In the configuration for a static IP, what does the parameter 'BOOTPROTO=none' indicate?
- No IP address will be assigned dynamically (correct)
- Network interface will use a static IP
- Interface will accept DNS from DHCP
- System boot protocol is automatic
Which file is used for static hostname resolution?
Which file is used for static hostname resolution?
What does the 'PEERDNS=yes' setting in a dynamic IP configuration do?
What does the 'PEERDNS=yes' setting in a dynamic IP configuration do?
Where are the network settings for interfaces typically stored?
Where are the network settings for interfaces typically stored?
Which command would you use to bring the network interface 'eth0' up?
Which command would you use to bring the network interface 'eth0' up?
If you need to specify a custom DNS server for an interface, which option should you use?
If you need to specify a custom DNS server for an interface, which option should you use?
What is the primary use of the 'ip link' command in network management?
What is the primary use of the 'ip link' command in network management?
In a dynamic IP configuration, what does the parameter 'ONBOOT=yes' signify?
In a dynamic IP configuration, what does the parameter 'ONBOOT=yes' signify?
What happens when 'PEERDNS=no' is set in an interface configuration?
What happens when 'PEERDNS=no' is set in an interface configuration?
Which directory typically contains dynamic network configuration files?
Which directory typically contains dynamic network configuration files?
What is the effect of the 'BOOTPROTO=dhcp' setting in an interface configuration?
What is the effect of the 'BOOTPROTO=dhcp' setting in an interface configuration?
Which command is primarily used to activate a specific network interface after configuration changes?
Which command is primarily used to activate a specific network interface after configuration changes?
When using the '/etc/sysconfig/network-scripts/' directory, which file type is typically used for interface configuration?
When using the '/etc/sysconfig/network-scripts/' directory, which file type is typically used for interface configuration?
Which command would you use to deactivate a specific network interface on a system?
Which command would you use to deactivate a specific network interface on a system?
Study Notes
Service Management and Networking Commands
- MCLI stands for Managed Command Line Interface, used for managing networks.
- NetworkManager service can be controlled using the
systemctl
command.
Network Activation and Deactivation
nmcli connection up <connection_name>
activates a specific network connection.nmcli connection down <interface>
deactivates a specific network connection linked to an interface.
Managing Network Interfaces
ip link set <interface> up
: Activates a network interface.ip link
: Tool to manage network interfaces.set
: Command for changing settings.<interface>
: Placeholder for the network interface name (e.g.,eth0
,wlan0
).
Configuration File Paths
- Network settings are stored in
/etc/sysconfig/network-scripts/
for network scripts. - Network connection settings can also be found in
/etc/NetworkManager/system-connections/
.
Interface Configuration
-
Dynamic IP configuration example:
DEVICE=ens160
specifies the network device name.TYPE=Ethernet
defines the connection type.ONBOOT=yes
indicates the interface should activate on boot.BOOTPROTO=dhcp
configures obtaining an IP address via DHCP.PEERDNS=yes
allows acceptance of DNS from the DHCP server.DEFROUTE=yes
indicates acceptance of the gateway from the DHCP server.
-
Static IP configuration example:
DEVICE=ens224
designates the Ethernet connection name.BOOTPROTO=none
specifies no dynamic IP assigned.IPADDR=172.16.30.167
assigns a fixed IP address.NETMASK=255.255.0.0
defines the subnet mask.NETWORK=172.16.0.0
sets the associated network.
Hostname Resolution
- Static hostname resolution uses
/etc/hosts
for server name and local settings. - Dynamic hostname resolution relies on
/etc/resolv.conf
for DNS server entries.- Updated by local DHCP client or manually configured.
- Controlled by
PEERDNS
option in interface configuration. - Two DNS servers can be specified in the configuration with
PEERDNS=no
to update resolv.conf.
Viewing Routing Information
- Local routing table can be viewed using the command
ip route
. - Outputs indicate the default route, next-hop IP address, and the exit interface.
Device and IP Configuration Commands
-
Device setup commands:
ip link
: Replacesifconfig
to manage network interfaces.lspci [-v]
: Displays information about PCI devices.
-
IP configuration commands:
ip addr
: Replacesifconfig
for viewing IP addresses.ip route
: Replacesroute
for routing information.ip neigh
: Replacesarp
for neighbor discovery.ping
: Tests connectivity to networked devices.
Hostname Management Commands
hostnamectl
: Used to set or view the system hostname.getent hosts
: Retrieves entries from the host database.ping
: Also used to check hostname resolution and connectivity.
CLI Interface for Network Management
- MCLI: Command Line Interface for managing network settings efficiently.
- Network services managed via
systemctl NetworkManager
.
Network Interface Management
- Use
nmcli connection up <connection-name>
to activate a specific network. - Use
nmcli connection down <connection-name>
to deactivate a specific network. - Command
ip link set <interface> up
enables a network interface. ip link
: Tool for managing network interfaces, allows viewing and modifying settings.<interface>
indicates the specific network interface (e.g., eth0 for Ethernet, wlan0 for Wi-Fi).
Network Configuration Files
- Configuration files are located in:
/etc/sysconfig/network-scripts/
: Stores network settings./etc/NetworkManager/system-connections
: Used by NetworkManager to manage connections.
Interface Configuration
-
Dynamic IP configuration:
DEVICE=ens160
,TYPE=Ethernet
,ONBOOT=yes
,BOOTPROTO=dhcp
(for DHCP).PEERDNS=yes
allows DNS servers to be accepted from the DHCP server.DEFROUTE=yes
sets the gateway from the DHCP server.
-
Static IP configuration:
DEVICE=ens224
,TYPE=Ethernet
,ONBOOT=yes
,BOOTPROTO=none
(fixed IP).IPADDR=172.16.30.167
,NETMASK=255.255.0.0
.
Hostname Resolution
-
Static resolution via
/etc/hosts
:- Includes localhost and server name entries.
-
Dynamic resolution via
/etc/resolv.conf
:- Contains a list of name servers, automatically updated by DHCP or manually.
- Controlled by
PEERDNS
option. - Additional DNS configuration can be set in interface files as DNS1, DNS2 with
PEERDNS=no
.
Viewing Routing Table
- Use
ip route
to display the local routing table. - Output details the default route, the IP of the next-hop router, and the exit interface.
Commands for Device Setup
- Use
ip link
(replacesifconfig
) to inspect and manage interfaces. - Use
lspci [-v]
to list PCI devices with optional verbose output.
IP Configuration Commands
ip addr
: Replacesifconfig
to deal with IP addresses.ip route
: Replaces traditionalroute
command for routing.ip neigh
: Replacesarp
for neighbor discovery.ping
: Utility to test network connectivity.
Hostname Configuration and Resolution Commands
hostnamectl
for setting and getting system hostname.getent hosts
for querying hosts or DNS information.ping
for testing connectivity to hostnames.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
This quiz focuses on service management and command-line interface (CLI) tools for network management, particularly using MCLI and nmcli commands. You'll explore how to activate and deactivate specific network connections and manage interfaces with ip link commands. Test your knowledge on essential networking commands and their functions.