How to configure IPv6 address in VPS

kencheweb

Junior Member
Jr. VIP
Joined
Oct 3, 2017
Messages
125
Reaction score
36
I recently bought a VPS hosting which came with 1 IPv4 & 4 IPv6 addresses.
I have already set a domain and its running fine with IPv4 address.

I have SSH access and webmin access - how can I enable the IPv6 addresses?
I want to use it in my PHP/cURL script - CURLOPT_INTERFACE - so when I make a curl request to an external site - it should see the IPv6 as the remote IP address.

Any help on this is appreciated...
 
Lots of resources on the web if you do a simple google search you should be able to find the answer.

Or reach out to your web host and they should be able to help set that up for you.
 
Contacted host - but they say the IPs are already enabled but cant support for curl script as its a unmanaged server.
I tried to add the IP thru CURLOPT_INTERFACE and get the following error:
cURL Error (45): bind failed with errno 22: Invalid argument

However in SSH access - if I give curl -v ipv6.google.com
It works fine.
 
Check with your server provider (DC) if they provide IPv6 for your server. If so then you will need to add following ipv6 configuration within your Ethernet configuration eth0 (/etc/sysconfig/network-scripts/ifcfg-eth0)


IPV6INIT=yes
IPV6ADDR=<IPv6-IP-Address>
IPV6_DEFAULTGW=<IPv6-IP-Gateway-Address>


**Get the details from server and update in above configuration accordingly.
 
the interface is named as venet0 and venet0_0
Host says ipv6 is up and running and they also showed the test result

====================================================================================
As we see Ipv6 is already enabled and working inside your VPS:
[root@server /]# ping6 ipv6.google.com
PING ipv6.google.com(fra15s22-in-x0e.1e100.net (2a00:1450:4001:81f::200e)) 56 data bytes
64 bytes from fra15s22-in-x0e.1e100.net (2a00:1450:4001:81f::200e): icmp_seq=1 ttl=56 time=5.16 ms
64 bytes from fra15s22-in-x0e.1e100.net (2a00:1450:4001:81f::200e): icmp_seq=2 ttl=56 time=5.56 ms
64 bytes from fra15s22-in-x0e.1e100.net (2a00:1450:4001:81f::200e): icmp_seq=3 ttl=56 time=5.19 ms
64 bytes from fra15s22-in-x0e.1e100.net (2a00:1450:4001:81f::200e): icmp_seq=4 ttl=56 time=5.21 ms
^C
--- ipv6.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 5.164/5.282/5.562/0.170 ms

Sorry, but we cannot help your with programs/software insideyour VPS,
====================================================================================



Here is what I have in
/etc/sysconfig/network-scripts/venet0

NAME=""
BOOTPROTO=none
MACADDR=""
IPV6INIT=yes
DEVICE=venet0
MTU=""
NETMASK=255.255.255.255
BROADCAST=176.9.192.227
IPV6ADDR=2a01:4f8:151:8144::dca2:c302/128
ARPCHECK=no
IPADDR=127.0.0.1
NETWORK=127.0.0.1
IPV6ADDR_SECONDARIES="2a01:4f8:151:8144::37ef:6a90/128 2a01:4f8:151:8144::d3f7:6dc3/128 2a01:4f8:151:8144::dac8:93c5/128 2a01:4f8:151:8144::d576:b094/128"
ONBOOT=yes


And in
/etc/sysconfig/network-scripts/venet0_0
DEVICE=venet0:0
ONBOOT=yes
ARPCHECK="no"
IPADDR=176.9.192.227
NETMASK=255.255.255.255

Can someone guide with the correct value for these configurations above so that the IPv6 addresses are usable in curl
 
Back
Top