Due to lack of IPv4 address Dhiraagu gives a dynamic IP address to customers.
Unless a customer specifically requests for a static IP address. Even then they allow only for business customers with an extra monthly fee. So the residential customers are left with no choice but to use a dynamic IP. Which in most cases is a good thing. However, this is not good when it comes to hosting because your IP address changes everytime router restarts this would mean you will have to check for the the new IP address. 1 way to do this is searching foryour IP address on google but this isn’t possible if you are not in local network. Another way is to use a service like DynDNS or No-IP on your router if it supports it and the Huawei router dhiraagu sells do not, and from my experience (from Dlink and TP-Link) routers aren’t reliable.
Scenario where someone needs the IP address
- Manager of a small shop or cafe who wants to view DVR remotely
- Gamers who want to host for multiplayer
- Office where they need to host a service locally
- VPN access to an office network
Solution
..well the solution is IPv6, but let’s face it fossils everywhere. Lucky for us, Dhiraagu shows the IP address in their web usage portal. My idea was to take the IP address from the portal and send to No-IP for DNS update, So I have come up with a script to do just that.
Requirements
- Dhiraagu Fibre or ADSL connection
- No-IP Account Register here
- Python
- A Computer to host the script
requests
Python library
Setup - Registering and testing
- Set a username for your No-IP account.
- Create a new hostname from No-IP.
- Save the script with a
.py
file extension. I saved it as ipupdate.py - Edit quotes in line 5 to 9 with the corresponding detail.
- Run the script.
The script
|
|
Setup - Deploy
Since you will need to have the Domain auto-updated, I Would recommend using Cron job for it. To do that:
- Enter
crontab -e
in the terminal, Select an editor you want (I likenano
) - Add this line
with logging
|
|
without logging
|
|
and save it by CTRL+X
and Y
Custom Domain and DDoS Protection
The free domain no-ip gives is a subdomain of their domains, which might be fine depending on your application but if you own a domain and want to use it, You can add a CNAME record to your domain.
Type | Name | Content | TTL |
---|---|---|---|
CNAME | @ | NOIP_DOMAIN | Auto |
This may not be applicable depending on your service, but for DDoS of web service (Cafe DVR) you can use CloudFlare