Currently I have a VPS where I use different ips as interfaces, like curl google.com --ipv4 --interfaces venet0:1
The vps has ipv4 and some ipv6. Usually the vps are managed with OpenVZ, Xen, or any of these that automatically generate interfaces configurations.
This is my /etc/network/interfaces file:
auto lo iface lo inet loopback
auto venet0 iface venet0 inet manual
up ifconfig venet0 up
up ifconfig venet0 127.0.0.2
up route add default dev venet0
down route del default dev venet0
down ifconfig venet0
down iface venet0 inet6 manual
up ifconfig venet0 add 2607:ff28:0:a::XXXX:XXXX/128
down ifconfig venet0 del 2607:ff28:0:a::XXXX:XXXX/128
up ifconfig venet0 add 2607:ff28:0:a::XXXX:XXXX/128
down ifconfig venet0 del 2607:ff28:0:a::XXXX:XXXX/128
up route -A inet6 add default dev venet0
down route -A inet6 del default dev venet0
auto venet0:0 iface venet0:0 inet static
address 173.213.XX.XX
netmask 255.255.255.255
(here come the successive venet0:1 venet0:2, etc depending on ipv4 that are available.)
When using the ipv4 through interfaces, there is not problem. The case is that I want to use the ipv6 interfaces like style venet0:X.
It's possible? How I can do this?
Thanks