Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a /48 IPv6 and would like to chop these up into /112's that I can assign to my VPSes. I know how to assign them manually, e.g.

vzctl set 1 --ipadd ipv6IP --save

But how could I assign, for example, a full /112 at once?

share|improve this question
1  
You want to assign "a full /112 at once" to what? –  Steven Monday Jan 28 '11 at 15:58
    
+1 for being IPv6. –  Tom O'Connor Jan 28 '11 at 16:25
add comment

2 Answers

up vote 3 down vote accepted

Use veth. In VE:

/sbin/ip -6 addr add IPv6_ADDR/112 dev eth0
share|improve this answer
    
In the virtual machine?? –  Daniel Jan 28 '11 at 6:15
    
Yes, in the virtual machine. –  alvosu Jan 29 '11 at 15:55
    
I don't want to be able to assign them in the VE i want to assign them from the host node. E.G. if i sold some vpses i don't want just anyone to take their own amount of ipv6 –  Daniel Jan 31 '11 at 7:10
add comment

That takes several steps:

  1. In the CT0 (the "host"), add a veth to the VE (the "VM"):

    vzctl set <CTID> --netif_add eth0
    
  2. In the CT0, enable IPv6 forwarding (net.ipv6.conf.all.forwarding=1 will do that, temporarily. Consult the docs of your OS for how to make that permanent.)

  3. In the CT0, add a route for the /112 to the VE's virtual interface. For example, assuming your VE has a CTID 1:

    ip -6 route add IP6_NET/112 dev veth1.0
    
  4. This concludes the setup in the CF0.

  5. Now, finally, in your VE add addresses you want to use (from the subnet) to the VE's eth0:

    ip -6 addr add IP6_IP dev eth0
    
share|improve this answer
    
Great thanks! will try it soon –  Daniel Feb 24 '11 at 3:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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