配置同时使用多条路由;
分析默认配置下的路由访问
我们首先看看当前的ISA防火墙的路由表:
C:\Documents and Settings\Administrator>route print
IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 03 ff f3 ff ff ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) #2 - Packet Scheduler Miniport
0x3 ...02 bf 0a 02 01 fe ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) - Packet Scheduler Miniport
0x10005 ...00 03 ff f2 ff ff ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) #3 - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
| Network Destination |
Netmask |
Gateway |
Interface |
Metric |
|
0.0.0.0 |
0.0.0.0 |
61.139.0.8 |
61.139.0.1 |
20 |
|
0.0.0.0 |
0.0.0.0 |
218.8.0.8 |
218.8.0.1 |
20 |
|
10.2.1.0 |
255.255.255.0 |
10.2.1.1 |
10.2.1.1 |
20 |
|
10.2.1.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
10.255.255.255 |
255.255.255.255 |
10.2.1.1 |
10.2.1.1 |
20 |
|
61.139.0.0 |
255.255.255.0 |
61.139.0.1 |
61.139.0.1 |
20 |
|
61.139.0.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
61.255.255.255 |
255.255.255.255 |
61.139.0.1 |
61.139.0.1 |
20 |
|
127.0.0.0 |
255.0.0.0 |
127.0.0.1 |
127.0.0.1 |
1 |
|
218.8.0.0 |
255.255.255.0 |
218.8.0.1 |
218.8.0.1 |
20 |
|
218.8.0.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
218.8.0.255 |
255.255.255.255 |
218.8.0.1 |
218.8.0.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
10.2.1.1 |
10.2.1.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
61.139.0.1 |
61.139.0.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
218.8.0.1 |
218.8.0.1 |
20 |
|
255.255.255.255 |
255.255.255.255 |
10.2.1.1 |
10.2.1.1 |
1 |
|
255.255.255.255 |
255.255.255.255 |
61.139.0.1 |
61.139.0.1 |
1 |
Default Gateway: 61.139.0.8
===========================================================================
Persistent Routes:
None
从上图可以看出,默认路由是通过61.139.0.8这个网关。为什么不是218.8.0.8呢?这个是通过系统网络适配器优先级来定义的,你可以通过网络连接的高级菜单的高级设置中进行调整,如下图所示:
不过,这不是我们现在所关心的,我们分别使用Istanbul的三个IP地址来访问运行在Istanbul上的Ftp服务,
首先在ISA防火墙运行ftp 61.139.0.8,使用匿名用户登录,
我们在Istanbul上的FTP管理控制台上,可以清楚的看到客户的IP地址是61.139.0.1,因为ISA防火墙的路由表中有对应的到达61.139.0.0/24子网的路由,ISA防火墙根据路由表的定义来访问,使用了61.139.0.1这个接口来进行访问。
再运行ftp 218.8.0.8,结果如下图所示,
FTP管理控制台上显示的客户端IP地址为218.8.0.1,和上面的道理是一样的,ISA防火墙使用和目的IP同个子网的接口218.8.0.8来进行访问,
最后,我们来ftp 61.153.0.8,
注意看,此时的客户端IP地址为61.139.0.1,Why?因为ISA防火墙路由表中没有对应的路由项,所以通过默认路由 61.139.0.8进行访问,使用的本地接口是对应的子网接口61.139.0.1,所以FTP服务器记录下的地址是61.139.0.1。
配置同时使用多条路由
那么,如果你想让通往61.153.0.0/24子网的路由都通过218.8.0.1这个接口,该如何进行呢?Windows早就考虑到了这点,内置了一个route命令,你可以使用它来添加路由。
注:关于route命令更为详细的信息,请参见Windows的帮助。
现在我们运行route命令来添加到达61.153.0.0/24网络的路由,使用218.8.0.8这个网关,执行命令
route add 61.153.0.0 mask 255.255.255.0 218.8.0.8 metric 1
执行后如下图所示,
我们再次运行route print命令看看ISA防火墙的路由表:
C:\Documents and Settings\Administrator>route print
IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 03 ff f3 ff ff ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) #2 - Packet Scheduler Miniport
0x3 ...02 bf 0a 02 01 fe ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) - Packet Scheduler Miniport
0x10005 ...00 03 ff f2 ff ff ...... Intel 21140-Based PCI Fast Ethernet Adapter (Generic) #3 - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
| Network Destination |
Netmask |
Gateway |
Interface |
Metric |
|
0.0.0.0 |
0.0.0.0 |
61.139.0.8 |
61.139.0.1 |
20 |
|
0.0.0.0 |
0.0.0.0 |
218.8.0.8 |
218.8.0.1 |
20 |
|
10.2.1.0 |
255.255.255.0 |
10.2.1.1 |
10.2.1.1 |
20 |
|
10.2.1.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
10.255.255.255 |
255.255.255.255 |
10.2.1.1 |
10.2.1.1 |
20 |
|
61.139.0.0 |
255.255.255.0 |
61.139.0.1 |
61.139.0.1 |
20 |
|
61.139.0.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
61.153.0.0 |
255.255.255.0 |
218.8.0.8 |
218.8.0.1 |
1 |
|
61.255.255.255 |
255.255.255.255 |
61.139.0.1 |
61.139.0.1 |
20 |
|
127.0.0.0 |
255.0.0.0 |
127.0.0.1 |
127.0.0.1 |
1 |
|
218.8.0.0 |
255.255.255.0 |
218.8.0.1 |
218.8.0.1 |
20 |
|
218.8.0.1 |
255.255.255.255 |
127.0.0.1 |
127.0.0.1 |
20 |
|
218.8.0.255 |
255.255.255.255 |
218.8.0.1 |
218.8.0.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
10.2.1.1 |
10.2.1.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
61.139.0.1 |
61.139.0.1 |
20 |
|
224.0.0.0 |
240.0.0.0 |
218.8.0.1 |
218.8.0.1 |
20 |
|
255.255.255.255 |
255.255.255.255 |
10.2.1.1 |
10.2.1.1 |
1 |
|
255.255.255.255 |
255.255.255.255 |
61.139.0.1 |
61.139.0.1 |
1 |
|
255.255.255.255 |
255.255.255.255 |
218.8.0.1 |
218.8.0.1 |
1 |
Default Gateway: 61.139.0.8
===========================================================================
Persistent Routes:
None
和上面的路由表相比,只是多了一个通向61.153.0.0/24子网的路由,现在我们再ftp 61.153.0.8试试,
注意看,在FTP管理控制台上显示的客户端IP地址已经为218.8.0.1了。
同样的道理,你可以为其他子网添加对应的路由,这样你就可以在保持原来的默认网关不变的情况下同时使用多条路由了