mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Add support for specifying tun device name
This commit is contained in:
parent
e5d526881d
commit
1c799b305d
3 changed files with 12 additions and 8 deletions
|
@ -35,6 +35,7 @@ type nodeConfig struct {
|
|||
SigPub string
|
||||
SigPriv string
|
||||
Multicast bool
|
||||
IfName string
|
||||
}
|
||||
|
||||
type node struct {
|
||||
|
@ -80,6 +81,7 @@ func generateConfig() *nodeConfig {
|
|||
cfg.SigPriv = hex.EncodeToString(spriv[:])
|
||||
cfg.Peers = []string{}
|
||||
cfg.Multicast = true
|
||||
cfg.IfName = "auto"
|
||||
return &cfg
|
||||
}
|
||||
|
||||
|
@ -182,8 +184,8 @@ func main() {
|
|||
n := node{}
|
||||
n.init(cfg, logger)
|
||||
logger.Println("Starting tun...")
|
||||
n.core.DEBUG_startTun() // 1280, the smallest supported MTU
|
||||
//n.core.DEBUG_startTunWithMTU(65535) // Largest supported MTU
|
||||
n.core.DEBUG_startTun(cfg.IfName) // 1280, the smallest supported MTU
|
||||
//n.core.DEBUG_startTunWithMTU(cfg.IfName, 65535) // Largest supported MTU
|
||||
defer func() {
|
||||
logger.Println("Closing...")
|
||||
n.core.DEBUG_stopTun()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue