Comments (1)
I think it's better to use a static IP, always. On Google Compute Engine a static IP does not cost you anything, it is part of the Free Tier if you provision one on their Premium Network. That said, not everyone is running this on Google Cloud - so I'm thinking out loud:
If your server is directly being assigned a public IP address, you can fetch the public IP on demand with this command. There is no network traffic associated with running this command:
ip addr show dev $(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1) scope global | awk '/inet / {split($
2,var,"/"); print var[1]}'
If you are behind a DHCP server, such as a router in your home, or in Google Compute Engine, you will not get your public IP address with the command above. You would instead see the IP address served by your DHCP server. I think the quickest way to get your public IP address is by probing a DNS server:
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}'
You could store the output of the dig command into a text file or environment variable, and compare the subsequent outputs against the contents of the file. When a change is detected, you could trigger your dynamic DNS software to update the DNS record of a domain you own.
Because DNS updates take time to propagate, when you have an opportunity to use a static IP for your VPN server, you should.
from pi-hole-on-google-compute-engine-free-tier-with-full-tunnel-and-split-tunnel-wireguard-vpn-configs.
Related Issues (20)
- Update the excellent guide HOT 1
- Misinformation about GCP's free tier in this guide? HOT 1
- Cannot access ipv6 addresses from ipv4 only network through the tunnel HOT 1
- Question on split tunnel and port forwarding HOT 1
- Network Internet Egress from Americas to China HOT 8
- Automating Wanguard installation with Docker, Terraform and Cloud Run HOT 2
- CentOS 7 hardcoded into installer, not suitable for CentOS 8
- Second run of setup.sh breaks everything HOT 2
- Upgrade F1-micro to E2-Micro by Aug. 31, 2021 HOT 4
- pi.hole domain routed to incorrect IP HOT 2
- Question - ubuntu autoupdate and clean HOT 4
- Question - Configure automated Pi-Hole updates and scheduled reboots HOT 1
- Question - Managing peer to peer communications HOT 3
- Hide IP address on server HOT 1
- Localhost querying google.internal addresses dozens of times a second
- How to make this work with my Roku Smart TV? HOT 5
- Change country HOT 1
- n
- Allowing peer-to-peer ssh/rdp/vnc
- IPv4 CIDR Block
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pi-hole-on-google-compute-engine-free-tier-with-full-tunnel-and-split-tunnel-wireguard-vpn-configs.