V2ray-core: 弄好了V2ray,时间也跟本地对上了,也正常启动了,但是无法科学上网,请大神门看下是什么问题,萌新求教。

Created on 16 Jun 2019  ·  15Comments  ·  Source: v2ray/v2ray-core

提交 Issue 之前请先阅读 Issue 指引,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion进行讨论。

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
4.19.1
2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
通过chrome
3) 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
配置正常,但无法翻墙,完全是按照网上说的方法弄得,但是就是不能用
4) 你期待看到的正确表现是怎样的?
希望正常科学上网
5) 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:

  {
    "log": {
        "access": "/var/log/v2ray/access.log",
        "error": "/var/log/v2ray/error.log",
        "loglevel": "warning"
    },
    "inbound": {
        "port": 25482,
        "protocol": "vmess",
        "settings": {
            "clients": [
                {
                    "id": "e45c6102-4fff-d0b5-bc2a-4914be7bb598",
                    "level": 1,
                    "alterId": 101
                }
            ]
        }
    },
    "outbound": {
        "protocol": "freedom",
        "settings": {}
    },
    "inboundDetour": [],
    "outboundDetour": [
        {
            "protocol": "blackhole",
            "settings": {},
            "tag": "blocked"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "blocked"
                }
            ]
        }
    }
}

客户端配置:

  {
    "log": {
        "loglevel": "warning"
    },
    "inbound": {
        "listen": "127.0.0.1",
        "port": 1082,
        "protocol": "socks",
        "settings": {
            "auth": "noauth",
            "udp": true,
            "ip": "127.0.0.1"
        }
    },
    "outbound": {
        "protocol": "vmess",
        "settings": {
            "vnext": [
                {
                    "address": "140.82.62.99",
                    "port": 25482,
                    "users": [
                        {
                            "id": "e45c6102-4fff-d0b5-bc2a-4914be7bb598",
                            "level": 1,
                            "alterId": 101
                        }
                    ]
                }
            ]
        }
    },
    "outboundDetour": [
        {
            "protocol": "freedom",
            "settings": {},
            "tag": "direct"
        }
    ],
    "routing": {
        "strategy": "rules",
        "settings": {
            "rules": [
                {
                    "type": "field",
                    "port": "54-79",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "81-442",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "port": "444-65535",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "domain": [
                        "gc.kis.scr.kaspersky-labs.com"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "chinasites",
                    "outboundTag": "direct"
                },
                {
                    "type": "field",
                    "ip": [
                        "0.0.0.0/8",
                        "10.0.0.0/8",
                        "100.64.0.0/10",
                        "127.0.0.0/8",
                        "169.254.0.0/16",
                        "172.16.0.0/12",
                        "192.0.0.0/24",
                        "192.0.2.0/24",
                        "192.168.0.0/16",
                        "198.18.0.0/15",
                        "198.51.100.0/24",
                        "203.0.113.0/24",
                        "::1/128",
                        "fc00::/7",
                        "fe80::/10"
                    ],
                    "outboundTag": "direct"
                },
                {
                    "type": "chinaip",
                    "outboundTag": "direct"
                }
            ]
        }
    }
}

7) 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

    // 

6) 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。

服务器端错误日志:

 按照上面的路径输入了,但是显示'No such file or directory',这里就不放日志了,没找到......

客户端错误日志:

在这里附上服务器端日志

8) 其它相关的配置文件(如 Nginx)和相关日志。

9) 如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json。请按实际情况修改。

10) 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray

请预览一下你填的内容再提交。

Most helpful comment

VPS的防火墙开放 25482端口了么?

好像是没有,不懂命令,大佬能说下设置的命令吗

centos7 的vps?如果是,那么命令如下

firewall-cmd --permanent --zone=public --add-port=25482/tcp
firewall-cmd --permanent --zone=public --add-port=25482/udp
firewall-cmd --reload
firewall-cmd --list-all

All 15 comments

VPS的防火墙开放 25482端口了么?

Leo-CJ notifications@github.com 于2019年6月16日周日 下午9:58写道:

提交 Issue 之前请先阅读 Issue 指引
https://github.com/v2ray/v2ray-core/blob/master/.github/SUPPORT.md
,然后回答下面的问题,谢谢。
除非特殊情况,请完整填写所有问题。不按模板发的 issue 将直接被关闭。
如果你遇到的问题不是 V2Ray 的 bug,比如你不清楚要如何配置,请使用Discussion
https://github.com/v2ray/discussion/issues进行讨论。

  1. 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
    4.19.1
  2. 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
    通过chrome
  3. 你看到的不正常的现象是什么?(请描述具体现象,比如访问超时,TLS 证书错误等)
    配置正常,但无法翻墙,完全是按照网上说的方法弄得,但是就是不能用
  4. 你期待看到的正确表现是怎样的?
    希望正常科学上网
  5. 请附上你的配置(提交 Issue 前请隐藏服务器端IP地址)。

服务器端配置:
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbound": {
"port": 25482,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "e45c6102-4fff-d0b5-bc2a-4914be7bb598",
"level": 1,
"alterId": 101
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"inboundDetour": [],
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}

// 在这里附上服务器端配置文件

客户端配置:

// 在这里附上客户端配置

{
"log": {
"loglevel": "warning"
},
"inbound": {
"listen": "127.0.0.1",
"port": 1082,
"protocol": "socks",
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1"
}
},
"outbound": {
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "140.82.62.99",
"port": 25482,
"users": [
{
"id": "e45c6102-4fff-d0b5-bc2a-4914be7bb598",
"level": 1,
"alterId": 101
}
]
}
]
}
},
"outboundDetour": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"port": "54-79",
"outboundTag": "direct"
},
{
"type": "field",
"port": "81-442",
"outboundTag": "direct"
},
{
"type": "field",
"port": "444-65535",
"outboundTag": "direct"
},
{
"type": "field",
"domain": [
"gc.kis.scr.kaspersky-labs.com"
],
"outboundTag": "direct"
},
{
"type": "chinasites",
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "direct"
},
{
"type": "chinaip",
"outboundTag": "direct"
}
]
}
}
}
6) 请附上出错时软件输出的错误日志。在 Linux 中,日志通常在 /var/log/v2ray/error.log 文件中。
按照上面的路径输入了,但是显示'No such file or directory',这里就不放日志了,没找到......
服务器端错误日志:

// 在这里附上服务器端日志

客户端错误日志:

// 在这里附上客户端日志
  1. 请附上访问日志。在 Linux 中,日志通常在 /var/log/v2ray/access.log 文件中。

    // 在这里附上服务器端日志

    1.

    其它相关的配置文件(如 Nginx)和相关日志。
    2.

    如果 V2Ray 无法启动,请附上 --test 输出。

通常的命令为 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json
。请按实际情况修改。

  1. 如果 V2Ray 服务运行不正常,请附上 journal 日志。

通常的命令为 journalctl -u v2ray。

请预览一下你填的内容再提交。


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/v2ray/v2ray-core/issues/1755?email_source=notifications&email_token=AHY5H45JVZSQ44UJUDTFDDLP2ZBIDA5CNFSM4HYRHPMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZX223A,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AHY5H4YMXRWBCW7CQLASGILP2ZBIDANCNFSM4HYRHPMA
.

VPS的防火墙开放 25482端口了么?

好像是没有,不懂命令,大佬能说下设置的命令吗

VPS的防火墙开放 25482端口了么?

好像是没有,不懂命令,大佬能说下设置的命令吗

centos7 的vps?如果是,那么命令如下

firewall-cmd --permanent --zone=public --add-port=25482/tcp
firewall-cmd --permanent --zone=public --add-port=25482/udp
firewall-cmd --reload
firewall-cmd --list-all

VPS的防火墙开放 25482端口了么?

好像是没有,不懂命令,大佬能说下设置的命令吗

centos7 的vps?如果是,那么命令如下

firewall-cmd --permanent --zone=public --add-port=25482/tcp
firewall-cmd --permanent --zone=public --add-port=25482/udp
firewall-cmd --reload
firewall-cmd --list-all

