Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Properly set link up for wireguard interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Lundin committed Oct 2, 2019
1 parent dc87797 commit b8a5545
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,14 @@ func (s *Server) initInterface() error {
return err
}

log.Debug("Adding NAT / IP masquerading using nftables")
log.Debug("Bringing up wireguard device: ", *wgLinkName)
err = netlink.LinkSetUp(&link)
if err != nil {
log.Error("Error bringing up device: ", *wgLinkName)
return err
}

log.Debug("Adding NAT / IP masquerading using nftables")
ns, err := netns.Get()
if err != nil {
return err
Expand Down Expand Up @@ -279,7 +285,7 @@ func (s *Server) Start() error {
return err
}

err := s.initInterface()
err = s.initInterface()
if err != nil {
return err
}
Expand Down

0 comments on commit b8a5545

Please sign in to comment.