|
radem
高级用户
CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『楼 主』:
怎么样才能获取公网IP
通过路由拨号上网,用ipconfig /all命令得不到公网IP,只得到“Windows IP Configuration”和“Ethernet adapter 本地连接”两大项;如果不通过路由,就可以得到ADSL公网IP了
通过路由时真的不能用ipconfig命令获取公网IP吗?
|
|
|
2008-7-7 17:51 |
|
|
bat-zw
金牌会员
永远的学习者
积分 3105
发帖 1276
注册 2008-3-8
状态 离线
|
|
2008-7-7 17:58 |
|
|
radem
高级用户
CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『第
3 楼』:
谢谢ZW兄
不过速度有点慢
加了2个参数好点:
tracert -h 1 -w 1 www.cn-dos.net
|
|
|
2008-7-7 19:26 |
|
|
pusofalse
银牌会员
积分 1604
发帖 646
注册 2008-4-13
状态 离线
|
『第
4 楼』:
tracert 的第一跳应该是网关的IP吧,不是本机的公网IP
|
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^ |
|
2008-7-7 22:59 |
|
|
radem
高级用户
CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『第
5 楼』:
Quote: | Originally posted by pusofalse at 2008-7-7 10:59 PM:
tracert 的第一跳应该是网关的IP吧,不是本机的公网IP |
|
是啊~
tracert www.cn-dos.net
只是获取域名www.cn-dos.net的服务器IP
那我的这个问题还是没有解决
|
|
|
2008-7-8 02:07 |
|
|
pusofalse
银牌会员
积分 1604
发帖 646
注册 2008-4-13
状态 离线
|
『第
6 楼』:
强大的wmic 果真有对IP的管理。。
wmic nicconfig get ipaddress /value
|
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^ |
|
2008-7-8 08:53 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-7-8 09:10 |
|
|
radem
高级用户
CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『第
8 楼』:
Quote: | Originally posted by HAT at 2008-7-8 09:10 AM:
tracert只是获取域名www.cn-dos.net的服务器IP?是你没有等到tracert执行完毕吧:) |
|
Quote: | Tracing route to www.cn-dos.net [58.215.64.130]
over a maximum of 30 hops:
1 * * * Request timed out.
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 46 ms 45 ms 45 ms 58.215.64.130
Trace complete.
请按任意键继续. . . |
|
58.215.64.130不是我本机的公网IP,而是www.cn-dos.net的服务器IP啊?
|
|
|
2008-7-8 13:25 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
『第
9 楼』:
汗水,全都是timed out
|
|
|
2008-7-8 14:19 |
|
|
tvzml
初级用户
积分 157
发帖 67
注册 2007-5-13
状态 离线
|
『第
10 楼』:
@echo off
echo On Error Resume next >checkip.vbs
echo Url="http://www.ip138.com/ip2city.asp" >>checkip.vbs
echo Set NP = Createobject("Microsoft.XMLHTTP") >>checkip.vbs
echo NP.Open "GET", url, False >>checkip.vbs
echo NP.Send >>checkip.vbs
echo Data=NP.responsebody >>checkip.vbs
echo Set NP = Nothing >>checkip.vbs
echo Data = bytes2BSTR(Data) >>checkip.vbs
echo Here = InstrRev(Data, "您的IP地址是:", -1,0) >>checkip.vbs
echo Data = Mid(Data,Here+9,13) >>checkip.vbs
echo Hers = InstrRev(data, "<",-1,0) >>checkip.vbs
echo Set ICEhack = CreateObject("InternetExplorer.Application") >>checkip.vbs
echo ICEhack.Navigate("about:blank") >>checkip.vbs
echo If Hers ^<^> 0 Then >>checkip.vbs
echo ICEhack.document.parentwindow.clipboardData.SetData "text", Mid(Data,1,Hers-1) >>checkip.vbs
echo Set WshSHell = WScript.CreateObject("WScript.Shell") >>checkip.vbs
echo Set FSO = CreateObject("Scripting.FileSystemObject") >>checkip.vbs
echo Set SCF = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(0),"ip.txt"),2,True) >>checkip.vbs
echo SCF.Write(Data) >>checkip.vbs
echo SCF.Close >>checkip.vbs
echo Else >>checkip.vbs
echo ICEhack.document.parentwindow.clipboardData.SetData "text", Data >>checkip.vbs
echo Set WshSHell = WScript.CreateObject("WScript.Shell") >>checkip.vbs
echo Set FSO = CreateObject("Scripting.FileSystemObject") >>checkip.vbs
echo Set SCF = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(0),"ip.txt"),2,True) >>checkip.vbs
echo SCF.Write(Data) >>checkip.vbs
echo SCF.Close >>checkip.vbs
echo End If >>checkip.vbs
echo ICEhack.Quit >>checkip.vbs
echo fso.DeleteFile(WScript.ScriptName) >>checkip.vbs
echo Function bytes2BSTR(vIn) >>checkip.vbs
echo strReturn = "" >>checkip.vbs
echo For i = 1 To LenB(vIn) >>checkip.vbs
echo ThisCharCode = AscB(MidB(vIn,i,1)) >>checkip.vbs
echo If ThisCharCode ^< ^&H80 Then >>checkip.vbs
echo strReturn = strReturn ^& Chr(ThisCharCode) >>checkip.vbs
echo Else >>checkip.vbs
echo NextCharCode = AscB(MidB(vIn,i+1,1)) >>checkip.vbs
echo strReturn = strReturn ^& Chr(CLng(ThisCharCode) * ^&H100 + CInt(NextCharCode)) >>checkip.vbs
echo i = i + 1 >>checkip.vbs
echo End If >>checkip.vbs
echo Next >>checkip.vbs
echo bytes2BSTR = strReturn >>checkip.vbs
echo End Function >>checkip.vbs
checkip.vbs
set/p n=<%windir%\ip.txt&cls
echo 外网IP:%n%
pause>nul
|
|
2008-7-8 23:42 |
|
|
radem
高级用户
CMD感染者
积分 691
发帖 383
注册 2008-5-23
状态 离线
|
『第
11 楼』:
谢谢十楼
那么复杂倒不如用第3方的wget
|
|
|
2008-7-9 00:06 |
|
|
pusofalse
银牌会员
积分 1604
发帖 646
注册 2008-4-13
状态 离线
|
『第
12 楼』:
@echo off
wget www.ip138.com/ips.asp&cls
for /f "tokens=3 delims=:[] " %%a in ('findstr "您的IP地址是" ips.asp') do echo 外网IP:%%a
pause
本版应该有wget.exe 搜索下。。。
|
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^ |
|
2008-7-9 00:30 |
|
|
HAT
版主
积分 9023
发帖 5017
注册 2007-5-31
状态 离线
|
|
2008-7-9 01:14 |
|