mirror of
https://github.com/EasyTier/easytier.github.io.git
synced 2025-05-19 10:27:06 +00:00
[feat]增加“配置文件”的文档及链接 (#29)
* [feat] 完善配置文件的中英文版本说明 --------- Co-authored-by: BH1XAQ <tanxiao@16iot.cn>
This commit is contained in:
@@ -25,6 +25,7 @@ export const cn = defineConfig({
|
||||
{ text: '注册为windows服务(开机自启)', link: '/guide/network/install-as-a-windows-service' },
|
||||
{ text: '将服务安装为 Linux Systemd 服务', link: '/guide/network/install-as-a-systemd-service' },
|
||||
{ text: '其他配置', link: '/guide/network/configurations' },
|
||||
{ text: '配置文件', link: '/guide/network/config-file' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -25,6 +25,7 @@ export const en = defineConfig({
|
||||
{ text: 'Installing as a Windows Service (Auto-Start on Boot)', link: '/en/guide/network/install-as-a-windows-service' },
|
||||
{ text: 'Installing as a Linux Systemd Service', link: '/en/guide/network/install-as-a-systemd-service' },
|
||||
{ text: 'Other Configurations', link: '/en/guide/network/configurations' },
|
||||
{ text: 'Configuration File', link: '/en/guide/network/config-file' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
# Configuration File
|
||||
|
||||
Supports specifying the configuration file path using the -c parameter.
|
||||
|
||||
Note: The configuration file has a higher priority. When a configuration file is specified at runtime, all command line parameters except for -c will be ignored and only the configuration file will take effect.
|
||||
|
||||
```sh
|
||||
./easytier-core -c ./config.yaml
|
||||
```
|
||||
|
||||
You can run `./easytier-core` directly without using any parameters to obtain the minimal configuration file. By running the command with parameters, you can get a configuration file corresponding to those parameters. The configuration file will be printed on the command line, and you can manually copy the relevant configuration and save it as a TOML file.
|
||||
|
||||
Below is an example of a configuration file along with annotations for various configuration options.
|
||||
|
||||
```yaml
|
||||
# instance name to identify this vpn node in same machine
|
||||
instance_name = ""
|
||||
# Hostname, used to identify the hostname of this device
|
||||
hostname = ""
|
||||
# Instance ID, usually a UUID, unique within the same VPN network
|
||||
instance_id = ""
|
||||
# The IPv4 address of this VPN node. If left empty, this node will only forward packets and will not create a TUN device
|
||||
ipv4 = ""
|
||||
# Automatically determined and assigned IP address by Easytier, starting from 10.0.0.1 by default. Warning: When using DHCP, if an IP conflict occurs within the network, the IP address will be automatically changed.
|
||||
dhcp = false
|
||||
|
||||
# List of listeners, used for accepting connections
|
||||
listeners = [
|
||||
"tcp://0.0.0.0:11010",
|
||||
"udp://0.0.0.0:11010",
|
||||
"wg://0.0.0.0:11011",
|
||||
"ws://0.0.0.0:11011/",
|
||||
"wss://0.0.0.0:11012/",
|
||||
]
|
||||
|
||||
# List of exit nodes
|
||||
exit_nodes = [
|
||||
]
|
||||
|
||||
# Rpc portal address to listen for management
|
||||
rpc_portal = "127.0.0.1:15888"
|
||||
|
||||
[network_identity]
|
||||
# network name to identify this vpn network
|
||||
network_name = ""
|
||||
# network secret to verify this node belongs to the vpn network
|
||||
network_secret = ""
|
||||
|
||||
# This is the configuration for peer connection nodes, allowing multiple entries to support multiple peer connections
|
||||
[[peer]]
|
||||
uri = ""
|
||||
|
||||
[[peer]]
|
||||
uri = ""
|
||||
|
||||
# This is the configuration for subnet proxy nodes, where multiple entries can be configured to support multiple subnets
|
||||
[[proxy_network]]
|
||||
cidr = "10.0.1.0/24"
|
||||
|
||||
[[proxy_network]]
|
||||
cidr = "10.0.2.0/24"
|
||||
|
||||
[flags]
|
||||
# default protocol to use when connecting to peers
|
||||
default_protocol = "tcp"
|
||||
# TUN device name. If left empty, the default name will be used
|
||||
dev_name = ""
|
||||
# enable encryption for peers communication
|
||||
enable_encryption = true
|
||||
# enable IPv6 support
|
||||
enable_ipv6 = true
|
||||
# mtu of the TUN device
|
||||
mtu = 1380
|
||||
# latency priority mode will attempt to forward traffic using the path with the lowest latency. By default, the shortest path is used
|
||||
latency_first = false
|
||||
# configure this node as an exit node
|
||||
enable_exit_node = false
|
||||
# disable TUN device
|
||||
no_tun = false
|
||||
# enable smoltcp stack for subnet proxy
|
||||
use_smoltcp = false
|
||||
# only forward traffic from the whitelist networks, supporting wildcard strings, multiple network names can be separated by spaces. if this parameter is empty, forwarding is disabled. by default, all networks are allowed. e.g.: '*' (all networks), 'def*' (networks with the prefix 'def'), 'net1 net2' (only allow net1 and net2)
|
||||
foreign_network_whitelist = "*"
|
||||
```
|
||||
@@ -0,0 +1,84 @@
|
||||
# 配置文件
|
||||
|
||||
支持使用 -c 参数指定配置文件路径。
|
||||
|
||||
注意:配置文件的优先级更高,当运行时指定了配置文件,则命令行中除 -c 的其他参数将被忽略,只对配置文件生效。
|
||||
|
||||
```sh
|
||||
./easytier-core -c ./config.yaml
|
||||
```
|
||||
|
||||
在不使用参数的情况下直接运行 `./easytier-core` 可以获得最小配置文件。使用参数运行可以获得对应参数的配置文件。配置文件会打印在命令行中,可以手动复制对应配置保存为toml文件即可。
|
||||
|
||||
下面是一个配置文件的示例以及各种配置项的注解。
|
||||
|
||||
```yaml
|
||||
# 实例名称,用于在同一台机器上标识此 VPN 节点
|
||||
instance_name = ""
|
||||
# 主机名,用于标识此设备的主机名
|
||||
hostname = ""
|
||||
# 实例 ID,一般为 UUID,在同一个 VPN 网络中唯一
|
||||
instance_id = ""
|
||||
# 此 VPN 节点的 IPv4 地址,如果为空,则此节点将仅转发数据包,不会创建 TUN 设备
|
||||
ipv4 = ""
|
||||
# 由 Easytier 自动确定并设置IP地址,默认从10.0.0.1开始。警告:在使用 DHCP 时,如果网络中出现 IP 冲突,IP 将自动更改
|
||||
dhcp = false
|
||||
|
||||
# 监听器列表,用于接受连接
|
||||
listeners = [
|
||||
"tcp://0.0.0.0:11010",
|
||||
"udp://0.0.0.0:11010",
|
||||
"wg://0.0.0.0:11011",
|
||||
"ws://0.0.0.0:11011/",
|
||||
"wss://0.0.0.0:11012/",
|
||||
]
|
||||
|
||||
# 退出节点列表
|
||||
exit_nodes = [
|
||||
]
|
||||
|
||||
# 用于管理的 RPC 门户地址
|
||||
rpc_portal = "127.0.0.1:15888"
|
||||
|
||||
[network_identity]
|
||||
# 网络名称,用于标识 VPN 网络
|
||||
network_name = ""
|
||||
# 网络密钥,用于验证此节点属于 VPN 网络
|
||||
network_secret = ""
|
||||
|
||||
# 这里是对等连接节点配置,可以多段配置
|
||||
[[peer]]
|
||||
uri = ""
|
||||
|
||||
[[peer]]
|
||||
uri = ""
|
||||
|
||||
# 这里是子网代理节点配置,可以有多段配置
|
||||
[[proxy_network]]
|
||||
cidr = "10.0.1.0/24"
|
||||
|
||||
[[proxy_network]]
|
||||
cidr = "10.0.2.0/24"
|
||||
|
||||
[flags]
|
||||
# 连接到对等节点使用的默认协议
|
||||
default_protocol = "tcp"
|
||||
# TUN 设备名称,如果为空,则使用默认名称
|
||||
dev_name = ""
|
||||
# 是否启用加密
|
||||
enable_encryption = true
|
||||
# 是否启用 IPv6 支持
|
||||
enable_ipv6 = true
|
||||
# TUN 设备的 MTU
|
||||
mtu = 1380
|
||||
# 延迟优先模式,将尝试使用最低延迟路径转发流量,默认使用最短路径
|
||||
latency_first = false
|
||||
# 将本节点配置为退出节点
|
||||
enable_exit_node = false
|
||||
# 禁用 TUN 设备
|
||||
no_tun = false
|
||||
# 为子网代理启用 smoltcp 堆栈
|
||||
use_smoltcp = false
|
||||
# 仅转发白名单网络的流量,支持通配符字符串。多个网络名称间可以使用英文空格间隔。如果该参数为空,则禁用转发。默认允许所有网络。例如:'*'(所有网络),'def*'(以def为前缀的网络),'net1 net2'(只允许net1和net2)
|
||||
foreign_network_whitelist = "*"
|
||||
```
|
||||
Generated
+12091
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user