准备

防火墙外一台可以正常访问的服务器 eg: 192.168.1.1

v2ray-core

LinuxServer 安装和更新 V2Ray

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

LinuxServer 安装最新的 geoip.dat 和 geosite.dat

bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)

WindowsServer 安装方式

在 [Github Releases](https://github.com/v2fly/v2ray-core/releases)

    下载适用于 Windows 平台的 ZIP 压缩包,解压后可得到可执行文件 v2ray.exe,然后通过命令行带参数运行即可

修改v2ray配置

/usr/local/etc/v2ray/config.json

windows 下配置文件位置随意

{
    "log": {
        "loglevel": "warning",
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log"
    },
    "inbounds": [
        {
            "port": 30001,
            "protocol": "http",
            "settings": {
                "timeout:": 0,
                "accounts": [
                    {
                        "user": "admin",
                        "pass": "123456789"
                    }
                ],
                "allowTransparent": false,
                "userLevel": 0
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "tag": "block"
        }
    ],
    "routing": {
        "domainStrategy": "IPOnDemand",
        "rules": [
            {
                "type": "field",
                "outboundTag": "direct",
                "domain": [
                    "geosite:cn",
                    "geosite:bilibili",
                    "geosite:bilibili2"
                    "geosite:baidu",
                    "geosite:bing",
                    "geosite:zhihu"
                ]
            },
            {
                "type": "field",
                "outboundTag": "block",
                "domain": [
                    "geosite:baidu-ads",
                    "geosite:category-ads",
                    "geosite:category-ads-all"
                ]
            }
        ]
    }
}

run

linux:systemctl enable --now v2ray

windows:v2ray.exe run -c /path/to/config.json

另 windows下 删除配置

   "log": {
           "loglevel": "warning",
           "access": "/var/log/v2ray/access.log",
           "error": "/var/log/v2ray/error.log"
       },

SwitchyOmega config

proxy模式配置:协议http 服务器192.18.1.1 端口30001 用户admin 密码123456789

切换至proxy模式浏览器即可防火墙

原理

client –> server –> websiteServer