3x-ui使用多个IP不同出入口 - 多端口配置方案

如果您按照本教程操作,请勿随意修改任何内容,包括 备注 等配置中的任何部分。您只需根据实际情况修改对应的 IP 地址 即可。

以下以 Shadowsocks 为例,每个端口对应不同的IP出口,其他协议或多用户区分可根据此思路扩展。

示例:端口与IP对应关系

38901 -> 192.168.1.11
38902 -> 192.168.1.12
38903 -> 192.168.1.13
38904 -> 192.168.1.14
38905 -> 192.168.1.15


安装 3x-ui

  1. 请参考以下教程安装 3x-ui:3x-ui 安装教程
  2. 安装完成后,登录管理面板,按照以下步骤进行配置。


配置步骤

1. 创建节点

在 3x-ui 中为每个IP创建对应的节点。节点的IP需与实际出口IP对应,确保配置准确。如不清楚如何操作,请谨慎修改,以免配置失败。blogs/content/9Cw7TPCH52KIZk08BuGH5FSiahsD5hgix20Iu8DO.png

整体配置图

blogs/content/wMx1pp9Ra4kLZkVryfEQxlF97cbWl2pDKRpy2YsX.png

2. 配置 Xray 高级设置

blogs/content/DvhWwendCPHENcoaxfHd6VUL1DN7WPbyAKNmMuDm.png进入 Xray 设置高级设置,找到并编辑以下内容:



出站规则配置

[
  {
    "tag": "ip1",
    "sendThrough": "192.168.1.11",
    "protocol": "freedom",
    "settings": {}
  },
  {
    "tag": "ip2",
    "sendThrough": "192.168.1.12",
    "protocol": "freedom",
    "settings": {}
  },
  {
    "tag": "ip3",
    "sendThrough": "192.168.1.13",
    "protocol": "freedom",
    "settings": {}
  },
  {
    "tag": "ip4",
    "sendThrough": "192.168.1.14",
    "protocol": "freedom",
    "settings": {}
  },
  {
    "tag": "ip5",
    "sendThrough": "192.168.1.15",
    "protocol": "freedom",
    "settings": {}
  },
  {
    "tag": "direct",
    "protocol": "freedom",
    "settings": {
      "domainStrategy": "UseIP",
      "redirect": "",
      "noises": []
    }
  },
  {
    "tag": "blocked",
    "protocol": "blackhole",
    "settings": {}
  }
]

路由规则配置

[
  {
    "inboundTag": [
      "inbound-192.168.1.11:38901"
    ],
    "outboundTag": "ip1",
    "type": "field"
  },
  {
    "inboundTag": [
      "inbound-192.168.1.12:38902"
    ],
    "outboundTag": "ip2",
    "type": "field"
  },
  {
    "inboundTag": [
      "inbound-192.168.1.13:38903"
    ],
    "outboundTag": "ip3",
    "type": "field"
  },
  {
    "inboundTag": [
      "inbound-192.168.1.14:38904"
    ],
    "outboundTag": "ip4",
    "type": "field"
  },
  {
    "inboundTag": [
      "inbound-192.168.1.15:38905"
    ],
    "outboundTag": "ip5",
    "type": "field"
  },
  {
    "type": "field",
    "inboundTag": [
      "api"
    ],
    "outboundTag": "api"
  },
  {
    "type": "field",
    "outboundTag": "blocked",
    "ip": [
      "geoip:private"
    ]
  },
  {
    "type": "field",
    "outboundTag": "blocked",
    "protocol": [
      "bittorrent"
    ]
  }
]

保存所有配置后,重启 Xray 服务。配置完成后,可以进行测试以验证是否符合预期


分享到:
上一篇
3x-ui 一键脚本
1
系统公告

美国洛杉矶Cn2/GIA线路回国专线独立物理服务器活动进行中

美国洛杉矶机房T1级数据中心,采用CN2/GIA回国专线直连线路,上百台独立物理服务器最快30分钟上线,点击了解更多配置
服务中心
客服
在线客服
24小时为您服务
咨询
联系我们
联系我们,为您的业务提供专属服务。
24/7 技术支持
如果您遇到寻求进一步的帮助,请过工单与我们进行联系。
24/7 即时支持
技术支持
售前客服
售前客服
售前客服
售后客服
评价
您对当前页面的整体感受是否满意?
😞
非常不满意
😕
不满意
😐
一般
🙂
满意
😊
非常满意