I know how to add additional IPv4 IP address using virtual IP address configuration under Debian Linux. How do I add additional IPv6 address (aliased IPv6 addresses) under Debian Linux server?
You cannot use virtual interface style nameing such as eth0:1 with IPv6. You need to use /sbin/ifconfig or /sbin/ip command with UP command in /etc/network/interfaces file to configure additional IPv6 address. The following example shows the addition of a secondary address using the /sbin/ifconfig command.
Our sample IPv6 Address
- Main Static IPv6 address: 2607:f0d0:2001:000a:0000:0000:0000:0002/64
- Ipv6 gateway address: 2607:f0d0:2001:000a:0000:0000:0000:0001
- Additional Ipv6 address #1: 2607:f0d0:2001:000a::3/64
- Additional Ipv6 address #2: add 2607:f0d0:2001:000a::4/64
- Interface: eth0
- Ipv6 Type: Static
Debian IPv6 Virtual Interface (aliased) Configuration
Open /etc/network/interfaces file, enter:
# vi /etc/network/interfaces
Modify / append configuration as follows:
#IPV6 configuration iface eth0 inet6 static pre-up modprobe ipv6 address 2607:f0d0:2001:000a:0000:0000:0000:0002 netmask 64 gateway 2607:f0d0:2001:000a:0000:0000:0000:0001 # Start IPv6 secondary additional IP configuration up /sbin/ifconfig eth0 inet6 add 2607:f0d0:2001:000a::3/64 up /sbin/ifconfig eth0 inet6 add 2607:f0d0:2001:000a::4/64
Save and close the file. Restart networking:
# /etc/init.d/networking restart
Verify new Ipv6 networking settings including secondary address:
# ifconfig eth0
# ip -6 route show
# ping6 www.cyberciti.biz
# ping6 2607:f0d0:2001:000a::3
🐧 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |