0

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?

Noodles
  • 1,356
  • 3
  • 18
  • 29
  • 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 http://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 01: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 01:11

1 Answers1

0

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.

Michael Dillon
  • 1,809
  • 13
  • 16
  • Do you have an example of a script that would do this? – Noodles Feb 18 '11 at 01:45
  • Check this question http://serverfault.com/questions/101729/cron-job-erratic-behavior-with-bourne-shell-script 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 03:10