KEMBAR78
Network Configuration | PDF | Ip Address | Computer Network
0% found this document useful (0 votes)
48 views5 pages

Network Configuration

The document provides an overview of networking fundamentals, including IPv4 and IPv6 addresses, methods for assigning IP addresses, and naming conventions for network cards in RHEL 8. It details how to validate network configurations, display IP addresses and routing information, and configure network settings using various tools like nmcli and nmtui. Additionally, it covers editing network configurations, setting hostnames, and managing routing tables.

Uploaded by

Mohamed Ibrahim
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)
48 views5 pages

Network Configuration

The document provides an overview of networking fundamentals, including IPv4 and IPv6 addresses, methods for assigning IP addresses, and naming conventions for network cards in RHEL 8. It details how to validate network configurations, display IP addresses and routing information, and configure network settings using various tools like nmcli and nmtui. Additionally, it covers editing network configurations, setting hostnames, and managing routing tables.

Uploaded by

Mohamed Ibrahim
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/ 5

Configuring Networking

Networking Fundamentals
■ IPv4 addresses: These are based on 32-bit addresses and have four octets, separated by dots, such as
192.168.10.100.
■ IPv6 addresses: These are based on 128-bit addresses and are written in eight groups of hexadecimal
numbers that are 16 bits each and separated by colons. An IPv6 address may look like
fe80:badb:abe01:45bc:34ad:1313:6723:8798.

The network addresses can be assigned in two ways:


■ Fixed IP addresses: Useful for servers that always need to be available at the same IP address.
■ Dynamically assigned IP addresses: Useful for end users’ devices, and for instances in a cloud
environment. To dynamically assign IP addresses, a Dynamic Host Configuration Protocol (DHCP) server is
usually used.

Names for network cards:


In RHEL 8, the default names for network cards are based on firmware, device topology, and device types.
This leads to network card names that always consist of the following parts:

■ Ethernet interfaces begin with en, WLAN interfaces begin with wl, and WWAN interfaces begin with ww.
■ The next part of the name represents the type of adapter. An o is used for onboard, s is for a hotplug slot,
and p is for a PCI location. Administrators can also use x to create a device name that is based on the MAC
address of the network card.
■ Then follows a number, which is used to represent an index, ID, or port.
■ If the fixed name cannot be determined, traditional names such as eth0 are used.

Based on this information, device names such as eno16777734 can be used, which stands for an onboard
Ethernet device, with its unique index number.
Apart from this default device naming, network cards can be named based on the BIOS device name as well.
In this naming scheme, names such as em1 (embedded network card 1) or p4p1 (which is PCI slot 4, port 1)
can be used. To use this kind of naming, the biosdevname package must be installed.

Validating Network Configuration


■ IP address and subnet mask
■ Routing
■ Availability of ports and services

Validating Network Address Configuration


■ Use ip addr to configure and monitor network addresses.
■ Use ip route to configure and monitor routing information.
■ Use ip link to configure and monitor network link state.

Displaying IP addresses/Prefix:

[root@master ~]# ifconfig

[root@master ~]# ifconfig ens33

[root@master ~]# ip help

[root@master ~]# ip addr help

[root@master ~]# ip addr (Display IP information)

[root@master ~]# ip addr show (Display IP information)

[root@master ~]# ip addr show ens33

[root@master ~]# ip link show

[root@master ~]# ip -s link show

[root@master ~]# ip -s link show ens33

Displaying Routing (Gateway):

[root@master ~]#ip route

Or [root@master ~]# route –n

Display Name Server:

[root@master ~]#cat /etc/resolve.conf

Display all Network config. In one command:

[root@master ~]#nmcli device show ens192

Configure Network Configuration :

 GUI
 TUI (nmtui)
 CLI (nmcli)
 Editing in files.
Hint:

■A device is a network interface card.


■A connection is the configuration that is used on a device.

