pushd %~dp0

%设置工作目录为变量%
set RUN_PATH=%~d0%~p0

for /f "tokens=1,2 delims==" %%a IN (config.ini) Do if Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP==%%a set Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP=%%b
for /f "tokens=1,2 delims==" %%a IN (config.ini) Do if Common_Service_01_eth3_IP==%%a set Common_Service_01_eth3_IP=%%b
for /f "tokens=1,2 delims==" %%a IN (config.ini) Do if Analyzer_Calc_Storage_01_eth0_WEB_NetMask==%%a set Analyzer_Calc_Storage_01_eth0_WEB_NetMask=%%b

netsh interface ip add address "fi" %Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP% %Analyzer_Calc_Storage_01_eth0_WEB_NetMask%

net start iphlpsvc
netsh interface portproxy add v4tov4 listenaddress=%Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP% listenport=28443 connectaddress=%Common_Service_01_eth3_IP% connectport=28443
netsh interface portproxy add v4tov4 listenaddress=%Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP% listenport=20009 connectaddress=%Common_Service_01_eth3_IP% connectport=20009
netsh interface portproxy add v4tov4 listenaddress=%Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP% listenport=20026 connectaddress=%Common_Service_01_eth3_IP% connectport=20026
netsh interface portproxy add v4tov4 listenaddress=%Analyzer_Calc_Storage_01_eth0_WEB_FLOAT_IP% listenport=20044 connectaddress=%Common_Service_01_eth3_IP% connectport=20044

net stop iphlpsvc 
net start iphlpsvc

set INTERVAL=1 
:Again  
echo start server
net start iphlpsvc
timeout %INTERVAL%
goto Again