Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Adding large numbers of IPv6 addresses?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Sun Feb 07, 2010 5:25 am    Post subject: [SOLVED] Adding large numbers of IPv6 addresses? Reply with quote

I know that /etc/conf.d/net supports:

Code:

config_eth0=(
   "172.20.20.21/24"
   "2001:0DB8:beaf::2/64"
   "2001:0DB8:beaf::7/64"
   "2001:0DB8:beaf::6/64"
   "2001:0DB8:beaf::5/64"
   "2001:0DB8:beaf::4/64"
   "2001:0DB8:beaf::3/64"
)


but is there an easier way? It looks like:

Code:
# Or you can use sequence expressions
#config_eth0=( "192.168.0.{2..4}/24" )
# which does the same as above.


would let me do:

Code:

config_eth0=(
   "172.20.20.21/24"
   "2001:0DB8:beaf::{2..7}/64"
)


Does anyone know if that will work?
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Sun Feb 07, 2010 5:28 am    Post subject: Reply with quote

It works! I now have 100 IPv6 addresses! SSL!
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Sun Feb 07, 2010 9:21 am    Post subject: Reply with quote

As a side note, it might be worth pointing out that "2001:0DB8:beaf::{1..100}/64" didn't necessarily do what might be expected; it used 1..100 as a decimal and so the IP addresses were not in order (as IPv6 expressed that way is hex), so it went from ::9 to ::10 and skipped ::A through ::F.
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Tue Feb 09, 2010 9:07 pm    Post subject: Reply with quote

Yes, that's just globbing and is expanded by bash. Try this for example:

Code:
echo {1..100}

_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum