Search code examples
linuxnetwork-programmingipv6

Multiple IPv6 address based on SLAAC prefix on Linux


I'd like to ask is there any way to make linux get more than one (or let we say 1000) IPv6 address base on SLAAC announced prefix?

I used to do ip a add IPV6_ADDR on boot when I have a static IPv6 prefix, but now my ISP gives a dynamic prefix instead of a fixed one, which makes the added addresses expire after they changed the prefix.

An alternative way I've thought is to make a script run when the prefix is changed to re-add IPs with new prefix, but I didn't find how to do it too :(

Thanks.


Solution

  • Solved: It cames out I can use macvlan to solve this problem.

    ~# ip link add link eth0 eth0.2 type macvlan
    ~# ip link set dev eth0.2 up