Introduction
In this article, we will discuss how to permanently accept IPv6 auto-configuration via Router Advertisement messages on Ubuntu 22.04. IPv6 is the latest version of the Internet Protocol (IP), which is designed to replace IPv4. IPv6 provides an unlimited number of addresses, making it ideal for the Internet of Things (IoT) and other connected devices. However, by default, Ubuntu may not accept IPv6 auto-configuration from routers using Router Advertisement messages.
Understanding IPv6 and Router Advertisement Messages
IPv6 is a new version of the Internet Protocol (IP) that provides an unlimited number of addresses, making it ideal for the Internet of Things (IoT) and other connected devices. IPv6 uses Stateless Address Autoconfiguration (SLAAC) to assign IP addresses to devices on a network. SLAAC uses Router Advertisement (RAs) messages to convey IPv6 address and prefix information to hosts. RAs contain options that can be used to configure various aspects of the host's IPv6 interface.
Accepting IPv6 Auto-Configuration via Router Advertisement Messages
By default, Ubuntu may not accept IPv6 auto-configuration via Router Advertisement messages. To permanently enable IPv6 auto-configuration, you need to modify the sysctl configuration file. Follow the steps below:
Step 1: Edit /etc/sysctl.conf
Open the sysctl configuration file using your favorite text editor:
sudo nano /etc/sysctl.conf
Add the following lines at the end of the file:
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.accept_ra = 2
net.ipv6.conf.default.accept_ra = 2
Save and close the file.
Step 2: Reload the sysctl Configuration
Reload the sysctl configuration to apply the changes:
sudo sysctl --system
Verifying IPv6 Auto-Configuration
Verify that IPv6 auto-configuration is working by checking the IPv6 address of your Ubuntu system:
ip -6 addr show
In this article, we discussed how to permanently accept IPv6 auto-configuration via Router Advertisement messages on Ubuntu 22.04. We covered the basics of IPv6 and Router Advertisement messages and then walked through the steps to enable IPv6 auto-configuration on Ubuntu.