Skip to content

Commit

Permalink
feat(tun): mention in 'operation not permitted' error the user should…
Browse files Browse the repository at this point in the history
… specify --device /dev/net/tun
  • Loading branch information
qdm12 committed Oct 28, 2024
1 parent 937c667 commit f1f3472
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/tun/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func (t *Tun) Create(path string) (err error) {

fd, err := unix.Open(path, 0, 0)
if err != nil {
if err.Error() == "operation not permitted" {
err = fmt.Errorf("%w (did you specify --device /dev/net/tun to your container command?)", err)
}
return fmt.Errorf("unix opening TUN device file: %w", err)
}

Expand Down

0 comments on commit f1f3472

Please sign in to comment.