I wish to detect if an address IP is local or external. In a web application, my customer wish to access files directly through samba on local network, and by a download link if you are not in the network.
I may just check if my IP is 172.30.*.*
, but it won't work anymore if my customer switch to a 10.*.*.*
or IPV6.
I may use a config var, so the customer may change it at will. I would like it to be automatic, with no config var.
How would you proceed ?