1

So i just purchased a linux (centos) server with /64 IPV6 subnet. I want to use these IP's for outgoing requests especially.

How on earth can we add that many IP addresses to the network interface? Are there any workarounds for this?

1 Answers1

0

Assigning those IP-addresses is easy, you can do it with something like:

ip addr add 2001:4860:4860:abcd::/64 dev eth0

However, choosing which one will be used for outgoing connection is another problem, which doesn't have that simple solution, tough i'd try that nice loader first

Anubioz
  • 3,597
  • 17
  • 23
  • Why the downvote, does this not work or what ? – Marc May 28 '20 at 10:50
  • @Marc that does work for assigning multiple addresses to an interface. Choosing an outgoing IP address requires policy base routing to be applied to an application using network namespaces... The question does not specify what exactly is to be achieved, so I gave an link to a more generalized solution. I guess people can't agree to the fact that using multiple outgoing IPs at the same time is not that simple as they think it to be, so downvote :) – Anubioz May 28 '20 at 20:38
  • Does the kernel chose automatic which ip adress is used for outgoing traffic ? As Example, if i reach the ephemeral port limit, so i dont get a `EADDRNOTAVAIL` error ? – Marc May 29 '20 at 07:37
  • @Marc kernel source address selection follows [RFC 6724](http://tools.ietf.org/html/rfc6724), which doesn't really describes a way to solve hitting the port limits. There is good article on how kernel chooses addresses here: http://biplane.com.au/blog/?p=22 and how to control it here: http://biplane.com.au/blog/?p=30. As for the port limit problem, it can be solved per-application source address selection via network netspaces... – Anubioz May 29 '20 at 13:41