Clouodon Blog
    • 版块
    • 最新
    • 热门
    • 用户
    • 友链
    • 注册
    • 登录

    OPENPPP2 配置示例 与分流

    已定时 已固定 已锁定 已移动 软件教程
    3 帖子 1 发布者 12 浏览
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 四折光曲四 离线
      四折光曲
      最后由 四折光曲 编辑

      国内IP白名单/v6:https://github.com/mayaxcn/china-ip-list/blob/master/chnroute.txt

      国内域名白名单:https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/accelerated-domains.china.conf

      配置文件示例:

      {
          "concurrent": 10,
          "key": {
              "kf": 82225XXXXX908275747,
              "kx": 128,
              "kl": 10,
              "kh": 12,
              "sb": 1000,
              "protocol": "aes-256-cfb",
              "protocol-key": "GoGx2KXXXXXXEYvE742XJjh",
              "transport": "aes-256-cfb",
              "transport-key": "H9oxThG7XXXXXI3YOr6dizqg",
              "masked": true,
              "plaintext": false,
              "delta-encode": true,
              "shuffle-data": true
          },
          "ip": {
              "public": "YOUR VPS IP",
              "interface": "::"
          },
          "vmem": {
              "size": 4096,
              "path": "./{}"
          },
          "tcp": {
              "inactive": {
                  "timeout": 300
              },
              "connect": {
                  "timeout": 5,
                  "nexcept": 4
              },
              "listen": {
                  "port": 20000
              },
              "cwnd": 0	,
              "rwnd": 0	,
              "turbo": true,
              "backlog": 1024,
              "fast-open": true
          },
          "udp": {
              "cwnd": 0	,
              "rwnd": 0	,
              "inactive": {
                  "timeout": 300
              },
              "dns": {
                  "timeout": 4,
                  "ttl": 60,
                  "cache": true,
                  "turbo": false,
                  "redirect": "::"
              },
              "listen": {
                  "port": 20000
              },
              "static": {
                  "keep-alived": [
                      1,
                      5
                  ],
                  "dns": true,
                  "quic": true,
                  "icmp": true,
                  "aggligator": 0,
                  "servers": [
                  ]
              }
          },
          "mux": {
              "connect": {
                  "timeout": 10
              },
              "inactive": {
                  "timeout": 300
              },
              "congestions": 134217728,
              "keep-alived": [
                  1,
                  5
              ]
          },
          "server": {
              "log": "./ppp.log",
              "node": 1,
              "subnet": true,
              "mapping": true,
              "backend": "",
              "backend-key": "T7JZgXXXXXrobdZ2H3lOa"
          },
          "client": {
              "guid": "{F4569208-BB45-4DEB-B115-0FEA1D91B85B}",
              "server": "ppp://YOUR VPS IP:20000/",
              "bandwidth": 1000000000,
              "reconnections": {
                  "timeout": 5
              },
              "paper-airplane": {
                  "tcp": true
              },
              "http-proxy": {
                  "bind": "::",
                  "port": 8080
              },
              "socks-proxy": {
                  "bind": "::",
                  "port": 1080,
                  "username": "2233",
                  "password": "2XXXXXXX"
              },
              "mappings": [
                  {
                      "local-ip": "::",
                      "local-port": 80,
                      "protocol": "tcp",
                      "remote-ip": "::",
                      "remote-port": 10001
                  }
              ]
          }
      }
      

      启动脚本示例:

      start ppp.exe --config=./AKIJP100MS.JSONstart --mode=client --lwip=yes --tun=ppp --tun-ip=10.0.0.10 --tun-gw=10.0.0.1 --tun-mask=24 --tun-host=yes --tun-mux=4 --tun-mux-acceleration=3 --tun-vnet=yes --tun-ssmt=4/st --tun-static=yes --link-restart=3 --block-quic=no --bypass=./chn_ip.txt --dns-rules=./chn_dns.txt
      
      1 条回复 最后回复 回复 引用 0
      • 四折光曲四 离线
        四折光曲
        最后由 编辑

        SMART DNS CONF 国内域名白名单规则转换:

        <!DOCTYPE html>
        <html lang="zh-CN">
        <head>
            <meta charset="UTF-8">
            <title>全能格式转换工具 (IP & DNS)</title>
            <style>
                body { font-family: -apple-system, sans-serif; max-width: 1000px; margin: 20px auto; padding: 0 20px; background-color: #f5f5f7; }
                .container { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
                .tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #eee; padding-bottom: 10px; }
                .tab-btn { padding: 10px 20px; cursor: pointer; border: none; background: #e0e0e0; border-radius: 6px; font-weight: bold; }
                .tab-btn.active { background: #0071e3; color: white; }
                .content { display: none; }
                .content.active { display: block; }
                .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
                textarea { width: 100%; height: 350px; padding: 12px; border: 1px solid #d2d2d7; border-radius: 8px; font-family: monospace; box-sizing: border-box; }
                .controls { margin-top: 15px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
                input[type="text"] { padding: 8px; border: 1px solid #ccc; border-radius: 4px; width: 200px; }
                button { background-color: #0071e3; color: white; border: none; padding: 10px 25px; border-radius: 8px; cursor: pointer; font-size: 15px; }
                button:hover { background-color: #005bb5; }
                .label { font-weight: bold; margin-bottom: 8px; display: block; color: #666; }
            </style>
        </head>
        <body>
        
        <div class="container">
            <div class="tabs">
                <div class="tab-btn active" onclick="switchTab('ip-tab')">IP 范围转 CIDR</div>
                <div class="tab-btn" onclick="switchTab('dns-tab')">DNS 格式转换 (C → D)</div>
            </div>
        
            <!-- IP 转换面板 -->
            <div id="ip-tab" class="content active">
                <div class="grid">
                    <div>
                        <label class="label">输入 IP 范围 (格式 A)</label>
                        <textarea id="inputA" placeholder="1.0.1.0 1.0.1.255&#10;2001:db8:: 2001:db8::ffff"></textarea>
                    </div>
                    <div>
                        <label class="label">输出 CIDR (格式 B)</label>
                        <textarea id="outputB" readonly></textarea>
                    </div>
                </div>
                <div class="controls">
                    <button onclick="processIPs()">立即转换 IP</button>
                </div>
            </div>
        
            <!-- DNS 转换面板 -->
            <div id="dns-tab" class="content">
                <div class="grid">
                    <div>
                        <label class="label">输入 DNS 配置 (格式 C)</label>
                        <textarea id="inputC" placeholder="server=/google.com/114.114.114.114&#10;server=/00.net/114.114.114.114"></textarea>
                    </div>
                    <div>
                        <label class="label">输出结果 (格式 D)</label>
                        <textarea id="outputD" readonly></textarea>
                    </div>
                </div>
                <div class="controls">
                    <span>自定义后缀:</span>
                    <input type="text" id="dnsSuffix" value="/223.5.5.5/nic" placeholder="/DNS地址/接口名">
                    <button onclick="processDNS()">立即转换 DNS</button>
                </div>
            </div>
        </div>
        
        <script>
            function switchTab(tabId) {
                document.querySelectorAll('.content').forEach(c => c.classList.remove('active'));
                document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
                document.getElementById(tabId).classList.add('active');
                event.currentTarget.classList.add('active');
            }
        
            // --- DNS 转换逻辑 (C -> D) ---
            function processDNS() {
                const input = document.getElementById('inputC').value;
                const suffix = document.getElementById('dnsSuffix').value;
                const lines = input.split('\n');
                let results = [];
        
                lines.forEach(line => {
                    // 使用正则提取 / 之间的域名
                    // 匹配 server=/域名/IP
                    const match = line.match(/server=\/(.*?)\//);
                    if (match && match[1]) {
                        const domain = match[1].trim();
                        // 模拟 D 格式的对齐效果 (域名 + 后缀)
                        results.push(`${domain.padEnd(40, ' ')}${suffix}`);
                    }
                });
        
                document.getElementById('outputD').value = results.join('\n');
            }
        
            // --- IP 转换逻辑 (支持 IPv4/v6) ---
            function ipToBigInt(ip) {
                if (ip.includes(':')) {
                    let parts = ip.split('::');
                    let left = parts[0] ? parts[0].split(':') : [];
                    let right = parts.length > 1 ? parts[1].split(':') : [];
                    let middle = new Array(8 - (left.length + right.length)).fill('0');
                    let full = left.concat(middle).concat(right).map(x => x === '' ? '0' : x);
                    return full.reduce((acc, part) => (acc << 16n) + BigInt(parseInt(part, 16)), 0n);
                } else {
                    return ip.split('.').reduce((acc, part) => (acc << 8n) + BigInt(parseInt(part, 10)), 0n);
                }
            }
        
            function bigIntToIp(bn, isV6) {
                if (isV6) {
                    let parts = [];
                    for (let i = 0; i < 8; i++) {
                        parts.unshift(((bn >> BigInt(i * 16)) & 0xFFFFn).toString(16));
                    }
                    return parts.join(':').replace(/\b0+/g, '').replace(/:{3,}/g, '::');
                } else {
                    let parts = [];
                    for (let i = 0; i < 4; i++) {
                        parts.unshift(((bn >> BigInt(i * 8)) & 0xFFn).toString(10));
                    }
                    return parts.join('.');
                }
            }
        
            function summarizeRange(startIpStr, endIpStr) {
                const isV6 = startIpStr.includes(':');
                const maxBits = isV6 ? 128n : 32n;
                let start = ipToBigInt(startIpStr);
                let end = ipToBigInt(endIpStr);
                let res = [];
                while (end >= start) {
                    let cur = maxBits;
                    while (cur > 0n) {
                        let mask = (1n << (maxBits - (cur - 1n))) - 1n;
                        if ((start & mask) !== 0n || (start + mask > end)) break;
                        cur--;
                    }
                    res.push(bigIntToIp(start, isV6) + '/' + cur);
                    start += (1n << (maxBits - cur));
                    if (start === 0n) break;
                }
                return res;
            }
        
            function processIPs() {
                const input = document.getElementById('inputA').value;
                let results = [];
                input.split('\n').forEach(line => {
                    const parts = line.trim().split(/[\s\t\-]+/);
                    if (parts.length >= 2) {
                        try { results = results.concat(summarizeRange(parts[0], parts[1])); } catch (e) {}
                    }
                });
                document.getElementById('outputB').value = results.join('\n');
            }
        </script>
        
        </body>
        </html>
        
        1 条回复 最后回复 回复 引用 0
        • 四折光曲四 离线
          四折光曲
          最后由 编辑

          QQ20260511-095410.webp

          1 条回复 最后回复 回复 引用 0

          你好!看起来您对这段对话很感兴趣,但您还没有一个账号。

          厌倦了每次访问都刷到同样的帖子?您注册账号后,您每次返回时都能精准定位到您上次浏览的位置,并可选择接收新回复通知(通过邮件或推送通知)。您还能收藏书签、为帖子顶,向社区成员表达您的欣赏。

          有了你的建议,这篇帖子会更精彩哦 💗

          注册 登录
          • 第一个帖子
            最后一个帖子