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?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Use veth. In VE:
/sbin/ip -6 addr add IPv6_ADDR/112 dev eth0
That takes several steps:
In the CT0 (the "host"), add a veth to the VE (the "VM"):
vzctl set <CTID> --netif_add eth0
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.)
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
This concludes the setup in the CF0.
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