SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.84k stars 2.25k forks source link

How to make wireguard or socks5 the outgoing IP for the REALITY protocol, help me. #1987

Closed Su-Du closed 2 months ago

Su-Du commented 2 months ago

I started the reality protocol through singbox, but I have a specific need that I don't know how to write to the configuration. I have multiple wireguards running on my server, as well as socks5. I want to use wireguard and socks5 as my outgoing IPs, because many works have territorial jurisdiction, can you help me? I will buy you multiple cups of coffee.

BK8000L commented 2 months ago

port forward it through direct inbound and then connect from regular wireguard client, make sure to exclude your server ip address https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/

simplerick-simplefun commented 2 months ago

use direct outbound with interface specified for outgoing packets to wireguard tun use socks outbound for socks

Su-Du commented 2 months ago

使用指定接口的直接出站方式将数据包传到 wireguard tun, 使用 socks 出站方式发送 socks

使用指定接口的直接出站方式将数据包传到wireguard tun, 使用socks出站方式发送socks

Can you write a configuration for me? I don’t understand how to operate it. The name of my wireguard interface is: wg0, and the address monitored by socks5 is 127.0.0.1. The port is 10099.

Su-Du commented 2 months ago

使用指定接口的直接出站方式将数据包传到wireguard tun, 使用socks出站方式发送socks 可以帮我写一份配置吗?亲爱的朋友,我不理解该如何去操作,我的wireguard 接口的 名称是:wg0,socks5监听的地址是127.0.0.1端口是10099

Su-Du commented 2 months ago

通过直接入站进行端口转发,然后从常规 wireguard 客户端连接,确保排除你的服务器 ip 地址https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/

可以帮我写一份配置吗?亲爱的朋友,我不理解该如何去操作,我的wireguard 接口的 名称是:wg0,socks5监听的地址是127.0.0.1端口是10099

simplerick-simplefun commented 2 months ago

This is the most basic usage of sing-box configuration. You really need to learn the docs or else you would be asking questions for every modification you need. Ref: https://sing-box.sagernet.org/configuration/shared/dial/#bind_interface https://sing-box.sagernet.org/configuration/outbound/direct/ https://sing-box.sagernet.org/configuration/outbound/socks/

"outbounds": [
  {
    "type": "direct",
    "tag": "wg0-out",
    "bind_interface": "wg0"
  },
  {
    "type": "socks",
    "tag": "socks-out",
    "server": "127.0.0.1",
    "server_port": 10099
  }
]
Su-Du commented 2 months ago

Okay, thank you for helping me study it carefully.