nitred / nr-wg-mtu-finder

MIT License
202 stars 22 forks source link

Permission Denied error 13 #15

Closed Alexaandre closed 10 months ago

Alexaandre commented 10 months ago

Hi, as i tried to install this tool on macos, i've not find any instruction to get it working on macos. i tried to install it on a VM on my macos, wg tunnel is OK between peers, i can ping the server everything's fine until i try the server script. I created a venv, then installed the script inside the venv, then run the cmd as described on the topic, then, wg client connects to server, then server crash when changing MTU with permission denied error . Tryed to chmod 777 /etc/wireguard/wg0.conf but no luck . I want the server to stay on MTU 1420 .

WG server 10.0.0.1/24 -> ubuntu WG peer 10.0.0.3/24 -> ubuntu

(WG) alexandre@wg-srv-ubuntu:~$ nr-wg-mtu-finder --mode server --mtu-min 1420 --mtu-max 1420 --mtu-step 2 --server-ip 10.0.0.1

do you have an idea ?

nitred commented 10 months ago

@Alexaandre The scripts are meant to be run as a root user or with sudo. This is a security risk for sure. Please go through the code base to check to see if you're comfortable doing that.

You could do the following:

# First obtain the path of the nr-wg-mtu-finder binary
$ which nr-wg-mtu-finder
/path/to/nr-wg-mtu-finder

# Then run the command using sudo
$ sudo /path/to/nr-wg-mtu-finder --mode server --mtu-min 1420 --mtu-max 1420 --mtu-step 2 --server-ip 10.0.0.1
Alexaandre commented 10 months ago

Hi @nitred, thanks for the reply, unfortunatelly, it was late in the night yesterday when i wrote this, i realized right after that the script has to run under sudo argument. i used $ mkdir wg-srv then $ python3 -m venv wg-srv/n then $ source wg-srv/bin/ativate then (wg-srv) $ sudo pip install nr-wg-mtu-finder==0.2.1 --upgrade, installed it .

I dont know if this this is recommended to use sudo on venv but its was to test the script and it worked, i set up 2 VMs for the occasion as i have no idea how to install it on mac-osx : when i try to install it on a venv using python3, i have an error with wheel buildind .