是centos7的,按照上面的设置好了,但是还是不行,上网页的时候,v2ray提示这个:
failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [dial tcp 140.82.62.99:25482: connectex: No connection could be made because the target machine actively refused it.] > v2ray.com/core/common/retry: all retry attempts failed

提交 Issue 前请隐藏服务器端IP地址

换ubuntu试试,centos巨多问题。
ubuntu下:sudo ufw allow "your port" (自己输入时去掉冒号,把your port改成你的端口号)
如果有提示防火墙没开启输入:sudo ufw enable (回复y开启),然后重复上面步骤。

楼上....centos没有问题的, 大型网络公司等等都在用. 我之前的旧梯子跑在centos上混着nginx一两年, 稳定得我怀疑人生.

楼主, 你的配置

"type": "chinasites", 是什么鬼

官方文档说,

type: "field" 目前只支持"field"这一个选项。

请使用
` {
"type":"field",
"ip":[
"geoip:private"
],
"outboundTag":"direct"
},

  {
    "type":"field",
    "ip":[
      "geoip:cn"
    ],      
    "outboundTag":"direct"
  }`

类似这样得来替代.

楼主你的问题, 我觉得一步一步来解决(看起来像是端口没开, 但其他的可能性也很多)
第一步, 先排除防火墙, 从网上搜命令把你的centos防火墙彻底关闭试一下.
第二步, 如果防火墙关闭后无效, 请使用神一样工具们 "4.x 版本的配置文件生成器 veekxt.com", 生成一个最稳当的, 绝对不会出错的配置文件, 来试一下
第三步, 进入玄学领域: 你的主机提供商可能有"防火墙外的防火墙", 装一个网页服务器nginx之类, 随机开一个端口类似于51284, 看看能不能访问网页, 如果不能请和主机上联系. 也有可能你的服务器端口就是被GFW墙了(我现在之所以用ws协议藏在公司网站下就是因为之前使用普通vmess被封了)

