0

I have /64 subnet ipv6 addresses. My intent is to use them as different outgoing ip addresses for cURL.

When I add following line to "/etc/network/interfaces" it works like a charm but when the file increases like eth0:65000 the server breaks down and I can not connect it anymore from ssh.

auto eth0:1
iface eth0:1 inet6 static 
address 2001:db8:5555:6666:0000:0000:0000:0000 
netmask 64 
gateway 2001:db8:5555:6666:0000:0000:0000:0000 
autoconf 0 
dns-nameservers 2001:4860:4860::8844 2001:4860:4860::8888 8.8.8.8 
post-up ip -6 addr add 2001:db8:5555:6666:0000:0000:0000:0000/64 dev 

Is there a way to use each of the ipv6 address as an outgoing ip address?

if it helps sysctl.conf file content

net.ipv6.conf.all.autoconf = 0
net.ipv6.conf.default.autoconf = 0
net.ipv6.conf.eth0.autoconf = 0
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
net.ipv6.conf.eth0.accept_ra = 0
net.core.somaxconn = 4096

Thanks.

Cory Knutson
  • 1,886
kylngr
  • 1

1 Answers1

0

You can use parameter --interface on curl to use a specific interface IP.

Configure each ip you need to use as a subinterface of eth0, and, call curl with --interface parameter. If you need to use all configured IPs, use a while.