2011年10月27日星期四

check periodically if port is open from windows

因为远端的机器问题莫名其妙就连接不上了,各种原因。用netcatschtasks来定期检查本机上的端口是不是开着,没开着就重启。netcat的Windows版本见文末链接。

把以下代码存为文件test-7771.bat

@echo off

nc -z 10.17.17.177 7771
if ERRORLEVEL 1 shutdown -r -t 180

exit %RANDOM%

用以下命令添加任务计划,每10分钟执行test-7771.bat一次。

schtasks /sc MINIUTE /mo 10 /tn test-7771 /tr C:\test-7771.bat

有用的链接:
netcat (Windows), http://www.securityfocus.com/tools/139

2011年10月13日星期四

netsh portproxy not working within windows xp

netsh interface portproxy在Windows XP上边不起作用,一直报"connection refused"。因为缺少IPV6MON.DLL。需要使用ipv6 install来安装IPv6协议。如果还是不行,记得使用reset来重置之前所设置的项。具体请见文末链接。

SSH真的是非常好。今天拿到一个从路由器到内网机器的端口映射,只此一个。除去偶尔VNC来查看一下,还想要在里边多装几个Linux虚拟机,山寨一个词语,我需要“TCP port multiplexer”。嗯,SSH很好用。

参考链接
NETSH INTERFACE PORTPROXY do not work when doing port redirection between IPv4 and IPv4 addresses., http://support.microsoft.com/kb/555744/en-us
win7-xsnews.txt, http://psfreedom.com/win7-xsnews.txt