Nội dung
Introduction
What is IPv6?
IPv6 is “Internet Protocol version 6“, a version of Internet Protocol (IP) intended to upgrade Internet Protocol version 4 (IPv4) that currently transmits most Internet traffic but has run out of address. IPv6 allows up to 2,128 addresses, a huge increase compared to the 232 (about 4.3 billion) addresses of IPv4.
28% of devices with IPv6 addresses in Vietnam are used to search at Google, the most are in the US with 32%.
Check if IPv6 is enabled on the server
How to know if your server supports IPv6 feature? The simplest way is that you just need to display the network card information, which will come with spontaneous IPv6 information for the Linux network card.
[root@sv ~]# ifconfig -a | grep inet6 inet6 fe80::6ddf:1974:3ad2:c86f prefixlen 64 scopeid 0x20 inet6 fe80::9f2a:5f83:61dd:75c1 prefixlen 64 scopeid 0x20 inet6 ::1 prefixlen 128 scopeid 0x10
Note: The IPv6 value, as shown above, is a self-generated IPv6 value by the Linux system. Not for public use but only for local network communication connections.
In addition, you can quickly check by using the command below, if the result is “0“, it means it is active, and “1” means it is not.
[root@sv ~]# cat /proc/sys/net/ipv6/conf/all/disable_ipv6 0
How to disable IPv6
Method 1: Disable IPv6 in GRUB
- You open the configuration file according to the path below:
vi /etc/default/grub
Next, you add the content: ipv6.disable=1 to the GRUB_CMDLINE_LINUX= line:
- Recreate the GRUB configuration file and overwrite the current grub configuration file.
grub2-mkconfig -o /boot/grub2/grub.cfg
- Reboot the Linux system.
reboot
Method 2: Disable IPv6 via sysctl
This way, we will not need to reboot the server, but the configuration modification will take effect immediately. Now add the following 3 configuration lines to the end of the /etc/sysctl.conf file.
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
- Reload new configuration without reboot
sysctl -f /etc/sysctl.conf
Note: If you are using X Forwarding of the SSH service configured at /etc/ssh/sshd_config. then you should change the ‘AddressFamily‘ value in the SSH service configuration.
#AddressFamily any => AddressFamily inet
Note:
- inet: works with IPv4
- inet6: works with IPv6
- any: with with IPv4 and IPv6
So AZDIGI has shown you 2 methods to disable IPv6 on the CentOS7 server. If you have any questions or concerns, you can leave a comment below the article. Wishing you success!
You can refer to other instructions at the link below:
If you need support, you can contact support in the ways below:
- Hotline 247: 028 888 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: support@azdigi.com .