I have a debian server and a pool of ipv6 addresses with 64 mask. I want to split all ips between multiple servers, but configure it through masks, without adding 4 million ips to /etc/network/interfaces. How to configure Linux machine, to be able to use ip from the given range? For example, if i have 1111:20c:234c:e562::/71, i want to be able to use all ips from this range. I mean, i can ping google.com with that command ping -I 1111:020c:234c:e562:0000:0000:0000:0000 google.com ping -I 1111:020c:234c:e562:03ff:ffff:ffff:ffff google.com

  • 1
    Subnets are divided into ranges, typically /64 for IPv6, but interfaces are only assigned at most a couple of addresses. It is impractical to assign 4 million addresses to an interface, let alone 2^57 (10^39) addresses. – Johan Myréen Oct 1 '18 at 7:05
  • @JohanMyréen I have around 40 servers. Anyway, maybe it's possible to split only by thousands? – B.Zamalutdinov Oct 1 '18 at 7:35
  • I have you have 40 servers, let your main gateway announce the /64 prefix, and they will configure their network interfaces accordingly (with a single IPv6 address, using the MAC address). Then you set up proper DNS, and use those particular address. Or use DHCPv6 with 40 static addresses. You never configure the complete range (just because you "got it"). If you want to do load balancing, do it with a single IPv6 address, on a device in front of your servers. If you really have to, you can also do load balancing with an IPv6 range. – dirkt Oct 1 '18 at 7:41
  • @dirkt I need this ip's on my machine, to be able to use as outgoing ips when i will perform some requests from it. TLDR, i want to use different ip from my pool each time(or random from available) for each request – B.Zamalutdinov Oct 1 '18 at 7:48
  • 2
    So addr='1111:020c:234c:e562:0000:0000:0000:0000' ; ip addr add $ADDR dev eth0 ; ping -I $ADDR -c10 google.com ; ip addr del $ADDR, rinse and repeat with other addresses. You add each address as long as you need it. – dirkt Oct 1 '18 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.