0% found this document useful (0 votes)
12 views2 pages

Comptia Linuxxk0005 10 1 1 Configuring A Network Adapter

This document outlines the process of configuring a network adapter in Linux using various commands and tools, including ip, ifconfig, nmcli, and NetPlan. It covers viewing network configurations, setting static IP addresses, and managing connections with Network Manager CLI and NetPlan. Additionally, it highlights the advantages of using NetPlan and provides instructions for disabling cloud-init and creating a network configuration file.

Uploaded by

Saba Hussien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Comptia Linuxxk0005 10 1 1 Configuring A Network Adapter

This document outlines the process of configuring a network adapter in Linux using various commands and tools, including ip, ifconfig, nmcli, and NetPlan. It covers viewing network configurations, setting static IP addresses, and managing connections with Network Manager CLI and NetPlan. Additionally, it highlights the advantages of using NetPlan and provides instructions for disabling cloud-init and creating a network configuration file.

Uploaded by

Saba Hussien
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Configuring a Network Adapter

CompTIA Linux+ (XK0-005)

Objectives:

At the end of this episode, I will be able to:

1. Demonstrate how to set the IP address and netmask using the ip, ifconfig, and nmcli commands.

Additional resources used during the episode can be obtained using the download link on the overview episode.

Configuring a Network Adapter

Viewing your network configuration


Configuring using the Network Manager CLI
Configuring using NetPlan

Viewing your network configuration

Common commands

ifconfig
ip addr

SysVinit (Script based)


systemd (Unit based)

NetworkManager (RHEL)
NetPlan (Ubuntu)

Configuring using the Network Manager CLI

Default in RHEL-based distributions


Viewing connections

nmcli device status


nmcli device show <int_name>
nmcli connection show
nmcli connection show <int_name>

Assigning a static IP

nmcli connection edit <int_name>


set connection.autoconnect yes
set ipv4.method manual
set ipv4.addr 192.168.0.2/24
set ipv4.dns 8.8.8.8
set ipv4.gateway 192.168.0.1
save <temporary/persistent>
quit

Resetting connections

nmcli connection reload


nmcli connection down <int_name>
nmcli connection up <int_name>

NetPlan advantages

Cloud Init
Configuration tests
Simple YAML configuration

Disable cloud-init

sudoedit /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
network: {config: disabled}

Configuring an adapter with NetPlan

Create network configuration


sudoedit /etc/netplan/config.yaml

network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
addresses: [10.0.222.101/16]
gateway4: 10.0.0.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]

Apply a NetPlan configuration

sudo netplan try


sudo netplan apply

You might also like