查看日志显示“No such file or directory”说明软件根本就没起起来,还分析个鬼。
执行 ss -nptl | grev v2ray 看看v2ray有没有在监听25482这个端口,或者执行sudo ps -aux | grep v2ray看看有没有v2ray的进程存在。
执行 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json检查配置文件有没有错误。如果没有错误,你得到的回应是这样的:
V2Ray 4.19.1 (Let's Fly) Custom
A unified platform for anti-censorship.
Configuration OK.

v2ray是否能工作跟时间是否与本地准并无关联性,而vps端大多自带NTP,也就是时间并不会有误差,时间错误可作为最后的排除项。

查看日志显示“No such file or directory”说明软件根本就没起起来,还分析个鬼。
执行 ss -nptl | grev v2ray 看看v2ray有没有在监听25482这个端口,或者执行sudo ps -aux | grep v2ray看看有没有v2ray的进程存在。
执行 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json检查配置文件有没有错误。如果没有错误,你得到的回应是这样的:
V2Ray 4.19.1 (Let's Fly) Custom
A unified platform for anti-censorship.
Configuration OK.

配置文件没问题,但是没法运行,直接./v2ray就会出现
V2Ray 4.20.0 (V2Fly, a community-driven edition of V2Ray.) Custom
A unified platform for anti-censorship.
main: failed to load config: > v2ray.com/core/main/confloader/external: config file not readable > open : no such file or directory
这种找不到的问题,
看进程的话有这两个
root 20608 0.0 2.7 118768 14320 ? Ssl 01:57 0:20 /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
root 21036 0.0 0.4 112656 2232 pts/0 S+ 22:52 0:00 grep --color=auto v2ray
所以这是个啥问题

查看日志显示“No such file or directory”说明软件根本就没起起来,还分析个鬼。
执行 ss -nptl | grev v2ray 看看v2ray有没有在监听25482这个端口,或者执行sudo ps -aux | grep v2ray看看有没有v2ray的进程存在。
执行 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json检查配置文件有没有错误。如果没有错误,你得到的回应是这样的:
V2Ray 4.19.1 (Let's Fly) Custom
A unified platform for anti-censorship.
Configuration OK.

配置文件没问题,但是没法运行,直接./v2ray就会出现
V2Ray 4.20.0 (V2Fly, a community-driven edition of V2Ray.) Custom
A unified platform for anti-censorship.
main: failed to load config: > v2ray.com/core/main/confloader/external: config file not readable > open : no such file or directory
这种找不到的问题,
看进程的话有这两个
root 20608 0.0 2.7 118768 14320 ? Ssl 01:57 0:20 /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
root 21036 0.0 0.4 112656 2232 pts/0 S+ 22:52 0:00 grep --color=auto v2ray
所以这是个啥问题

main: failed to load config: > v2ray.com/core/main/confloader/external: config file not readable > open : no such file or directory

还是配置的问题吧?根本没有配置文件?

查看日志显示“No such file or directory”说明软件根本就没起起来,还分析个鬼。
执行 ss -nptl | grev v2ray 看看v2ray有没有在监听25482这个端口,或者执行sudo ps -aux | grep v2ray看看有没有v2ray的进程存在。
执行 /usr/bin/v2ray/v2ray --test --config /etc/v2ray/config.json检查配置文件有没有错误。如果没有错误,你得到的回应是这样的:
V2Ray 4.19.1 (Let's Fly) Custom
A unified platform for anti-censorship.
Configuration OK.

配置文件没问题,但是没法运行,直接./v2ray就会出现
V2Ray 4.20.0 (V2Fly, a community-driven edition of V2Ray.) Custom
A unified platform for anti-censorship.
main: failed to load config: > v2ray.com/core/main/confloader/external: config file not readable > open : no such file or directory
这种找不到的问题,
看进程的话有这两个
root 20608 0.0 2.7 118768 14320 ? Ssl 01:57 0:20 /usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
root 21036 0.0 0.4 112656 2232 pts/0 S+ 22:52 0:00 grep --color=auto v2ray
所以这是个啥问题

main: failed to load config: > v2ray.com/core/main/confloader/external: config file not readable > open : no such file or directory

还是配置的问题吧?根本没有配置文件?
重装一下系统就好了。应该是个奇怪的系统冲突

配置文件没问题,但是没法运行,直接./v2ray就会出现

v2ray 好像不会默认给加一个配置文件路径,所以接./v2ray 出现你的那个结果是正常的。
您的v2ray 已经在运行了,暂时不知道问题和在。如果还是看不到日志文件,可以分别在客户端和服务器端分别抓包看看数据包有没有被正确传送。
在这公共的地方留邮箱也不安全,请找个身边的人帮你弄弄吧。

配置文件没问题,但是没法运行,直接./v2ray就会出现

v2ray 好像不会默认给加一个配置文件路径,所以接./v2ray 出现你的那个结果是正常的。
您的v2ray 已经在运行了,暂时不知道问题和在。如果还是看不到日志文件,可以分别在客户端和服务器端分别抓包看看数据包有没有被正确传送。
在这公共的地方留邮箱也不安全,请找个身边的人帮你弄弄吧。

之前是系统版本有点低,一直启动不了,换了新一点的就好了。谢谢啦

VPS的防火墙开放 25482端口了么?

好像是没有,不懂命令,大佬能说下设置的命令吗

centos7 的vps?如果是,那么命令如下

firewall-cmd --permanent --zone=public --add-port=25482/tcp
firewall-cmd --permanent --zone=public --add-port=25482/udp
firewall-cmd --reload
firewall-cmd --list-all

是centos7的,按照上面的设置好了,但是还是不行,上网页的时候,v2ray提示这个:
failed to handler mux client connection > v2ray.com/core/proxy/vmess/outbound: failed to find an available destination > v2ray.com/core/common/retry: [dial tcp 140.82.62.99:25482: connectex: No connection could be made because the target machine actively refused it.] > v2ray.com/core/common/retry: all retry attempts failed

It helps me,thanks

Was this page helpful?
0 / 5 - 0 ratings