mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-09 06:46:09 +08:00
增加 macvtap 模式支持
This commit is contained in:
@@ -8,8 +8,10 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
LinkModeTUN = "tun"
|
||||
LinkModeTAP = "tap"
|
||||
LinkModeTUN = "tun"
|
||||
LinkModeTAP = "tap"
|
||||
LinkModeMacvtap = "macvtap"
|
||||
LinkModeIpvtap = "ipvtap"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -48,11 +50,12 @@ type ServerConfig struct {
|
||||
AdminPass string `json:"admin_pass"`
|
||||
JwtSecret string `json:"jwt_secret"`
|
||||
|
||||
LinkMode string `json:"link_mode"` // tun tap
|
||||
Ipv4CIDR string `json:"ipv4_cidr"` // 192.168.1.0/24
|
||||
Ipv4Gateway string `json:"ipv4_gateway"`
|
||||
Ipv4Start string `json:"ipv4_start"` // 192.168.1.100
|
||||
Ipv4End string `json:"ipv4_end"` // 192.168.1.200
|
||||
LinkMode string `json:"link_mode"` // tun tap macvtap ipvtap
|
||||
Ipv4Master string `json:"ipv4_master"` // eth0
|
||||
Ipv4CIDR string `json:"ipv4_cidr"` // 192.168.10.0/24
|
||||
Ipv4Gateway string `json:"ipv4_gateway"` // 192.168.10.1
|
||||
Ipv4Start string `json:"ipv4_start"` // 192.168.10.100
|
||||
Ipv4End string `json:"ipv4_end"` // 192.168.10.200
|
||||
IpLease int `json:"ip_lease"`
|
||||
|
||||
MaxClient int `json:"max_client"`
|
||||
|
@@ -26,19 +26,20 @@ var configs = []config{
|
||||
{Typ: cfgStr, Name: "server_dtls_addr", Usage: "DTLS监听地址", ValStr: ":4433"},
|
||||
{Typ: cfgStr, Name: "admin_addr", Usage: "后台服务监听地址", ValStr: ":8800"},
|
||||
{Typ: cfgBool, Name: "proxy_protocol", Usage: "TCP代理协议", ValBool: false},
|
||||
{Typ: cfgStr, Name: "db_type", Usage: "数据库类型 [sqlite3、mysql、postgres]", ValStr: "sqlite3"},
|
||||
{Typ: cfgStr, Name: "db_type", Usage: "数据库类型 [sqlite3 mysql postgres]", ValStr: "sqlite3"},
|
||||
{Typ: cfgStr, Name: "db_source", Usage: "数据库source", ValStr: "./conf/anylink.db"},
|
||||
{Typ: cfgStr, Name: "cert_file", Usage: "证书文件", ValStr: "./conf/vpn_cert.pem"},
|
||||
{Typ: cfgStr, Name: "cert_key", Usage: "证书密钥", ValStr: "./conf/vpn_cert.key"},
|
||||
{Typ: cfgStr, Name: "files_path", Usage: "外部下载文件路径", ValStr: "./conf/files"},
|
||||
{Typ: cfgStr, Name: "log_path", Usage: "日志文件路径,默认标准输出", ValStr: ""},
|
||||
{Typ: cfgStr, Name: "log_level", Usage: "日志等级 [debug、info、warn、error]", ValStr: "info"},
|
||||
{Typ: cfgStr, Name: "log_level", Usage: "日志等级 [debug info warn error]", ValStr: "info"},
|
||||
{Typ: cfgBool, Name: "pprof", Usage: "开启pprof", ValBool: false},
|
||||
{Typ: cfgStr, Name: "issuer", Usage: "系统名称", ValStr: "XX公司VPN"},
|
||||
{Typ: cfgStr, Name: "admin_user", Usage: "管理用户名", ValStr: "admin"},
|
||||
{Typ: cfgStr, Name: "admin_pass", Usage: "管理用户密码", ValStr: defaultPwd},
|
||||
{Typ: cfgStr, Name: "jwt_secret", Usage: "JWT密钥", ValStr: defaultJwt},
|
||||
{Typ: cfgStr, Name: "link_mode", Usage: "虚拟网络类型", ValStr: "tun"},
|
||||
{Typ: cfgStr, Name: "link_mode", Usage: "虚拟网络类型[tun tap macvtap ipvtap]", ValStr: "tun"},
|
||||
{Typ: cfgStr, Name: "ipv4_master", Usage: "ipv4主网卡名称", ValStr: "eth0"},
|
||||
{Typ: cfgStr, Name: "ipv4_cidr", Usage: "ip地址网段", ValStr: "192.168.10.0/24"},
|
||||
{Typ: cfgStr, Name: "ipv4_gateway", Usage: "ipv4_gateway", ValStr: "192.168.10.1"},
|
||||
{Typ: cfgStr, Name: "ipv4_start", Usage: "IPV4开始地址", ValStr: "192.168.10.100"},
|
||||
|
Reference in New Issue
Block a user