I've just got a new server with native ipv6. I want to attach multiple ipv6 ips to eth1, but the only way I can see to do so is to attach them individually:

i.e.

address 2607:f0d0:xxxx:xxxx::2
address 2607:f0d0:xxxx:xxxx::3
address 2607:f0d0:xxxx:xxxx::4

Is it possible to bind whole subnets of ipv6 to a single network interface on debian? My server host tells me I have 18,446,744,073,709,551,616 ipv6 addresses for that server, surely it gets to be a nightmare to manage if they all have to bound individually (plus ifconfig would look messy).

Does anyone have a solution?

link|improve this question

67% accept rate
Did you try address 2607:f0d0:xxxx:xxxx::1/64? That's how you'd do it from the commandline with either ifconfig or ip according to tldp.org/HOWTO/Linux+IPv6-HOWTO/x1035.html – DerfK Feb 16 '11 at 22:45
I have not tried this, but to me it does not make sense letting your server listen to an entire /64. It would basically cause you to set rules in your firewall for each of those IP addresses. – Frands Hansen Feb 16 '11 at 23:10
2  
This begs the question of why do you want to listen to all 18,446,744,073,709,551,616 addresses!! Setup only what you need. Then the management should be easy enough. – Niall Donegan Feb 17 '11 at 1:19
I was thinking more of setting up /127 or something. I don't foresee using 18,446,744,073,709,551,616 addresses in apache etc :) – Noodles Feb 18 '11 at 1:11
feedback

1 Answer

The usual way to do this is with a loop in a shell script so that you don't have a huge block of repeated almost identical commands. The timing shouldn't matter a whole lot as long as you get it done before starting up an application (Apache?) that depends on the addresses.

link|improve this answer
Do you have an example of a script that would do this? – Noodles Feb 18 '11 at 1:45
Check this question serverfault.com/questions/101729/… and skip down to where it says for SUFFIX in $HOSTLIST. Or, read the bash man pages and skip down to "Compund Commands". – Michael Dillon Feb 18 '11 at 3:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.