install-script icon indicating copy to clipboard operation
install-script copied to clipboard

config outbounds and routing for access to warp or tor

Open netsupcloud opened this issue 1 year ago • 5 comments
trafficstars

its good idea to add xray routing options to tp like what mhsanaei x-ui did. https://github.com/MHSanaei/3x-ui

so we can route our inbounds to different outbond for example tor for anonymous connection by https://github.com/FDX100/Auto_Tor_IP_changer (DANGEROUS --- it's possible to be flagged by DATA CENTER ) or for warp outbound

instead user tag for all inbounds you can use their ip and port like inbound-0.0.0.0:29954

and use their tag in routing of each nodes if their outbound was defined manually by pasting something like what i did below or auto something coded for warp or tor by yourself

"outbounds": [
    {
      "tag": "warp",
      "protocol": "wireguard",
      "settings": {
        "mtu": 1420,
        "secretKey": "8CBQxxKSomTQ4+THwEaNVuZgAFbudNZXtcJZLcseRWw=",
        "address": [
          "172.16.0.2",
          "2606:4700:110:8287:766:a76e:6548:2d56"
        ],
        "workers": 2,
        "domainStrategy": "ForceIPv6v4",
        "peers": [
          {
            "publicKey": "bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=",
            "allowedIPs": [
              "0.0.0.0/0",
              "::/0"
            ],
            "endpoint": "engage.cloudflareclient.com:2408",
            "keepAlive": 0
          }
        ],
        "kernelMode": false
      }
    }
  ],
"routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "inboundTag": [
          "api"
        ],
        "outboundTag": "api"
      },
      {
        "type": "field",
        "outboundTag": "blocked",
        "ip": [
          "geoip:private"
        ]
      },
      {
        "type": "field",
        "outboundTag": "blocked",
        "protocol": [
          "bittorrent"
        ]
      },
      {
        "type": "field",
        "outboundTag": "warp"
      },
      {
        "type": "field",
        "inboundTag": [
          "inbound-0.0.0.0:29954"
        ],
        "outboundTag": "warp"
      }
    ]
  }

netsupcloud avatar Feb 03 '24 20:02 netsupcloud

Freedom Protocol Strategy - AsIs - UseIP - UseIPv4 - UseIPv6 :

in outbounds:

{
      "tag": "IPv4",
      "protocol": "freedom",
      "settings": {
        "domainStrategy": "UseIPv4"
      }
}

and in routing we can redirect our desired websites to that outbound:

{
        "type": "field",
        "outboundTag": "IPv4",
        "domain": [
          "geosite:google",
          "geosite:netflix"
        ]
}

for blocking private network or bittorent in routing:

  {
    "type": "field",
    "outboundTag": "blocked",
    "ip": [
      "geoip:private"
    ]
  },
  {
    "type": "field",
    "outboundTag": "blocked",
    "protocol": [
      "bittorrent"
    ]
  }

netsupcloud avatar Feb 04 '24 08:02 netsupcloud

making your region ip or domains direct:

      {
        "type": "field",
        "outboundTag": "direct",
        "domain": [
          "regexp:.*\\.ir$",
          "regexp:.*\\.xn--mgba3a4f16a$",
          "ext:geosite_IR.dat:ir"
        ]
      },
      {
        "type": "field",
        "outboundTag": "direct",
        "ip": [
          "ext:geoip_IR.dat:ir"
        ]
      }

netsupcloud avatar Feb 04 '24 08:02 netsupcloud

block ads malware crypto and speedtest:

{
        "type": "field",
        "outboundTag": "blocked",
        "domain": [
          "geosite:category-ads-all",
          "ext:geosite_IR.dat:category-ads-all",
          "ext:geosite_IR.dat:malware",
          "ext:geosite_IR.dat:phishing",
          "ext:geosite_IR.dat:cryptominers",
          "geosite:speedtest"
        ]
      }

netsupcloud avatar Feb 04 '24 08:02 netsupcloud

for filtering adult content and malware and family safety:

"dns": {
    "servers": [
      "1.1.1.3",
      "1.0.0.3",
      "2606:4700:4700::1113",
      "2606:4700:4700::1003"
    ],
    "queryStrategy": "UseIP"
  }

netsupcloud avatar Feb 04 '24 08:02 netsupcloud

geo-site-ip_3.zip

geosite and geoip files for CN VN RU IR

netsupcloud avatar Feb 04 '24 10:02 netsupcloud