Pull to refresh
0
0
Send message

Использую raspberry pi 4 на котором крутится openwrt с Passwall2, подключенный через vlan к микротик, поэтому проблем с памятью нет.

Да, через route rule можно заставить один хост в сети ходить полностью через "туннель":

{
	"source": ["192.168.0.100"],
	"outboundTag": "proxy",
	"type": "field"
}

Рабочего конфига для sing-box у меня нет, поскольку на роутере я использую PassWall2, но есть конфиг для Xray с теми же правилами:

{
    "dns":
      {
        "disableFallbackIfMatch": true,
        "hosts": {
          "dns.google": "8.8.8.8"
        },
        "queryStrategy": "UseIPv4",
        "servers": [
          "1.1.1.1"
        ]
      },
    "log":
      {
        "error": "/var/log/xray/error.log",
        "loglevel": "warning"
      },
    "inbounds": [
      {
        "port": 12345,
        "protocol": "dokodemo-door",
        "settings": {
          "network": "tcp,udp",
          "followRedirect": true
        },
        "sniffing": {
          "destOverride": [
            "http",
            "tls",
            "quic"
          ],
          "enabled": true
        },
        "streamSettings": {
          "sockopt": {
            "tproxy": "tproxy"
          }
        },
        "tag": "all-in"
      },
    ],
    "outbounds": [
	{
      "tag": "proxy",
      "protocol": "vless",
      "settings": {
         "vnext":
         [{
            "address": "1.2.3.4",
            "port": 443,
            "users":
            [{
               "id": "drEwvgYhS15C",
               "encryption": "none",
               "security": "auto",
               "level": 8
             }]
         }]
      },
      "streamSettings": {
        "network": "grpc",
        "grpcSettings": {
            "multiMode": false,
            "serviceName": ""
        },
        "realitySettings": {
          "allowInsecure": false,
          "fingerprint": "chrome",
          "publicKey": "OBR2JYROQB8odK5glVW_KLnsWl3UZ-voyGq_9ihQgTI",
          "serverName": "www.yahoo.com",
          "shortId": "d49d578f280fd83a",
          "show": false,
          "spiderX": ""
        },
        "security": "reality",
        "sockopt": {
          "mark": 2
        }
      }
     },
     {
        "protocol": "freedom",
		"tag": "direct",
		"streamSettings": {
          "sockopt": {
            "mark": 2
          }
        }
      },
      {
        "protocol": "blackhole",
        "settings": {
          "response": {
            "type": "http"
          }
        },
        "tag": "blocked"
      },
      {
        "protocol": "dns",
        "tag": "dns-out"
      }
    ],
    "routing":
      {
        "domainStrategy": "IPIfNonMatch",
        "domainMatcher": "hybrid",
        "rules": [
        {
          "outboundTag": "dns-out",
          "protocol": ["dns"],
          "type": "field"
        },
		{
          "outboundTag": "direct",
          "protocol": ["bittorrent"],
		  "type": "field"
        },
		{
		  "inboundTag": ["all-in"],
		  "network": "udp",
          "port": 123,
          "outboundTag": "direct",
          "type": "field"
        },
		{
          "domain": ["geosite:geolocation-ru", "geosite:youtube", "geosite:bittorrent"],
          "outboundTag": "direct",
		  "type": "field"
        },
		{
          "domain": ["geosite:category-ru-news"],
          "outboundTag": "proxy",
		  "type": "field"
        },
		{
          "ip": ["8.8.8.8", "1.1.1.1", "geoip:telegram"],
          "outboundTag": "proxy",
		  "type": "field"
        },
		{
          "domain": ["geosite:tld-ru"],
          "outboundTag": "direct",
		  "type": "field"
        },
		{
          "ip": [ "geoip:private", "geoip:ru"],
          "outboundTag": "direct",
		  "type": "field"
        },
		{
          "type": "field",
          "network": "udp",
          "ip": ["geoip:google"],
          "outboundTag": "direct"
        }
      ]
    }
}

Подробностей работы не могу сказать, но логика "domainStrategy": "IPIfNonMatch" такая, что "Если доменное имя не соответствует ни одному правилу, тогда доменное имя преобразуется в IP и повторяется сопоставление".

Почему бы просто не использовать Route Rule в sing-box или Xray, ведь можно добавить все необходимые правила в свой geosite.dat. Так же можно порезать рекламу записав "hosts": { "geosite:category-ads-all": "127.0.0.1" }.

Information

Rating
Does not participate
Registered
Activity