By 8 Novembre 2018 0 Comments

Route ADD su Hostname

Tutti conosciamo il comando Route, nella forma : ROUTE ADD -p IPADREESS GATEWAYIP
da utilizzare con una sintassi di questo tipo

route add 80.211.141.12 mask 255.255.255.255 10.10.0.1

ma se abbiamo bisogno di aggiungere una route su un Hostname, rischiamo di ricevere l’errore :
The route addition failed: The parameter is incorrect.

Per risolvere il problema utilizzare questo script Batch:

:: Get IP of Domain name
setlocal EnableDelayedExpansion

set myServer=andry79fi.freeddns.org

for /f “tokens=1,2 delims=[]” %%a IN (‘ping -n 1 !myServer!’) DO (
if “%%b” NEQ “” set myServerIP=%%b
)
echo ip is %myServerIP%

route add %myServerIP% mask 255.255.255.255 10.10.0.1

Route, add Route, add Route hostname, Route hostname, Route su hostname

Posted in: NetWorking

About the Author:

shared on wplocker.com