Latest

Saturday, 8 December 2018

How to Configure Static IPv6 Networking on CentOS/RHEL 7

Configure Static IPv6 Networking on RHEL 7 Machines1

Red Hat Enterprise Linux (RHEL) 7 fully supports IPv6 network. It is not much difficult to configure an IPv6 network, if you have some basic understanding of IPv6 addressing scheme.

In this article, we will configure an IPv6 Network between two Red Hat Enterprise Linux (RHEL) 7 machines by setting static IPv6 addresses using nmcli command.

 

What is IPv6?:

Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv6 was developed by the Internet Engineering Task Force (IETF) to deal with the long-anticipated problem of IPv4 address exhaustion, and is intended to replace IPv4. In December 1998, IPv6 became a Draft Standard for the IETF, which subsequently ratified it as an Internet Standard on 14 July 2017.

Devices on the Internet are assigned a unique IP address for identification and location definition. With the rapid growth of the Internet after commercialization in the 1990s, it became evident that far more addresses would be needed to connect devices than the IPv4 address space had available. By 1998, the IETF had formalized the successor protocol. IPv6 uses 128-bit addresses, theoretically allowing 2128, or approximately 3.4×1038 total addresses. The actual number is slightly smaller, as multiple ranges are reserved for special use or completely excluded from use. The two protocols are not designed to be interoperable, and thus direct communication between them is impossible, complicating the move to IPv6. However, several transition mechanisms have been devised to rectify this.

IPv6 provides other technical benefits in addition to a larger addressing space. In particular, it permits hierarchical address allocation methods that facilitate route aggregation across the Internet, and thus limit the expansion of routing tables. The use of multicast addressing is expanded and simplified, and provides additional optimization for the delivery of services. Device mobility, security, and configuration aspects have been considered in the design of the protocol.

IPv6 addresses are represented as eight groups of four hexadecimal digits each, separated by colons. The full representation may be shortened; for example, 2001:0db8:0000:0000:0000:8a2e:0370:7334 becomes 2001:db8::8a2e:370:7334. (Source: Wikipedia)

 

System Specification:

We have two RHEL 7 virtual machines. for which, we have allocated the following IPv6 addresses.

Machine IPv6 Address
server1.example.com fddb:fe2a:ab1e::c0a8:94/64
desktop1.example.com fddb:fe2a:ab1e::c0a8:95/64
Gateway fddb:fe2a:ab1e::c0a8:50/64

Configure Static IPv6 Networking on RHEL 7 Machines1

Configure IPv6 Networking:

Connect to server1.example.com using ssh and configure IPv6 addresses as follows.

# nmcli connection modify eno16777728 ipv6.method manual ipv6.addresses "fddb:fe2a:ab1e::c0a8:94/64 fddb:fe2a:ab1e::c0a8:50"
# nmcli c down eno16777728 ; nmcli c up eno16777728
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
      inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever 2: eno16777728: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
      link/ether 00:0c:29:63:0c:9a brd ff:ff:ff:ff:ff:ff
      inet 192.168.116.11/24 brd 192.168.116.255 scope global eno16777728
         valid_lft forever preferred_lft forever
      inet6 fddb:fe2a:ab1e::c0a8:94/64 scope global
         valid_lft forever preferred_lft forever
      inet6 fe80::20c:29ff:fe63:c9a/64 scope link
         valid_lft forever preferred_lft forever 3: eno33554968: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
      link/ether 00:0c:29:63:0c:a4 brd ff:ff:ff:ff:ff:ff

Now, connect to desktop1.example.com and configure IPv6 network as follows.

# nmcli connection modify eno16777728 ipv6.method manual ipv6.addresses "fddb:fe2a:ab1e::c0a8:95/64 fddb:fe2a:ab1e::c0a8:50"
# nmcli c down eno16777728 ; nmcli c up eno16777728
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
# ip addr
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno16777728:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:68:ae:66 brd ff:ff:ff:ff:ff:ff
    inet 192.168.116.12/24 brd 192.168.116.255 scope global eno16777728
       valid_lft forever preferred_lft forever
    inet6 fddb:fe2a:ab1e::c0a8:95/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe68:ae66/64 scope link
       valid_lft forever preferred_lft forever
3: eno33554968:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:68:ae:70 brd ff:ff:ff:ff:ff:ff

Ping both IPv6 addresses from any machine to confirm the network connectivity.

# ping6 fddb:fe2a:ab1e::c0a8:94
PING fddb:fe2a:ab1e::c0a8:94(fddb:fe2a:ab1e::c0a8:94) 56 data bytes
64 bytes from fddb:fe2a:ab1e::c0a8:94: icmp_seq=4 ttl=64 time=0.268 ms
64 bytes from fddb:fe2a:ab1e::c0a8:94: icmp_seq=5 ttl=64 time=0.257 ms
^C
--- fddb:fe2a:ab1e::c0a8:94 ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 4019ms
rtt min/avg/max/mdev = 0.257/0.271/0.299/0.020 ms

# ping6 fddb:fe2a:ab1e::c0a8:95
PING fddb:fe2a:ab1e::c0a8:95(fddb:fe2a:ab1e::c0a8:95) 56 data bytes
64 bytes from fddb:fe2a:ab1e::c0a8:95: icmp_seq=2 ttl=64 time=0.056 ms
64 bytes from fddb:fe2a:ab1e::c0a8:95: icmp_seq=3 ttl=64 time=0.060 ms
^C
--- fddb:fe2a:ab1e::c0a8:95 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 0.056/0.062/0.071/0.009 ms

We have successfully configured static IPv6 networking between two Red Hat Enterprise Linux (RHEL) 7 by setting IPv6 addresses using nmcli command.

If you find this article useful? Don't you mind support us by Buy Me A Coffee


No comments:

Post a Comment

© 2022 CentLinux. All Rights Reserved.