[Needs Testing] Transparent Proxy Qube with sing-box

What if you specify IPv4?

curl -4 -U user:password -x socks5h://1.2.3.4:12345 https://ip.me

Still same output!

Maybe your proxy is IPv6-only?
I don’t have IPv6 connection to test so I don’t know if this could be the problem.

Try to run this command for a test:

curl -4 -U user:password -x socks5h://1.2.3.4:12345 https://9.9.9.9

Proxy provides me a url to change ip, changed it a few times and now i got ipv4 address, trying again!

Now when running curl https://ip.me in sys-proxy I see an outbound connection to 212.102.35.236 but there is no response…

Did you restart the sys-proxy after applying the nft rules from above for a test with sys-whonix to reset them?
Is this command successful in sys-proxy if you stop sing-box?

curl -U user:password -x socks5h://1.2.3.4:12345 https://ip.me

This gives me the IP as response! But regarding nft rules, you mean the last rules you posted? Thought they were only for the specific test with sys-whonix… Started from beginning only with the nft rules you mentioned earlier…

If you use sing-box config based on whonix.json but with your outbound proxy settings then what’s the output of this command?

curl -x socks5h://127.0.0.1:2080 https://ip.me

Yes, I just wanted to make sure that you didn’t have them.

There is no output…

What’s the output of these commands in sys-proxy?

sudo nft list ruleset
ip a
ip rule
ip route show table 2022

Also what’s the output of this command?

curl -x socks5h://127.0.0.1:2080 https://9.9.9.9

also no output…

If you use domain name in the outbound instead of IP address then you need to redirect DNS request to it through the system DNS server instead of the remote DNS server that is configured to be accessed through the outbound proxy e.g. like this:

{
  "log": {
    "disabled": false,
    "level": "info",
    "output": "",
    "timestamp": true
  },
 "dns": {
    "rules": [
      {
        "outbound": "direct",
        "server": "local"
      },
      {
        "domain": ["your.proxy.com"],
        "server": "local"
      },
      {
         "outbound": "proxy",
         "server": "remote"
      }
    ],
    "servers": [
      {
        "tag": "remote",
        "address": "tls://1.1.1.1"
      },
      {
        "tag": "local",
        "address": "local",
        "detour": "direct"
      }
    ],
    "strategy": "prefer_ipv4"
  },
  "inbounds": [
    {
      "type": "socks",
      "tag": "socks-in",
      "listen": "127.0.0.1",
      "listen_port": 2080
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "interface_name": "singtun0",
      "inet4_address": "10.139.1.0/30",
      "strict_route": true,
      "auto_route": true,
      "inet4_route_exclude_address": [
        "10.137.0.0/16",
        "10.138.0.0/16"
      ],
      "inet6_route_exclude_address": [
        "fd09:24ef:4179::a89:0/112",
        "fd09:24ef:4179::a8a:0/112"
      ],
      "sniff": true
    }
  ],
  "outbounds": [
    {
      "tag": "proxy",
      "type": "socks",
      "server": "your.proxy.com",
      "server_port": 12345,
      "version": "5",
      "username": "user",
      "password": "pass",
      "network": "tcp"
      #"udp_over_tcp": false
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    }
  ],
  "route": {
    "geosite": {
      "path": "/usr/local/share/sing-box/geosite.db"
    },
    "geoip": {
      "path": "/usr/local/share/sing-box/geoip.db"
    },
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
      {
        "geosite": "category-ads-all",
        "outbound": "block"
      },
      {
        "geosite": "cn",
        "geoip": "cn",
        "outbound": "direct"
      },
      {
        "geosite": "private",
        "geoip": "private",
        "outbound": "direct"
      }
    ],
    "auto_detect_interface": true
  }
}