Você consegue criar a vpn. Sobre IP dinâmico basta você se cadastrar num site de DDNS tipo o duckdns.org que é gratis e não tem prazo para ficar "confirmando" o domínio.
Segue meu script de update de 2 domínios simultaneamente no duckdns:
Código::local duckdnsSubDomain "DOMÍNIO1" :local duckdnsSubDomain2 "DOMÍNIO2" :local duckdnsToken "XXXXXXXXXXXXXXXXXXXXX" :local duckdnsFullDomain "$duckdnsSubDomain.duckdns.org" :local duckdnsFullDomain2 "$duckdnsSubDomain2.duckdns.org" :global actualIP :local ipDetectService2 "https://v4.ident.me/" # Detect our public IP adress useing special services :do {:set actualIP ([/tool fetch url=$ipDetectService2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: Service does not work: $ipDetectService2" }; # Very simple checks that provided IP is correct :local dotPos0 0; :local dotPos1 0; :local dotCount 0 :for i from=1 to=3 step=1 do={ :set dotPos1 [:find $actualIP "." $dotPos0]; :if ($dotPos1 > $dotPos0) do={ :set dotPos0 $dotPos1; :set dotCount ($dotCount+1)} } # Yes we just counted dots in IP address, at least it's better than nothing. :if ($dotCount < 3 or [:len $actualIP] < 7 or [:len $actualIP] > 15) do={ :log error "DuckDNS: provided public IP was not correct! Provided ip: $actualIP" :error "DuckDNS: bye!" } #:log info "$actualIP" :if ([:len [/file find where name=previousIP.txt]] < 1 ) do={ /file print file=previousIP.txt where name=previousIP.txt; /delay delay-time=2; /file set previousIP.txt contents="0.0.0.0"; }; :global previousIP value=[/file get [find where name=previousIP.txt ] value-name=contents]; #:log info "$previousIP" :if ($previousIP != $actualIP) do={ /file set previousIP.txt contents=$actualIP; :local duckRequestUrl "https://www.duckdns.org/update\?domains=$duckdnsSubDomain&token=$duckdnsToken&ip=$actualIP&verbose=true" :local duckResponse :do {:set duckResponse ([/tool fetch url=$duckRequestUrl output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server. Going to try again in a while." :delay 1m; :do {:set duckResponse ([/tool fetch url=$duckRequestUrl output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server for the second time." :error "DuckDNS: bye!" } } # Checking server's answer :if ([:pick $duckResponse 0 2] = "OK") do={ :log info "DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain" #ENVIO DE MENSAGEM POR TELEGRAM #/tool fetch "https://api.telegram.org/botXXXXXXXXXX&text=DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain" keep-result=no; } else={ :log warning "DuckDNS: There is an error occurred during IP address update, server did not answer with \"OK\" response!" } :local duckRequestUrl2 "https://www.duckdns.org/update\?domains=$duckdnsSubDomain2&token=$duckdnsToken&ip=$actualIP&verbose=true" :local duckResponse2 :do {:set duckResponse2 ([/tool fetch url=$duckRequestUrl2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server. Going to try again in a while." :delay 1m; :do {:set duckResponse2 ([/tool fetch url=$duckRequestUrl2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server for the second time." :error "DuckDNS: bye!" } } # Checking server's answer :if ([:pick $duckResponse2 0 2] = "OK") do={ :log info "DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain2" #ENVIO DE MENSAGEM POR TELEGRAM #/tool fetch "https://api.telegram.org/botXXXXXXXXXX&text=DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain2" keep-result=no; } else={ :log warning "DuckDNS: There is an error occurred during IP address update, server did not answer with \"OK\" response!" } # :log info "DuckDNS: server answer is: $duckResponse" } else={ #:log warning "[DUCKDNS] Atualização não necessária" }
Pode inclusive configurar um bot no telegram pra te avisar quando mudar de ip, como consta no código só que em comentário ###
Outro detalhe importante é saber se a conexão tem ipv4 público, se não tiver, aí não tem como ter acesso extern
Obrigado jovem, a principio quero fazer para o sistema e o servidor de arquivos que temos.Você consegue criar a vpn. Sobre IP dinâmico basta você se cadastrar num site de DDNS tipo o duckdns.org que é gratis e não tem prazo para ficar "confirmando" o domínio.
Segue meu script de update de 2 domínios simultaneamente no duckdns:
Código::local duckdnsSubDomain "DOMÍNIO1" :local duckdnsSubDomain2 "DOMÍNIO2" :local duckdnsToken "XXXXXXXXXXXXXXXXXXXXX" :local duckdnsFullDomain "$duckdnsSubDomain.duckdns.org" :local duckdnsFullDomain2 "$duckdnsSubDomain2.duckdns.org" :global actualIP :local ipDetectService2 "https://v4.ident.me/" # Detect our public IP adress useing special services :do {:set actualIP ([/tool fetch url=$ipDetectService2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: Service does not work: $ipDetectService2" }; # Very simple checks that provided IP is correct :local dotPos0 0; :local dotPos1 0; :local dotCount 0 :for i from=1 to=3 step=1 do={ :set dotPos1 [:find $actualIP "." $dotPos0]; :if ($dotPos1 > $dotPos0) do={ :set dotPos0 $dotPos1; :set dotCount ($dotCount+1)} } # Yes we just counted dots in IP address, at least it's better than nothing. :if ($dotCount < 3 or [:len $actualIP] < 7 or [:len $actualIP] > 15) do={ :log error "DuckDNS: provided public IP was not correct! Provided ip: $actualIP" :error "DuckDNS: bye!" } #:log info "$actualIP" :if ([:len [/file find where name=previousIP.txt]] < 1 ) do={ /file print file=previousIP.txt where name=previousIP.txt; /delay delay-time=2; /file set previousIP.txt contents="0.0.0.0"; }; :global previousIP value=[/file get [find where name=previousIP.txt ] value-name=contents]; #:log info "$previousIP" :if ($previousIP != $actualIP) do={ /file set previousIP.txt contents=$actualIP; :local duckRequestUrl "https://www.duckdns.org/update\?domains=$duckdnsSubDomain&token=$duckdnsToken&ip=$actualIP&verbose=true" :local duckResponse :do {:set duckResponse ([/tool fetch url=$duckRequestUrl output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server. Going to try again in a while." :delay 1m; :do {:set duckResponse ([/tool fetch url=$duckRequestUrl output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server for the second time." :error "DuckDNS: bye!" } } # Checking server's answer :if ([:pick $duckResponse 0 2] = "OK") do={ :log info "DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain" #ENVIO DE MENSAGEM POR TELEGRAM #/tool fetch "https://api.telegram.org/botXXXXXXXXXX&text=DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain" keep-result=no; } else={ :log warning "DuckDNS: There is an error occurred during IP address update, server did not answer with \"OK\" response!" } :local duckRequestUrl2 "https://www.duckdns.org/update\?domains=$duckdnsSubDomain2&token=$duckdnsToken&ip=$actualIP&verbose=true" :local duckResponse2 :do {:set duckResponse2 ([/tool fetch url=$duckRequestUrl2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server. Going to try again in a while." :delay 1m; :do {:set duckResponse2 ([/tool fetch url=$duckRequestUrl2 output=user as-value]->"data")} on-error={ :log error "DuckDNS: could not send GET request to the DuckDNS server for the second time." :error "DuckDNS: bye!" } } # Checking server's answer :if ([:pick $duckResponse2 0 2] = "OK") do={ :log info "DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain2" #ENVIO DE MENSAGEM POR TELEGRAM #/tool fetch "https://api.telegram.org/botXXXXXXXXXX&text=DuckDNS: Novo IP ($actualIP) para o dominio $duckdnsFullDomain2" keep-result=no; } else={ :log warning "DuckDNS: There is an error occurred during IP address update, server did not answer with \"OK\" response!" } # :log info "DuckDNS: server answer is: $duckResponse" } else={ #:log warning "[DUCKDNS] Atualização não necessária" }
Pode inclusive configurar um bot no telegram pra te avisar quando mudar de ip, como consta no código só que em comentário ###
Outro detalhe importante é saber se a conexão tem ipv4 público, se não tiver, aí não tem como ter acesso externo.