{"id":27108883,"url":"https://github.com/xxpe3/clash_raspberrypi","last_synced_at":"2025-10-24T00:53:18.684Z","repository":{"id":181820891,"uuid":"161773365","full_name":"XXpE3/clash_raspberrypi","owner":"XXpE3","description":"Clash for ARMv6L","archived":false,"fork":false,"pushed_at":"2019-10-02T21:23:48.000Z","size":6,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-07-17T11:44:47.408Z","etag":null,"topics":["proxy","raspberry-pi"],"latest_commit_sha":null,"homepage":"https://github.com/Dreamacro/clash","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XXpE3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-14T11:06:36.000Z","updated_at":"2023-07-17T11:44:49.514Z","dependencies_parsed_at":"2023-07-17T12:57:06.082Z","dependency_job_id":null,"html_url":"https://github.com/XXpE3/clash_raspberrypi","commit_stats":null,"previous_names":["xxpe3/clash_raspberrypi"],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XXpE3%2Fclash_raspberrypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XXpE3%2Fclash_raspberrypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XXpE3%2Fclash_raspberrypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XXpE3%2Fclash_raspberrypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XXpE3","download_url":"https://codeload.github.com/XXpE3/clash_raspberrypi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247563938,"owners_count":20958971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["proxy","raspberry-pi"],"created_at":"2025-04-06T22:37:02.139Z","updated_at":"2025-10-24T00:53:18.638Z","avatar_url":"https://github.com/XXpE3.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Clash 仓库已经有了几乎全部平台的编译版本，这个仓库已停止更新 Clash，请前往 [Clash 仓库](https://github.com/Dreamacro/clash/releases) 下载更新最新版本。\n\n# 特征\n\n使用一个简单的 Raspberry Pi 设备当作局域网 代理 / 网关，供给局域网内的其他设备使用。\n\n代理程序使用 Clash ， 可以针对多个代理服务器创建复杂的规则，例如：\n\n* 可以将代理分组使用并指定规则\n* 可以根据 GeoIP 实现不同区域使用不同地区代理服务器\n* 日本 IP 通过 日本代理服务器\n* Pixiv 与 DMM 通过 日本代理服务器\n* Steam 与 Netflix 通过 香港代理服务器\n* 默认外国 IP 通过 美国代理服务器\n\n完整的介绍与规则使用请查阅 Clash 项目。\n\n[Clash](https://github.com/Dreamacro/clash) A rule-based tunnel in Go.\n\n# 安装\n\n## Clash\n\n下载编译 Clash：\n```\ngo get -u -v github.com/Dreamacro/clash\n```\n\n或下载我编译好的：\n\n[Clash for ARMv6L](https://github.com/gs002/clash_raspberrypi/releases)\n\n## 配置\n\n可选：使用 [DNSCrypt-Proxy](https://github.com/gs002/clash_raspberrypi/blob/master/dnscrypt-proxy.md) 替代 Clash 内置 DNS 查询服务。\n\n基础配置：\n```\nport: 7890\nsocks-port: 7891\nredir-port: 7892\nallow-lan: true\nmode: Rule\nlog-level: info\nexternal-controller: '127.0.0.1:9000'\nsecret: ''\ndns:\n   enable: true\n   ipv6: false\n   listen: 0.0.0.0:53\n   enhanced-mode: redir-host\n   nameserver:\n     - tls://dns.rubyfish.cn:853\n   fallback:\n     - tls://1.1.1.1:853\n     - tls://1.0.0.1:853\n```\n在 Raspberry Pi 上需要以 root 权限启动 Clash ，否则无法启用 53 端口监听。\n\n然后按照 [Clash README](https://github.com/Dreamacro/clash/blob/master/README.md) 添加代理服务器跟配置规则。\n\n## 转发\n\n编辑修改 `/etc/sysctl.conf` 开启 `net.ipv4.ip_forward = 1` ，然后使用 `sysctl -p` 命令刷新生效。\n\n```\niptables -t nat -N CLASH\niptables -t mangle -N CLASH\n\niptables -t nat -A CLASH -d x.x.x.x(树莓派局域网IP) -j RETURN\n\niptables -t nat -A CLASH -d 0.0.0.0/8 -j RETURN\niptables -t nat -A CLASH -d 10.0.0.0/8 -j RETURN\niptables -t nat -A CLASH -d 127.0.0.0/8 -j RETURN\niptables -t nat -A CLASH -d 169.254.0.0/16 -j RETURN\niptables -t nat -A CLASH -d 172.16.0.0/12 -j RETURN\niptables -t nat -A CLASH -d 192.168.0.0/16 -j RETURN\niptables -t nat -A CLASH -d 224.0.0.0/4 -j RETURN\niptables -t nat -A CLASH -d 240.0.0.0/4 -j RETURN\n\niptables -t nat -A CLASH -p tcp -j REDIRECT --to-ports 7892\n\nip route add local default dev lo table 100\nip rule add fwmark 1 lookup 100\n\niptables -t nat -A PREROUTING -p tcp -j CLASH\niptables -t mangle -A PREROUTING -j CLASH\n```\n\n# 使用\n\n将其他局域网设备的网关与 DNS 服务器地址设置为 Raspberry Pi 地址即可。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxpe3%2Fclash_raspberrypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxxpe3%2Fclash_raspberrypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxpe3%2Fclash_raspberrypi/lists"}