V2ray_shadowsocks 使用说明 - sdh2008/shadowsocks_install_wiki GitHub Wiki
服务端安装
Linux 下安装:
安裝和更新 V2Ray:
// 安装执行程序和 .dat 数据档
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
shadowsocks协议的服务端的一般配置:
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 1024, // 监听端口
"protocol": "shadowsocks",
"settings": {
"method": "aes-128-gcm",
"ota": false, // 是否开启 OTA
"password": "sspasswd"
},
"streamSettings": {
"network": "tcp"
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "block"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
}
]
}
}
目前仅推荐使用AEAD算法:
//不同的AEAD算法根据硬件和软件库的支持不同,而效率不一样。
chacha20-IETF-poly1305 //不了解的情况使用这个
AES-256-GCM
AES-192-GCM
AES-128-GCM
管理v2ray进程服务:
systemctl start v2ray
systemctl stop v2ray
systemctl status v2ray
systemctl enable v2ray
安裝最新发行的 geoip.dat 和 geosite.dat
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)
移除 V2Ray
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh) --remove
客户端安装
shadowsocks协议的客户端配置:
{
"inbounds": [
{
"listen": "127.0.0.1",
"port": 1080, // 监听端口
"protocol": "socks", // 入口协议为 SOCKS 5
"settings": {
"auth": "noauth",
"udp": true,
"ip": "127.0.0.1"
}
},
{
"listen": "127.0.0.1",
"port": "1081",
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "serveraddr.com", // Shadowsocks 的服务器地址
"method": "aes-128-gcm", // Shadowsocks 的加密方式
"ota": false, // 是否开启 OTA,true 为开启
"password": "sspasswd", // Shadowsocks 的密码
"port": 1024
}
]
},
"streamSettings": {
"network": "tcp"
},
"tag": "proxy"
},
{
"protocol": "freedom",
"tag": "direct"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "direct"
}
]
},
}
服务器中“多IP入口”与“多IP出口”的配置
如果无需求,不需要使用此项中的配置
{
"log": {
"access": "none",
"error": "/var/log/v2ray/error.log",
"loglevel": "warning"
},
"inbounds": [
{
"listen": "ip01",
"port": 10000,
"protocol": "shadowsocks",
"settings": {
"method": "aes-128-gcm",
"ota": false,
"password": "password"
},
"tag": "in-ip01"
},
{
"listen": "ip02",
"port": 10000,
"protocol": "shadowsocks",
"settings": {
"method": "aes-128-gcm",
"ota": false,
"password": "password"
},
"tag": "in-ip02"
}
],
"outbounds": [
{
"sendThrough": "ip01",
"protocol": "freedom",
"settings": {},
"tag": "out-ip01"
},
{
"sendThrough": "ip02",
"protocol": "freedom",
"settings": {},
"tag": "out-ip02"
},
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "block"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
},
{
"type": "field",
"inboundTag": [
"in-ip01"
],
"outboundTag": "out-ip01"
},
{
"type": "field",
"inboundTag": [
"in-ip02"
],
"outboundTag": "out-ip02"
}
]
}
}
服务器中“单IP入口”与“多socks账户出口”的配置
如果无需求,不需要使用此项中的配置
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"listen": "0.0.0.0",
"port": 12345,
"protocol": "shadowsocks",
"settings": {
"method": "aes-128-gcm",
"password": "ss"
},
"streamSettings": {
"network": "tcp"
}
},
{
"listen": "0.0.0.0",
"port": 12346,
"protocol": "shadowsocks",
"settings": {
"method": "aes-128-gcm",
"password": "ss"
},
"streamSettings": {"network": "tcp"},
"tag": "in-ip01"
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"settings": {},
"tag": "block"
},
{
"protocol": "socks",
"settings": {
"servers": [{
"address": "dizhi",
"port": 2160,
"users": [
{
"user": "username",
"pass": "pwd",
"level": 0
}
]
}]
},
"tag": "out-ip01"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "block"
},
{
"type": "field",
"inboundTag": [
"in-ip01"
],
"outboundTag": "out-ip01"
}
]
},
"dns": {
"servers": [
"8.8.4.4",
"8.8.8.8"
]
}
}