You are on page 1of 17

Linux: CHAPTER 9

CHAPTER-12

MANAGING NETWORK
GATHERING NETWORK INTERFACE INFORMATION
Identifying Network Interfaces
Ip link command is used to list all network
interfaces available on your system:
[user@hostname~]$ ip link show

Displaying IP Addresses:
use the IP Command to view device and address
information.

r
Linux: CHAPTER 9

Displaying Performance Statistics:


To check network issues.
To check network performance.

CHECKING CONNECTIVITY BETWEEN HOSTS


Ping command is used to check connectivity.
Note: command continues to run until Ctrl+c is
pressed unless options are given to limit the
number of packets sent.
 ping is used for IPv4.
 ping6 is used for IPv6.

r
Linux: CHAPTER 9

TROUBLESHOOTING ROUTING
Displaying routing table

Use the ip command with the route option to show


routing information.
 Ip route for IPv4.
 Ip -6 route for IPv6

Tracing routes taken by traffic


 tracepath OR tracepath6---for(IPv4)
 traceroute OR traceroute -6---for(IPv6)
Each line in the output of tracepath represents
a router or hop that the packet passes through
between the source and the final destination.

r
Linux: CHAPTER 9

TROUBLESHOOTING PORTS AND SERVICES


The ss command is used to display socket
statics.
The ss command replace the older tool netstat.

Option for ss and netstat


-n ---- show numbers instead of names for interface and ports.

-t ---- show TCP Socket

r
Linux: CHAPTER 9

Objective:
After completing this section, you should be
able to manage network settings and devices
using the nmcli command.
 A device is a network interface.
 A connection is a collection of settings that
can be configured for a device.
 Each connection has a name or ID that
identifies it.
 The nmcli utility is used to create and edit
connection files from the command line.
VIEWING NETWORKING INFORMATION
The nmcli dev status command displays the status
of all network devices:

r
Linux: CHAPTER 9

The nmcli con show command displays a list of


all connections.

The nmcli con show --active command displays a list


of all connections.

r
Linux: CHAPTER 9

ADDING A NETWORK CONNECTION


The nmcli con add command is used to add new
network connections.

The next example creates an eno5 connection for


eno5 device with static IPv4 address.

MODIFYING NETWORK CONNECTION SETTINGS


To deactivate and disconnect the current
connection on the network interface dev.
Nmcli dev dis ens33

r
Linux: CHAPTER 9

To activate the connection


nmcli con up ens33

To disable the connection


nmcli con down ens33

To convert static to auto configuration


nmcli con mod “ens33” ipv4.method auto

r
Linux: CHAPTER 9

CONFIGURATION HOST NAMES AND NAME RESOLUTION


Changing the system hostname:
First check your hostname with hostname command.

Now change your system hostname with below


command.
hostnamectl set-hostname host@example.com

r
Linux: CHAPTER 9

CONFIGURE NAME RESOLUTION


Note: The stub resolver is used to convert host
name to IP addresses or the reverse.

To convert auto to static configuration


nmcli con mod “ens33” ipv4.method manual

To configure manual ip address


Nmcli con mod “ens33” ipv4.method manual ipv4.address 192.168.0.10/24
ipv4.gateway 192.168.0.1

r
Linux: CHAPTER 9

Reload the configuration files (useful after they have


been edited by hand). nmcli con reload

Add DNS Server to Existing Connection

To add a new DNS server to an existing


connection with the following command:

You can verify the changes with the following


command:
cat /etc/sysconfig/network-scripts/ifcfg-ens33 |grep BOOTPROTO

r
Linux: CHAPTER 9

You can also append a new DNS server using the


+ipv4.dns option OR –ipv4.dns option:

To verify network configuration is auto or


manual

r
Linux: CHAPTER 9

Delete a Connection

You can also delete a specific ethernet


connection with nmcli.
To delete a connection eno5, run the following command:

EDITING NETWORK CONFIGURATION FILES


OUTCOMES:
In this topic you will manually modify network
configuration files and ensure that the new
settings take effect.
You should be able to add an additional network
address to each system.
Path: /etc/sysconfig/network-scripts/ifcfg-ens33
First check your configuration file.

r
Linux: CHAPTER 9

Now as the root user, edit the


/etc/sysconfig/network-scripts/ifcfg-ens33 file
on server to add an additional address
10.0.1.1/24.

Now verify the new IP Address and Prefix.


Ip addr show ens33
Or
Cat /etc/sysconfig/network-scripts/ifcfg-ens33 |grep IPADDR

Cat /etc/sysconfig/network-scripts/ifcfg-ens33 |grep PREFIX

r
Linux: CHAPTER 9

CONFIGURING HOST NAMES AND NAME RESOLUTION


Objectives:
After completing this section, you should be
able to configure a server’s static host name
and its name resolution and test the results.
Changing the system hostname:
The hostname command displays or temporarily
modifies the system’s fully qualified host name.

To display host name status.

r
Linux: CHAPTER 9

Temporarily change the host name:


hostname command is used to change and check
temporarily host name.
Note that after reboot temporarily hostname will
be no longer.

NAME RESOLUTION
Communicate with IP-Address or Name.

r
Linux: CHAPTER 9

You might also like