sfiorini / nordvpn-wireguard Goto Github PK
View Code? Open in Web Editor NEWA bash scripts that generates Wireguard configuration file for a NordVPN connection.
A bash scripts that generates Wireguard configuration file for a NordVPN connection.
Hi,
No mater what argument I am using, when running the script (ex. $ ./NordVpnToWireguard.sh --city Berlin) I receive the following error: 9: Syntax error: newline unexpected
Can you please help?
Thank you very much!
Hi Stefano,
First, let me thank you for the good work you've done here.
Unfortunately, once in a while, the script screws my network configuration. From then, I'm not able to connect nor the lan or the internet from the computer that launched the script.
Have you an idea on how to get a good network configuration back ?
Regards
Frédéric Severino
Where is the script?? I'm following the readme exactly and this is happening? I'm running Ubuntu on WSL if that matters...
Hi I think something goes wrong with your script, I removed de "rm Peer.txt" to get some more info but if I then look at the Peer.txt file it's empty.
Is it my machine that has this problem now or is it something that doesn't work for everybody anymore?
Thanks for your time/help
Kay
Hi and thanks for this great job, i have a strange behavior, if i generate a conf with -g onion server option the script create a wrong .conf file. Any help are appreciated
Hey, I don't know if the Issue comes from the config file or the qbittorrentvpn image b
ut I get this error message when I want to use the generated config:
[cont-init.d] 02-vpn.sh: executing...
2023-01-17 09:12:12 [INFO] Choosen VPN config: 'NordVPN-.conf'
dos2unix: converting file /config/wireguard/NordVPN-.conf to Unix format...
2023-01-17 09:12:12 [INFO] VPN remote line defined as ':51820'
2023-01-17 09:12:12 [ERROR] VPN_REMOTE not found in /config/wireguard/NordVPN-.conf, exiting...
[cont-init.d] 02-vpn.sh: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
[Interface]
PrivateKey = censored
ListenPort = 51820
Address = /32
DNS = censored, censored
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0
Endpoint = :51820
PersistentKeepalive = 25
I don't know how a wireguard config should look like but according to the logs im missing an IP adress in front of the port?
Is this an issue with the generator or the docker image I want to put the config in?
Thanks for your replies!
While you connect to the specified country when you run the nordvpn c $COUNTRY $CITY to get the private key and local address information, the API call you make using curl where you get the hostname and public key for the server doesn't specify the specific server you connected to in the proper country. So you should either edit your curl call to specify the same server as you connect to with nordvpn, or modify the curl call to get the server info (adding the country/city specification to the API call) and then connect to that host with nordvpn to get the private key and IP information. Or you could do something like this while connected to get the endpoint name and public key (leaving no reason to make the API call in curl):
ENDPOINT=$(nordvpn status | grep 'Current server' | awk '{print $3}')
PUBKEY=$(sudo wg show nordlynx public-key)
For client connections I would recommend removing the PersistentKeepAlive option as you only need it if you want the server to be able to arbitrarily reach you, or hosts on the server side to be able to reach you. It defeats the "keep quiet unless needed" security benefit of wireguard.
You could also make your script much easier to follow (and in the event of an error less likely to overwrite a good configuration file with a partially generated configuration file) by doing something like this at the end to write the file:
cat <<EOF > wg0.conf
#config for ${INFO}
[Interface]
Address = ${MYIP}
PrivateKey = ${PRIVATE}
ListenPort = 51820
DNS = 103.86.96.100, 103.86.99.100
[Peer]
PublicKey = ${PUBKEY}
AllowedIPs = 0.0.0.0/0, ::0/0
Endpoint = ${ENDPOINT}:51820
EOF
i am not much of a raspberry expert can you help with permissions
hogwarts@raspberrypi:/.scrypted $ nordvpn login Howarts xxxxx --legacy/.scrypted $ usermod -aG nordvpn hogwarts
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /run/nordvpn/nordvpnd.sock: connect: permission denied"
-Whoops! Permission denied accessing /run/nordvpn/nordvpnd.sock
Run 'usermod -aG nordvpn $USER' to fix this issue and log out of OS afterwards for this to take an effect.
hogwarts@raspberrypi:
usermod: Permission denied.
usermod: cannot lock /etc/passwd; try again later.
hogwarts@raspberrypi:~/.scrypted $ ^C
root@ubuntu-nordvpn-fetch:/NordVPN-Wireguard# ./NordVpnToWireguard.sh/NordVPN-Wireguard#
Getting configuration for recommended server...
Wireguard configuration file NordVPN-.conf created successfully!
root@ubuntu-nordvpn-fetch:
root@ubuntu-nordvpn-fetch:~/NordVPN-Wireguard# cat NordVPN-.conf
[Interface]
PrivateKey = ********************************+xb/NI3Rf4G0=
ListenPort = 51820
Address = 10.5.0.2/32
DNS = 103.86.96.100, 103.86.99.100
[Peer]
PublicKey =
AllowedIPs = 0.0.0.0/0
Endpoint = :51820
PersistentKeepalive = 25
root@ubuntu-nordvpn-fetch:~/NordVPN-Wireguard#
This is fantastic, thank you.
Is it possible to add an addition so that I can select the different category of servers?
In my nordvpn app I can select groups like this: nordvpn groups
So I was thinking we could add the --group arg to this script, so it would would additionally filter the output, e.g. NordVpnToWireguard -c US -g P2P
Africa_The_Middle_East_And_India
Onion_Over_VPN
Asia_Pacific
P2P
Double_VPN
Standard_VPN_Servers
Europe
The_Americas
Would be great to have the options to get configs from:
a) all of the servers;
b) all of the server from an specific country;
c) all of the servers from an specific city.
P.D. Thanks for this great script.
Hi ! It's possible to get the Wireguard conf file of a specific server ? For exemple "fr256"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.