Skip to content

Commit

Permalink
Add configurable MTU option
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiannuzzi committed May 22, 2023
1 parent 291a578 commit 518abc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ It connects to a regular Wireguard server running on `10.8.43.5:58120` with this
PrivateKey = WJiRwPPp1NnNl1PbEAtH0yeG160xxPXXe+8OFxk6H1o=
Address = 192.168.4.1/32
ListenPort = 58120
MTU = 1420

[Peer]
PublicKey = +t6LAA9uaC1RXp2GzXQKCuwkys6Q2188EnAgU26P6xc=
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func main() {
wgPublicKey := flag.String("wg-public-key", "", "Wireguard public key")
wgEndpoint := flag.String("wg-endpoint", "", "Wireguard endpoint")
wgKeepalive := flag.Int("wg-keepalive", 0, "Wireguard keepalive")
wgMtu := flag.Int("wg-mtu", 1420, "Wireguard MTU")
logLevelString := flag.String("log-level", "info", "Log level")
showVersion := flag.Bool("version", false, "Show version")
flag.DurationVar(&udpTimeout, "udp-timeout", 2*time.Minute, "UDP timeout")
Expand Down Expand Up @@ -77,7 +78,7 @@ func main() {
tun, tnet, err := netstack.CreateNetTUN(
[]netip.Addr{netip.MustParseAddr(*wgLocalIP)},
[]netip.Addr{},
1420,
*wgMtu,
)
if err != nil {
logrus.Fatalf("Error creating tunnel interface: %s", err)
Expand Down

0 comments on commit 518abc2

Please sign in to comment.