在我的情况下如何正确使用路由表?

在我的情况下如何正确使用路由表?

我知道有很多关于它的教程和可能的主题,但我就是无法配置它来为我工作。我希望有人能帮助我 :) 我正在使用 Windows 10,但这应该不是问题。

因此,首先这里是我想要阻止的网站(例如):http://www.uni-pannon.hu/

Ping 返回:

C:\Windows\system32>ping www.uni-pannon.hu

Pinging www.uni-pannon.hu [193.6.32.90] with 32 bytes of data:
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62
Reply from 193.6.32.90: bytes=32 time<1ms TTL=62

Ping statistics for 193.6.32.90:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

我的默认网关似乎如下:

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : vekoll.uni-pannon.hu
   Description . . . . . . . . . . . : Realtek PCIe FE Family Controller
   Physical Address. . . . . . . . . : 74-86-7A-1B-5E-A7
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::e909:6fbe:a499:2979%8(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.3.1.122(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Lease Obtained. . . . . . . . . . : 2016. január 6., szerda 3:30:58
   Lease Expires . . . . . . . . . . : 2016. január 7., csütörtök 18:01:52
   Default Gateway . . . . . . . . . : 10.3.0.1
   DHCP Server . . . . . . . . . . . : 10.3.0.1
   DHCPv6 IAID . . . . . . . . . . . : 74745466
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1E-0E-41-5B-74-86-7A-1B-5E-A7
   DNS Servers . . . . . . . . . . . : 193.6.40.4
                                   193.6.40.2
   NetBIOS over Tcpip. . . . . . . . : Enabled

因此,作为路由网关,我选择了一个无法访问的主机:

C:\Windows\system32>ping 10.3.0.100

Pinging 10.3.0.100 with 32 bytes of data:
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.
Reply from 10.3.1.100: Destination host unreachable.

Ping statistics for 10.3.0.100:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

根据我上面复制的数据,我“制作”了以下命令:

route -p add 193.6.32.90 mask 255.255.255.0 10.3.1.100

成功添加此路由后,我尝试 ping 193.6.32.90 和两个网站,但都无法访问。然后我尝试通过浏览器访问该网站,但仍然无法访问。

谁能告诉我我哪里失败了? 在有人告诉我使用 hosts 文件之前,我想找到一种不同的方法来阻止网站(通过本机 Windows 解决方案)。

编辑:尝试冲洗,如下所示:https://stackoverflow.com/questions/9739156/how-to-flush-route-table-in-windows

编辑2:尝试添加评论建议的路线后,这是我的整个路线表:

http://pastebin.com/raw/3CGHSCKx

答案1

您可以使用以下示例创建空路由。(我的目的地 74.125.200.100)

首先发出命令 netstat -nr 并在接口列表部分下找到环回接口号。

C:\Users\Administrator>netstat -nr
===========================================================================
Interface List
 11...00 0c 29 0d bc c9 ......Intel(R) PRO/1000 MT Network Connection
  1...........................Software Loopback Interface 1
 12...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter

然后添加下面带有环回接口号的路由指向。

route add 74.125.200.100 mask 255.255.255.255 1.1.1.1 metric 1 if 1

这应该会阻止目的地,如图所示。看我的截图

相关内容