2

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?

1
  • 2
    You want to assign "a full /112 at once" to what? – Steven Monday Jan 28 '11 at 15:58
4

Use veth. In VE:

/sbin/ip -6 addr add IPv6_ADDR/112 dev eth0
3
  • 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
0

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
    
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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