RHCSA RHEL 8 – Configure IPv4 and IPv6 addresses



RHCSA RHEL 8 – Configure IPv4 and IPv6 addresses

RHCSA RHEL 8 - Configure IPv4 and IPv6 addresses

Your support on Ko-Fi is much appreciated:
👉 https://ko-fi.com/csg_yt

Join our new discord channel:
👉 https://discord.gg/kBQ6Jry

Buy CSG Merchandise:
👉 http://tee.pub/lic/csg

This video is based on RHEL 8.

Video to cover the section ‘Configure IPv4 and IPv6 addresses’ for the RHCSA (Red Hat Certified System Administrator).

More information on the required learning: http://bit.ly/rhcsa8

Notes from the video:

This section is on IP addressing. An Internet Protocol (IP) address is an individual address for a host on a network. When using the internet your IP address is assigned to you by your Internet Service Provider (ISP).

When using the device within your home network you will be assigned a local IP address by your router and then the router uses Network Address Translation (NAT) to translate your local address to your ISP provided address for use on the internet.

There are two types of IP address in use these days IPv4 and IPv6. IPv4 is still the most widely used, but is slated to be fully replaced by IPv6, just it is a massive task.

IPv4
This IP addressing scheme is a 32 bit address (being 32 1s or 0s) using decimal numbers, split into 4 octets.
Within these classes there are ranges assigned for private use of which we have included below. The subnet mask defines how large the network is, for example the network is 10.0.0.0 and the subnet mask is 255.0.0.0, the maximum value of an IP address is 255 so for the 10. octet it is masking, all of the other octets are able to go to their maximum values. So the IP address range is: 10.0.0.0 – 10.255.255.255, we can use any address in between e.g. 10.1.4.200. The CIDR is a way of expressing the subnet mask in short form, for example we can express the below class C network as 192.168.0.0/16.

The good thing is once you have the hang of Subnet Masks and CIDR it is again used in IPv6 so it’s not something you will have to learn again. All networks will have a gateway address (this is a router or switch that can redirect traffic intended for other networks) and a broadcast address (this is the address we use to send messages to multiple hosts on the same network for special types of requests).

Configuring a IPv4 Address
All of the configuration is completed via the nmcli application.

To show the connection information:

# nmcli connection show

To get the current status:

# nmcli device status

To get the current configuration:

# nmcli device show

To delete a device (don’t do to your active network interface!):

# nmcli connection delete enp0s3

To add a new connection for a new device (enp0s8):

# nmcli connection add con-name eth0 ifname enp0s8 type ethernet ip4 10.0.2.16/24 gw4 10.0.2.2

To check the configuration:

# nmcli connection show

# ip addr

# nmcli device show enp0s8

To bring an interface up:

# nmcli connection up eth0

To bring an interface down:

# nmcli connection down eth0

To manually configure an IP address:

# nmcli connection modify eth0 ipv4.address 10.0.2.15/24

# nmcli connection modify eth0 ipv4.gateway 10.0.2.2

# nmcli connection modify eth0 ipv4.method manual

IPv6
The addressing used in IPv6 is 128 bit and uses hexadecimal numbers, therefore has a much larger address space. This was due to IPv4 being too small for modern needs and now pretty much all of the IPs have been used.
IPv6 addresses are classless and therefore we have no class designation, however some prefixes (same as CIDR) are reserved for specific uses. Here are some common ones.
IPv6 uses the same gateway, but doesn’t have any broadcast address, it’s as the protocol is more modern and no longer needs this functionaility.

Configuring an IPv6 Address
Using the same method as above to manage the connection, the only difference is when you come to configure the actual IP addressing.

To add a new connection for a new device (enp0s8):

# nmcli connection add con-name eth0 ifname enp0s8 type ethernet ip6 2006:ac81::1105/64 gw6 2006:ac81::1101

To manually configure an IP address:

# nmcli connection modify eth0 ipv6.addresses 2006:ac81::1105/64

# nmcli connection modify eth0 ipv6.gateway 2006:ac81::1101

# nmcli connection modify eth0 ipv6.method manual

#rhcsa #rhel #linux #redhat .

Comments are closed.