How to access IPv4 at IPv6-only VPS
Background
Here I bought a (almost-)free VPS from euserv, which is IPv6-only VPS.
But, there is still many website only support IPv4, i.e. GitHub.
At last post, we introduce a way IPv6 ssh login from IPv4 net.
At this post, we will introduce a way to access IPv4 net from IPv6-only VPS.
Get config
CloudFlare provide wireguard capability, which basicly is a VPN.
We use WARP-GO to get wireguard config:https://replit.com/@misaka-blog/warpgo-profile-generator
Run it, and get config.
1 | |
For IPv6-only,
- Peer.Endpoint only could be IPv6 address, which is
[2606:4700:d0::a29f:c001].
You could usedig engage.cloudflareclient.com aaaato get latest record. - We just use CloufFlare to forward IPv4 traffic, so keep
AllowedIPs = 0.0.0.0/0, and comment outAllowedIPs = ::/0.
Put configuration into file /etc/wireguard/wgcf.conf
Install dependency and build wireguard-go
1 | |
Run & Test
Use wg-quick to start WireGuard:
1 | |
Then run ip addr, and we could see a network card named wgcf, which has IPv4 address:
1 | |
At this moment, this VPS could visit IPv6 and IPv4 network.
Auto-Start
Firstly, turn down wgcf manually,
1 | |
After that, try to turn up wgcf by systemd:
1 | |