Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed hard coded IPs from addClient function #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

spinpwr
Copy link

@spinpwr spinpwr commented Jun 11, 2023

IPs were hard coded in addClient function which prevented users from changing the default subnets.

The script does tell the user not to change the defaults, but changing IPs can be useful for advanced users. Ending up with client configs with wrong IPs is quite inconvenient.
So I have changed the addClient function to use the correct subnets from the params file saved during setup.

Also changed IPv4 detection when dig is not available and fixed some small issues which came up during testing the changes.

Code has been tested on Ubuntu, Debian, CentOS and Fedora (the latest versions available on google cloud)

Removed hard coded IP addresses from addClient funtion, so default
IPs can be changed and client IPs will be generated in the correct
subnet.
Also made client config counting more robust.
Added a public IPv4 detection through third party APIs which does
not depend on dig.
This can be used where dig is not installed e.g. Cent OS.
Added a check to exit the script if PiHole installation fails, as
there is no point in going further.
Fixed /etc/wireguard folder permissions on Fedore/CentOS.
It turned out that with chmod 600 sysctl cannot read the folder
contents while starting wg-quick so it fails with "wg0.conf does
not exist" error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant