Set up a Second Server for V2Ray

Even you set up the V2Ray correctly and cross GFW successfully, you will probably suffer low speed and high legacy. If you try to ping your server abroad, you will find the packet loss rate is high.

In order to explain the reason for that, I need to clarify one thing which is about network bandwidth in China. Let's say the bandwidth at your home is 1Gbps which seems super fast, but it's domestic only. All the data crossing the GFW uses the international bandwidth which is very limited in China. So 1Gbps domestic bandwidth doesn't mean anything to your experience of crossing the GFW. What we really need is a reliable network connection between your ISP and server abroad.

Here I choose the NAT from CloudIPLC. To be specific, the network it uses connects directly from Shanghai with Japan, and my server abroad is exactly in Japan. That's exactly what I need. Although the price is not cheap, but in order to get the reliable network connection, I think it's worth the price.

The process of setting up V2Ray on the NAT server is almost the same as that on the server abroad. You just need to modify the configuration file. Here is the configuration file I use on the NAT server.

{
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbounds": [
        {
            "port": 13228,
            "protocol": "vmess",
            "settings": {
                "clients": [
                    {
                        "id": "738b9584-82cd-40a6-810d-25b3c2133961",
                        "level": 1,
                        "alterId": 32
                    }
                ]
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "vmess",
            "settings": {
                "vnext": [
                    {
                        "address": "8.8.8.8",
                        "port": 10086,
                        "users": [
                            {
                                "id": "738b9584-82cd-40a6-810d-25b3c2133961"
                            }
                        ]
                    }
                ]
            }
        },
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "block"
        },
        {
            "protocol": "freedom",
            "tag": "direct",
            "settings": {}
        }
    ]
}

Replace the value of port and client id in inbounds (will be used by client devices), address, port and client id in outbounds (from your server abroad). That's all. Restart V2Ray to make the new configuration file work.

In terms of configuration of client devices, just replace the value of address, port and client id with the value from inbounds above.

Detailed information could be found on my gist. Hopefull it will improve your experience of crossing GFW.