Back to articles
AI & Cloud

Detailed Guide to Creating a Rotating Proxy from Free IPv6 Range on Personal VPS

A detailed guide on how to create a rotating proxy from a free IPv6 range on a personal VPS, using IPv6 to generate anonymous, secure, and effective rotating proxies for web...

DPTCloud Engineering4 min read
Detailed Guide to Creating a Rotating Proxy from Free IPv6 Range on Personal VPS

Creating a rotating proxy from a free IPv6 range on a personal VPS is an effective, low-cost, and secure solution for tasks such as web scraping, automation, website testing, and accessing geo-restricted content. With the growing adoption of IPv6, many VPS providers now offer free IPv6 blocks, enabling users to easily deploy anonymous rotating proxies without additional expenses.

Prerequisites and Setup

To follow this guide, you will need:

  • 1 personal VPS (with IPv6 support)
  • SSH access to the VPS (usually as root)
  • Familiarity with Linux terminal commands
  • IPv6 enabled on the VPS (verify with ip -6 addr show)
  • Software such as iptables, socat, or nginx for proxy configuration

Creating a Rotating Proxy from IPv6

We will use IPv6 link-local or IPv6 global addresses to create a rotating proxy. Below are the detailed steps:

Step 1: Check and Enable IPv6

On your VPS, verify that IPv6 is enabled:

ip -6 addr show

If you see IPv6 addresses in the format 2001:db8:.../64 or fe80::..., IPv6 is ready to use.

Step 2: Configure Proxy Using socat

Use socat to create a forwarding proxy from IPv6 to a target port. For example, to create a proxy on port 8080:

sudo socat TCP-LISTEN:8080,fork TCP6:target.com:80

Replace target.com with the website you want to access. This command sets up a proxy listening on port 8080, forwarding all requests via IPv6.

Step 3: Automate Rotating Proxy

To create a rotating proxy, we need to change the IPv6 address with each connection. One simple method is to use IPv6 link-local addresses (e.g., fe80::...) or run a script to select a random IPv6 address from the assigned range.

Use the following script to pick a random IPv6 address and start a proxy:

#!/bin/bash
# Get list of IPv6 addresses from VPS
ipv6_list=$(ip -6 addr show | grep inet6 | grep global | awk '{print $2}' | cut -d'/' -f1)

# Select a random IPv6 address
selected_ipv6=$(echo "$ipv6_list" | shuf -n 1)

# Start socat with selected IPv6
socat TCP-LISTEN:8080,fork TCP6:$selected_ipv6:80

This script randomly selects an IPv6 address from the available range and creates a proxy on port 8080. Each run will use a different IP—this is the foundation of a rotating proxy.

Testing and Verification

To verify the proxy works, use curl with the created proxy:

curl -x http://localhost:8080 http://ipinfo.io/json

This returns your current IP address. If the result is an IPv6 address and changes with each request, the rotating proxy is functioning correctly.

Advanced Solution: Use Nginx as Reverse Proxy

For a more robust proxy setup, you can use nginx as a reverse proxy, which supports features such as:

  • Routing based on IPv6 addresses
  • Access logging
  • Blocking invalid requests

Configure /etc/nginx/nginx.conf as follows:

http {
    server {
        listen 8080;
        location / {
            proxy_pass http://[2001:db8:...]:80;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
}

Replace [2001:db8:...] with your actual IPv6 address.

Alternative Solution: Create Proxy from 4G SIM

If you need a more dynamic proxy with mobile IP addresses, consider combining your VPS with a 4G SIM. This provides mobile IP rotation and is ideal for unlimited data scraping. See the detailed guide: Creating Rotating Mobile Proxies from VPS and 4G SIM.

Troubleshooting

  • No IPv6 found: Check your VPS network configuration to ensure IPv6 is enabled.
  • Connection fails: Verify firewall rules (ufw, iptables) allow port 8080.
  • Proxy not rotating: Ensure the script selecting IPv6 runs correctly and updates the address.

References

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478