In RHEL 8, you can create multiple connections for a device. Instead of modify the current configuration
based on one interface, it’s make sense to create a connection (profile) and if you done with it (the profile)
you can easily delete it.

Before configure the NW Configs, Let’s ask this “Who can change NW configuration ?!! Normal
Users or ROOT !!!”

Obviously, the root user can make modifications to current networking. However, if an ordinary user is
logged in to the local console, this user is able to make changes to the network configuration as well. As
long as the user is using the system keyboard to enter either a graphical console or a text-based console,
these permissions are granted. This is because users are supposed to be able to connect their local system to
a network. Notice that regular users that have used ssh to connect to a server are not allowed to change the
network configuration. To check your current permissions, use the nmcli gen permissions command

Configuring Networking with nmtui:

[root@client ~]# nmtui

[root@client ~]# nmcli con down ens33 ; nmcli con up ens33

Nmcli con down == ifdown

Nmcli con up == ifup

Editing and adding connection with nmcli utility:

[root@client ~]# nmcli dev show <devicename>

[root@client ~]#nmcli dev connect/disconnect <device name>

[root@client ~]#nmcli networking on/off

[root@client ~]#nmcli connection show (list all connections applied on which interface)

[root@client ~]# nmcli con mod ens33 connection.autoconnect no (Turn off auto connection)

[root@client ~]# nmcli con mod ens33 ipv4.dns 8.8.8.8 (Configure a DNS server)
[root@client ~]# nmcli con mod ens33 +ipv4.dns 4.2.2.3 (Add another DNS server)

[root@client ~]# nmcli con mod ens33 +ipv4.address 10.0.0.1/24 (Add a secondary address)

[root@client ~]# nmcli con mod ens33 ipv4.method manual ipv4.address 192.168.1.10/24 ipv4.gateway
192.168.1.1 ipv4.dns 8.8.8.8

Adding another connection

[root@client ~]# nmcli con add type ethernet con-name lab ifname ens33 ipv4.method manual
ipv4.addresses 192.168.4.61/24 ipv4.gateway 192.168.4.2 ipv4.dns 192.168.4.2 +ipv4.dns 8.8.8.8

[root@client ~]#ifup lab

NOTE THAT THERE’S ONE CONNECTION ACTIVE PER TIME, IF YOU UP lab
CONNECTION THE ens33 CONNECTION WILL BE NOT ACTIVE.

Editing Network Configuration

[root@client ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33

Edit in values

NAME=ens33
DEVICE=ens3
ONBOOT=yes
NETBOOT="yes"
UUID=6fdb13a0-1592-4992-a09e-632c23fb0d0f
IPV6INIT=yes
BOOTPROTO=none
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPADDR=192.168.122.20
PREFIX=24
GATEWAY=192.168.122.1
DNS1=192.168.2.254

Restart network service on RHEL 8: systemctl restart NetworkManager OR sudo nmcli connection
reload

Add Connection with Files :

#cd /etc/sysconfig/network-scripts/

#cp ifcfg-ens33 ifcfg-lab


#vi ifcfg-lab

Edit as we mention and don’t forget to restart the service

Configuring Host Names:

[root@client ~]# hostname

[root@client ~]# hostname master.redhat.com

[root@client ~]# vim /etc/hostname

[root@client ~]# hostnamectl (Display information about the system)

[root@client ~]# hostnamectl status (Display information about the system)

[root@client ~]# hostnamectl set-hostname www.redhat.com

- The static host name is stored in /etc/hostname. Previous versions of RHEL stored the
hostname as a variable in the /etc/sysconfig/network file.

Configure Routing:

[root@client ~]# route -n (Display routing table)

[root@client ~]# ip route (Display routing table)

[root@client ~]# ip route show (Display routing table)

[root@client ~]# ip route add 20.0.0.0/8 via 192.168.1.1 (Add a static route)

Network tools:

#netstat –tulpn

#ss –lt

#nslookup

#dig google.com

Eng. Muhammad Adel

You might also like