{"id":26458469,"url":"https://github.com/sopium/titun","last_synced_at":"2025-03-19T00:01:52.762Z","repository":{"id":38272150,"uuid":"78527147","full_name":"blckngm/titun","owner":"blckngm","description":"Simple, fast, and cross-platform IP tunnel written in Rust. WireGuard compatible.","archived":false,"fork":false,"pushed_at":"2023-03-06T09:02:59.000Z","size":11463,"stargazers_count":44,"open_issues_count":22,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-30T05:18:19.028Z","etag":null,"topics":["networking","tunnel","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blckngm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-10T11:26:07.000Z","updated_at":"2024-02-16T14:14:03.000Z","dependencies_parsed_at":"2024-01-07T22:48:38.630Z","dependency_job_id":"0be6d0f7-aeb3-4a3d-aa40-98888b3c37ac","html_url":"https://github.com/blckngm/titun","commit_stats":null,"previous_names":["blckngm/titun","sopium/titun"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blckngm%2Ftitun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blckngm%2Ftitun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blckngm%2Ftitun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blckngm%2Ftitun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blckngm","download_url":"https://codeload.github.com/blckngm/titun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244326199,"owners_count":20435122,"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":["networking","tunnel","wireguard"],"created_at":"2025-03-19T00:01:45.405Z","updated_at":"2025-03-19T00:01:52.649Z","avatar_url":"https://github.com/blckngm.png","language":"Rust","funding_links":[],"categories":["\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"ea4dfcd8f33ec1852180c6283b2c8516\"\u003e\u003c/a\u003e未分类"],"readme":"# TiTun\n\n [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/21087)\n[![CI](https://github.com/sopium/titun/actions/workflows/ci.yml/badge.svg)](https://github.com/sopium/titun/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/sopium/titun/branch/master/graph/badge.svg)](https://codecov.io/gh/sopium/titun)\n\nSimple, fast, and cross-platform IP tunnel written in Rust. [WireGuard](https://www.wireguard.com/) compatible.\n\n## Installation\n\nDownload binaries or installers from github releases.\n\nOr build from source:\n\n```\n$ cargo build --release\n```\n\n## CLI and Configuration\n\nUse\n\n```sh\n$ sudo titun -fc tun0.toml\n```\n\nto run TiTun and open the tun interface `tun0`. Here `-f` tells the program to\nrun in foreground, i.e., not daemonize. The `-c tun0.toml` option tells the\nprogram to load configuration from the file `tun0.toml`.\n\nUse `titun show` to show interface status. (It's similar to `wg show`.) Use\n`titun help` to discover more CLI options.\n\nIt is recommended to use the TOML format, but the format used by `wg` is also\naccepted.\n\n```toml\n# All optional. NOT applied when reloading.\n[General]\n# Set logging. Override by the `--log` option or the `RUST_LOG` environment variable.\nLog = \"info\"\n# Switch to user after initialization to drop privilege. Override by `--user`.\n#\n# If you use this option, and want to reload configuration, the configuration file\n# must be readable by this user.\nUser = \"nobody\"\n# Switch to group.\nGroup = \"nogroup\"\n# --foreground\nForeground = true\n# Number of worker threads. Override by `--threads` or `TITUN_THREADS`.\n# Default is `min(2, number of cores)`.\nThreads = 2\n\n[Interface]\n# Optiona. Alias: Port.\nListenPort = 7777\n# Alias: Key.\nPrivateKey = \"2BJtcgPUjHfKKN3yMvTiVQbJ/UgHj2tcZE6xU/4BdGM=\"\n# Alias: Mark.\nFwMark = 33\n\n# If an address is specified, TiTun will try to set the interface address, mtu, DNS servers and routes.\nAddress = \"192.168.77.5\"\nMtu = 1280\nDNS = \"192.168.77.0\"\n\n[[Peer]]\nPublicKey = \"Ck8P+fUguLIf17zmb3eWxxS7PqgN3+ciMFBlSwqRaw4=\"\n# Optional. Alias: PSK.\nPresharedKey = \"w64eiHxoUHU8DcFexHWzqILOvbWx9U+dxxh8iQqJr+k=\"\n# Optional. Alias: Routes.\nAllowedIPs = [\"192.168.0.0/16\"]\n\n# Optional. These routes will be excluded from the automatically added routes.\n#\n# Have no effect is `Interface.Address` is not specified.\nExcludeRoutes = [\"192.168.20.0/24\"]\n\n# Optional.\n#\n# Host names can be used. If name resolution fails, a warning is emitted and\n# the field is ignored.\nEndpoint = \"192.168.3.1:7777\"\n# Optional. Range: 1 - 65535. Alias: Keepalive.\nPersistentKeepalive = 17\n```\n\n### systemd\n\nOn linux, this is the recommended way to run TiTun. Copy the `titun` binary to\n`/usr/local/bin`, and put this service file `titun@.service` at\n`/etc/systemd/system/`:\n\n```systemd\n[Unit]\nDescription=TiTun instance %I\n\n[Service]\nType=notify\nEnvironment=RUST_BACKTRACE=1\n\nExecStart=/usr/local/bin/titun -fc /etc/titun/%I.conf\nExecStartPost=/bin/sh -c \"if [ -x /etc/titun/%I.up.sh ]; then /etc/titun/%I.up.sh; fi\"\nExecStopPost=/bin/sh -c \"if [ -x /etc/titun/%I.down.sh ]; then /etc/titun/%I.down.sh; fi\"\n\nExecReload=/usr/local/bin/titun check /etc/titun/%I.conf\nExecReload=/bin/kill -HUP $MAINPID\n\nRestart=always\n\n[Install]\nWantedBy=multi-user.target\n```\n\nNow if you want to run a TiTun interface `tun0`, put its configuration at\n`/etc/titun/tun0.conf` and use `systemctl (start|stop|reload|restart|status)\ntitun@tun0` to manage the service. If you have more complicated DNS/routing\nconfigurations, you can manage them with custom scripts at\n`/etc/titun/tun0.up.sh` and `/etc/titun/tun0.down.sh`.\n\n### Use with WireGuard tools\n\nOn unix-like operating systems, the WireGuard [cross platform userspace\ninterface](https://www.wireguard.com/xplatform/) is implemented. So you can use\n`wg` and `wg-quick` to configure TiTun interfaces.\n\nTo use `wg-quick`, specify the `WG_QUICK_USERSPACE_IMPLEMENTATION` environment\nvariable to `titun`:\n\n```sh\n$ sudo WG_QUICK_USERSPACE_IMPLEMENTATION=titun wg-quick ...\n```\n\n## Operating Systems Support\n\n### Linux\n\nLinux is supported.\n\n### FreeBSD\n\nFreeBSD is supported.\n\n### Windows\n\nWindows is supported. (TODO: document driver, GUI, specific configuration, etc.)\n\n## MacOS X\n\nMac OS X is supported. The interface name must be in the form of `utunN`, where `N` is a non-negative integer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsopium%2Ftitun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsopium%2Ftitun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsopium%2Ftitun/lists"}