﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>PHP博客-草原的天空-文章分类-网络管理</title><link>http://www.phpweblog.net/cchxl/category/167.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 24 Jul 2007 15:16:37 GMT</lastBuildDate><pubDate>Tue, 24 Jul 2007 15:16:37 GMT</pubDate><ttl>60</ttl><item><title>VLAN学习笔记:如何在交换机上配置VLAN</title><link>http://www.phpweblog.net/cchxl/articles/1558.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Tue, 24 Jul 2007 14:17:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/1558.html</guid><description><![CDATA[<p>　　我们知道，传统的局域网Ethernet 使用具有冲突检测的载波监听多路访问( CSMA / CD )方法。在CSMA / CD 网络中，节点可以在它们有数据需要发送的任何时候使用网络。在节点传输数据之前，它进行"监听"以了解网络是否很繁忙。如果不是，则节点开始传送数据。如果网络正在使用，则节点等待。如果两个节点进行监听，没有听到任何东西，而开始同时使用线路，则会出现冲突。在发送数据时，它如果使用广播地址，那么在此网段上的所有PC都将收到数据包，这样一来如果该网段PC众多，很容易引起广播风暴。而冲突和广播风暴是影响网络性能的重要因素。为 解 决这一问题，引入了虚拟局域网（VLAN的概念。 <br></p>
<p>&nbsp;　　虚拟网络是在整个网络中通过网络交换设备建立的虚拟工作组。虚拟网在逻辑上等于OSI模型的第二层的广播域，与具体的物理网及地理位置无关。虚拟工作组可以包含不同位置的部门和工作组，不必在物理上重新配置任何端口，真正实现了网络用户与它们的物理位置无关。虚拟网技术把传统的广播域按需要分割成各个独立的子广播域，将广播限制在虚拟工作组中，由于广播域的缩小，网络中广播包消耗带宽所占的比例大大降低，网络的性能得到显著的提高。我们结合下面的图来看看讲下。图1所表示的是两层楼中的相同性质的部门划分到一个VLAN中，这样，会计的数据不会向市场的机器上广播，也不会和市场的机器发生数据冲突。所以VLAN有效的分割了冲突域和广播域。<br><br>　　我们可以在交换机的某个端口上定义VLAN ，所有连接到这个特定端口的终端都是虚拟网络的一部分，并且整个网络可以支持多个VLAN。VLAN通过建立网络防火墙使不必要的数据流量减至最少，隔离各个VLAN间的传输和可能出现的问题，使网络吞吐量大大增加，减少了网络延迟。在虚拟网络环境中，可以通过划分不同的虚拟网络来控制处于同一物理网段中的用户之间的通信。这样一来有效的实现了数据的保密工作，而且配置起来并不麻烦，网络管理员可以逻辑上重新配置网络，迅速、简单、有效地平衡负载流量，轻松自如地增加、删除和修改用户，而不必从物理上调整网络配置。既然VLAN有那么多的优点，我们为什么不了解它从而把VLAN技术应用到我们的现实网络管理中去呢。好的让我们通过实际的在Catalyst 1900交换机上来配置静态VLAN的例子来看看如何在交换机上配置VLAN。<br><br></p>
<p align=center><img src="http://www.pconline.com.cn/pcjob/nettech/cisco/others/0404/pic/2002.3.1.8.46.27.pk000000001.gif"></p>
<br><br>　　图:在Catalyst 1900 上的两个VLAN<br><br>　　设置好超级终端，连接上1900交换机后（可以参考《1900系列以太网交换机快速入门指南》或其他的CISCO参考资料），会出现如下的主配置界面： <br><br>1 user(s) now active on Management Console.<br><br>User Interface Menu<br><br>[M] Menus<br><br>[K] Command Line<br><br>[I] IP Configuration<br><br>Enter Selection:<br><br>　　我们简单介绍下，这儿显示了三个选项，[M] Menus 是主菜单，主要是交换机的初始配置和监控交换机的运行状况。[K] Command Line 是命令行，很象路由器里面用命令来配置和监控路由器一样，主要是通过命令来操作。[I] IP Configuration 是配置IP地址、子网掩码和默认网管的一个选项。这是第一次连上交换机显示的界面，如果你已经配置好了IP Configuration，那么下次登陆的时候将没有这个选项。因为用命令配置简洁明了，清晰易懂，所以我们通过 [K] Command Line 来实现VLAN的配置的。<br><br>　　设置好超级终端，连接上1900交换机后（可以参考《1900系列以太网交换机快速入门指南》或其他的CISCO参考资料），会出现如下的主配置界面： <br><br>-------------------------------------------------<br><br>1 user(s) now active on Management Console.<br><br>User Interface Menu<br><br>[M] Menus<br><br>[K] Command Line<br><br>[I] IP Configuration<br><br>Enter Selection:<br><br>　　我们简单介绍下，这儿显示了三个选项，[M] Menus 是主菜单，主要是交换机的初始配置和监控交换机的运行状况。[K] Command Line 是命令行，很象路由器里面用命令来配置和监控路由器一样，主要是通过命令来操作。[I] IP Configuration 是配置IP地址、子网掩码和默认网管的一个选项。这是第一次连上交换机显示的界面，如果你已经配置好了IP Configuration，那么下次登陆的时候将没有这个选项。因为用命令配置简洁明了，清晰易懂，所以我们通过 [K] Command Line 来实现VLAN的配置的。<br><br>　　我们选择 [K] Command Line ，进入命令行配置<br><br>Enter Selection:K 回车<br><br>CLI session with the switch is open.<br><br>To end the CLI session,enter [Exit ].<br><br>&gt;<br><br>　　现在我们进入到了交换机的普通用户模式， 就象路由器一样，这种模式只能查看现在的配置，不能更改配置，并且能够使用的命令很有限。我们输入enable，进入特权模式：<br><br>&gt;enable<br><br>#config t<br><br>Enter configuration commands,one per line.End with CNTL/Z<br><br>(config)#<br><br>为了安全和方便起见，我们给这个交换机起个名字，并且设置登陆密码。<br><br>(config)#hostname 1900Switch<br><br>1900Switch(config)# enable password level 15 goodwork<br><br>1900Switch(config)#<br><br>　　注意：密码必须是4-8位的字符。交换机密码的设置和路由器稍微不同，交换机用 level 级别的大小来决定密码的权限。Level 1 是进入命令行界面的密码，也就是说，设置了 level 1 的密码后，你下次连上交换机，并输入 K 后，就会让你输入密码，这个密码就是 level 1 设置的密码。而 level 15 是你输入了enable命令后让你输入的特权模式密码。路由器里面是使用 enable password 和 enable screet做此区分的。<br><br>　　好拉，我们已经设置好了名字和密码这样就足够安全了，让我们设置VLAN。VLAN的设置分以下2步：<br><br>1． 设置VLAN名称<br><br>2． 应用到端口<br><br>　　 我们先设置VLAN的名称。使用 vlan vlan号 name vlan名称。 在特权配置模式下进行配置：<br><br>1900Switch (config)#vlan 2 name accounting<br><br>1900Switch (config)#vlan 3 name marketing<br><br>　　 我们新配置了2个VLAN，为什么VLAN号从2开始呢？这是因为默认情况下，所有的端口否放在VLAN 1上，所以要从2开始配置。1900系列的交换机最多可以配置1024个VLAN，但是，只能有64个同时工作，当然了，这是理论上的，我们应该根据自己网络的实际需要来规划VLAN的号码。配置好了VLAN名称后我们要进入每一个端口来设置VLAN。在交换机中，要进入某个端口比如说第4个端口，要用 interface Ethernet 0/4，好的，结合上面给出的图我们让端口2、3、4和5属于VLAN2 ，端口17---22属于VLAN3 。命令是 vlan-membership static/ dynamic VLAN号 。 静态的或者动态的两者必须选择一个，后面是刚才配置的VLAN号。好的，我们看结果：<br><br>1900Switch(config)#interface ethernet 0/2<br><br>1900Switch(config-if)#vlan-membership static 2<br><br>1900Switch(config-if)#int e0/3<br><br>1900Switch(config-if)#vlan-membership static 2<br><br>1900Switch(config-if)#int e0/4 <br><br>1900Switch(config-if)#vlan-membership static 2<br><br>1900Switch(config-if)#int e0/5 <br><br>1900Switch(config-if)#vlan-membership static 2<br><br>1900Switch(config-if)#int e0/17<br><br>1900Switch(config-if)#vlan-membership static 3<br><br>。。。。。。<br><br>1900Switch(config-if)#int e0/22<br><br>1900Switch(config-if)#vlan-membership static 3<br><br>1900Switch(config-if)#<br><br>　　 好的，我们已经把VLAN都定义到了交换机的端口上了。这儿，我们只是配置的静态的，关于动态的，我们在后面会有提及的。到现在为止，我们已经把交换机的VLAN配置好了，怎么样，没有你想象的那么复杂吧：）。为了验证我们的配置，我们在特权模式使用 show vlan命令。输出如下：<br><br>1900Switch(config)#show vlan<br><br>VLAN Name Status Ports<br><br>1 default Enabled 1,6-16,22-24,AUI,A,B<br><br>2 acconting Enabled 2-5<br><br>3 marketing Enabled 17-22<br><br>1002 fddi-default Suspended<br><br>1003 token-ring-defau Suspended<br><br>1004 fddinet-default Suspended<br><br>1005 trnet-default Suspended<br><br>　　这是一个24口的交换机，并且带有AUI和两个100兆端口（A、B），可以看出来，我们的设置已经正常工作了，什么，还要不要保存running configure？当然不用了，交换机是即时自动保存的，所以不用我们使用命令来保存设置了。当然了，你也可以使用 show vlan vlan号 的命令来查看某个VLAN，比如show vlan 2 , show vlan 3. 还可以使用show vlan-membership ，改命令主要是显示交换机上的每一个端口静态或动态的属于哪个VLAN。<br><br>　　以上是给交换机配置静态VLAN的过程，下面我们看看动态的VLAN。动态的V L A N 形成很简单，由端口自己决定它属于哪个V L A N 时，就形成了动态的V L A N 。不过，这并不意味着就一层不变了，它只是一个简单的映射，这个映射取决于网络管理员创建的数据库。分配给动态V L A N 的端口被激活后，交换机就缓存初始帧的源M A C 地址，随后，交换机便向一个称为VMPS （V L A N 管理策略服务器）的外部服务器发出请求，V M P S 中包含一个文本文件，文件中存有进行V L A N 映射的M A C 地址。交换机对这个文件进行下载，然后对文件中的M A C 地址进行校验。如果在文件列表中找到M A C 地址，交换机就将端口分配给列表中的V L A N 。如果列表中没有M A C 地址，交换机就将端口分配给默认的V L A N （假设已经定义默认了V L A N ）。如果在列表中没有M A C 地址，而且也没有定义默认的V L A N ，端口不会被激活。这是维护网络安全一种非常好的的方法。从表面上看，动态V L A N 的优势很大，但它也有致命的缺点，即创建数据库是一项非常艰苦而且非常繁琐的工作。如果网络上有数千个工作站，则有大量的输入工作要做。即使有人能胜任这项工作，也还会出现与动态的V L A N 有关的很多问题。另外，保持数据库为最新也是要随时进行的非常费时的工作。所以不经常用到它，这里我们就不做详细的讲解，可以参考相关的CISCO的文档资料。<br><br>　　这么样，没有你想象的那么复杂吧。我们已经把VLAN配置好了，那么VLAN的另一部分不容忽视的工作，就是前期的对网络的规划。就是说，哪些机器在一个VLAN中，各自的IP地址、子网掩码如何分配，以及VLAN之间互相通讯的问题。只有规划计划好了，才能够在配置和以后的使用维护过程中轻松省事。<br>
<img src ="http://www.phpweblog.net/cchxl/aggbug/1558.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-07-24 22:17 <a href="http://www.phpweblog.net/cchxl/articles/1558.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>虚拟局域网（VLAN）路由实例</title><link>http://www.phpweblog.net/cchxl/articles/1557.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Tue, 24 Jul 2007 13:58:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/1557.html</guid><description><![CDATA[<p><font face=楷体_GB2312>虚拟局域网（VLAN）路由实例</font></p>
<p><font size=2>3.1. <a name=1></a>例一：</font></p>
<font size=2>
<p><img height=239 src="http://www.linkwan.com/gb/routertech/routerbase/ciscomanual/manual5_3_1.gif" width=399 border=0>&nbsp;<br></font><font size=2>设备选用Catalyst5500交换机1台，安装WS-X5530-E3管理引擎，多块WS-X5225R及WS-X5302路由交换模块,WS-X5302被直接插入交换机，通过二个通道与系统背板上的VLAN 相连，从用户角度看认为它是1个1接口的模块，此接口支持ISL。在交换机内划有3个虚拟网，分别名为default、qbw、rgw，通过WS-X5302实现虚拟网间路由。</font>
<p style="TEXT-INDENT: 21pt"><font size=2>以下加重下横线部分，如<strong><u>set system name&nbsp; 5500C</u></strong>为需设置的命令。</font></p>
<p style="TEXT-INDENT: 21pt"><font size=2>&nbsp; 设置如下：</font></p>
<p><font size=2>Catalyst 5500配置：</font></p>
<p><font size=2>&nbsp; begin</font></p>
<p><font size=2>set password $1$FMFQ$HfZR5DUszVHIRhrz4h6V70</font></p>
<p><font size=2>set enablepass $1$FMFQ$HfZR5DUszVHIRhrz4h6V70</font></p>
<p><font size=2>set prompt Console&gt;</font></p>
<p><font size=2>set length 24 default</font></p>
<p><font size=2>set logout 20</font></p>
<p><font size=2>set banner motd ^C^C</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#system</font></p>
<p><font size=2>set system baud&nbsp; 9600</font></p>
<p><font size=2>set system modem disable</font></p>
<p><strong><u><font size=2>set system name&nbsp; 5500C </font></u></strong></p>
<p><font size=2>set system location</font></p>
<p><font size=2>set system contact&nbsp;</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#ip</font></p>
<p><strong><u><font size=2>set interface sc0 1 10.230.4.240 255.255.255.0 10.230.4.255 </font></u></strong></p>
<p><font size=2>&nbsp; set interface sc0 up</font></p>
<p><font size=2>set interface sl0 0.0.0.0 0.0.0.0</font></p>
<p><font size=2>set interface sl0 up</font></p>
<p><font size=2>set arp agingtime 1200</font></p>
<p><font size=2>set ip redirect&nbsp;&nbsp; enable</font></p>
<p><font size=2>set ip unreachable&nbsp;&nbsp; enable</font></p>
<p><font size=2>set ip fragmentation enable</font></p>
<p><strong><u><font size=2>set ip route 0.0.0.0 10.230.4.15 1 </font></u></strong></p>
<p><font size=2>set ip alias default 0.0.0.0</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#Command alias</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#vtp</font></p>
<p><strong><u><font size=2>set vtp domain hne </font></u></strong></p>
<p><strong><u><font size=2>set vtp mode server </font></u></strong></p>
<p><font size=2>set vtp v2 disable</font></p>
<p><font size=2>set vtp pruning disable</font></p>
<p><font size=2>set vtp pruneeligible 2-1000</font></p>
<p><font size=2>clear vtp pruneeligible 1001-1005</font></p>
<p><strong><u><font size=2>set vlan 1 name default type ethernet mtu 1500 said 100001 state active </font></u></strong></p>
<p><strong><u><font size=2>set vlan 777 name rgw type ethernet mtu 1500 said 100777 state active </font></u></strong></p>
<p><strong><u><font size=2>set vlan 888 name qbw type ethernet mtu 1500 said 100888 state active </font></u></strong></p>
<p><font size=2>set vlan 1002 name fddi-default type fddi mtu 1500 said 101002 state active</font></p>
<p><font size=2>set vlan 1004 name fddinet-default type fddinet mtu 1500 said 101004 state active bridge 0x0 stp ieee</font></p>
<p><font size=2>set vlan 1005 name trnet-default type trbrf mtu 1500 said 101005 state active bridge 0x0 stp ibm</font></p>
<p><font size=2>set vlan 1003 name token-ring-default type trcrf mtu 1500 said 101003 state active parent 0 ring 0x0 mode srb aremaxhop 7 stemaxhop 7</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#set boot command</font></p>
<p><font size=2>set boot config-register 0x102</font></p>
<p><font size=2>set boot system flash bootflash:cat5000-sup3.4-3-1a.bin</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 1 : 2-port 1000BaseLX Supervisor</font></p>
<p><font size=2>set module name&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;</font></p>
<p><font size=2>set vlan 1&nbsp;&nbsp;&nbsp; 1/1-2</font></p>
<p><font size=2>set port enable&nbsp;&nbsp;&nbsp;&nbsp; 1/1-2</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 2 : empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 3 : 24-port 10/100BaseTX Ethernet</font></p>
<p><font size=2>set module name&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp;</font></p>
<p><font size=2>set module enable&nbsp; 3</font></p>
<p><strong><u><font size=2>set vlan 1&nbsp;&nbsp;&nbsp; 3/1-22 </font></u></strong></p>
<p><strong><u><font size=2>set vlan 777&nbsp; 3/23 </font></u></strong></p>
<p><strong><u><font size=2>set vlan 888&nbsp; 3/24 </font></u></strong></p>
<p><strong><u><font size=2>set trunk 3/1&nbsp; on isl 1-1005 </font></u></strong></p>
<p><font size=2>#module 4 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 5 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 6 : 1-port Route Switch</font></p>
<p><font size=2>set module name&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp;</font></p>
<p><font size=2>set port level&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/1&nbsp; normal</font></p>
<p><font size=2>set port trap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/1&nbsp; disable</font></p>
<p><font size=2>set port name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6/1</font></p>
<p><font size=2>set cdp enable&nbsp;&nbsp; 6/1</font></p>
<p><font size=2>set cdp interval 6/1 60</font></p>
<p><strong><u><font size=2>set trunk 6/1&nbsp; on isl 1-1005 </font></u></strong></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 7 : 24-port 10/100BaseTX Ethernet</font></p>
<p><font size=2>set module name&nbsp;&nbsp;&nbsp; 7&nbsp;&nbsp;&nbsp;</font></p>
<p><font size=2>set module enable&nbsp; 7</font></p>
<p><strong><u><font size=2>set vlan 1&nbsp;&nbsp;&nbsp; 7/1-22 </font></u></strong></p>
<p><strong><u><font size=2>set vlan 888&nbsp; 7/23-24 </font></u></strong></p>
<p><strong><u><font size=2>set trunk 7/1 on isl 1-1005 </font></u></strong></p>
<p><strong><u><font size=2>set trunk 7/2 on isl 1-1005 </font></u></strong></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 8 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 9 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 10 : 12-port 100BaseFX MM Ethernet</font></p>
<p><font size=2>set module name&nbsp;&nbsp;&nbsp; 10&nbsp;&nbsp;</font></p>
<p><font size=2>set module enable&nbsp; 10</font></p>
<p><font size=2>set vlan 1&nbsp;&nbsp;&nbsp; 10/1-12</font></p>
<p><font size=2>set port channel 10/1-4 off</font></p>
<p><font size=2>set port channel 10/5-8 off</font></p>
<p><font size=2>set port channel 10/9-12 off</font></p>
<p><font size=2>set port channel 10/1-2 on</font></p>
<p><font size=2>set port channel 10/3-4 on</font></p>
<p><font size=2>set port channel 10/5-6 on</font></p>
<p><font size=2>set port channel 10/7-8 on</font></p>
<p><font size=2>set port channel 10/9-10 on</font></p>
<p><font size=2>set port channel 10/11-12 on</font></p>
<p><font size=2>#module 11 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 12 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#module 13 empty</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#switch port analyzer</font></p>
<p><font size=2>!set span 1 1/1 both inpkts disable</font></p>
<p><font size=2>set span disable</font></p>
<p><font size=2>!</font></p>
<p><font size=2>#cam</font></p>
<p><font size=2>set cam agingtime 1-2,777,888,1003,1005 300</font></p>
<p><font size=2>end</font></p>
<p><font size=2>5500C&gt; (enable)</font></p>
<p><font size=2>&nbsp; WS-X5302路由模块设置：</font></p>
<p><font size=2>&nbsp; Router#wri t</font></p>
<p><font size=2>Building configuration...</font></p>
<p><font size=2>&nbsp; Current configuration:</font></p>
<p><font size=2>!</font></p>
<p><font size=2>version 11.2</font></p>
<p><font size=2>no service password-encryption</font></p>
<p><font size=2>no service udp-small-servers</font></p>
<p><font size=2>no service tcp-small-servers</font></p>
<p><font size=2>!</font></p>
<p><font size=2>hostname Router</font></p>
<p><font size=2>!</font></p>
<p><font size=2>enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.</font></p>
<p><font size=2>!</font></p>
<p><font size=2>ip subnet-zero</font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface Vlan1 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.2.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface Vlan777 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.3.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface Vlan888 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.4.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><font size=2>no ip classless</font></p>
<p><font size=2>!</font></p>
<p><font size=2>line con 0</font></p>
<p><font size=2>line aux 0</font></p>
<p><font size=2>line vty 0 4</font></p>
<p><font size=2>&nbsp;password router</font></p>
<p><font size=2>&nbsp;login</font></p>
<p><font size=2>!</font></p>
<p><font size=2>end</font></p>
<p><font size=2>&nbsp; Router#</font></p>
<p><font size=2>&nbsp; 3.1. <a name=2></a>例二：</font></p>
<p style="TEXT-INDENT: 21.25pt"><font size=2>交换设备仍选用Catalyst5500交换机1台，安装WS-X5530-E3管理引擎，多块WS-X5225R在交换机内划有3个虚拟网，分别名为default、qbw、rgw，通过Cisco3640路由器实现虚拟网间路由。交换机设置与例一类似。</font></p>
<p style="TEXT-INDENT: 21.25pt"><font size=2>路由器Cisco3640，配有一块NM-1FE-TX模块，此模块带有一个快速以太网接口可以支持ISL。Cisco3640快速以太网接口与交换机上的某一支持ISL的端口实现连接，如交换机第3槽第1个接口（3/1口）。</font></p>
<p><font size=2>&nbsp; Router#wri t</font></p>
<p><font size=2>Building configuration...&nbsp; </font></p>
<p><font size=2>Current configuration:</font></p>
<p><font size=2>!</font></p>
<p><font size=2>version 11.2</font></p>
<p><font size=2>no service password-encryption</font></p>
<p><font size=2>no service udp-small-servers</font></p>
<p><font size=2>no service tcp-small-servers</font></p>
<p><font size=2>!</font></p>
<p><font size=2>hostname Router</font></p>
<p><font size=2>!</font></p>
<p><font size=2>enable secret 5 $1$w1kK$AJK69fGOD7BqKhKcSNBf6.</font></p>
<p><font size=2>!</font></p>
<p><font size=2>ip subnet-zero</font></p>
<p><font size=2>!</font></p>
<p><font size=2>interface FastEthernet1/0</font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface FastEthernet1/0.1 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;encapsulation isl 1 </u></strong></font></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.2.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface FastEthernet1/0.2 </font></u></strong></p>
<p><strong><u><font size=2>encapsulation isl 777 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.3.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><strong><u><font size=2>interface FastEthernet1/0.3 </font></u></strong></p>
<p><font size=2><strong><u>&nbsp;encapsulation isl 888 </u></strong></font></p>
<p><font size=2><strong><u>&nbsp;ip address 10.230.4.56 255.255.255.0 </u></strong></font></p>
<p><font size=2>!</font></p>
<p><font size=2>no ip classless</font></p>
<p><font size=2>!</font></p>
<p><font size=2>line con 0</font></p>
<p><font size=2>line aux 0</font></p>
<p><font size=2>line vty 0 4</font></p>
<p><font size=2>&nbsp;password router</font></p>
<p><font size=2>&nbsp;login</font></p>
<p><font size=2>!</font></p>
<p><font size=2>end</font></p>
<p><font size=2>&nbsp; Router#</font></p>
<img src ="http://www.phpweblog.net/cchxl/aggbug/1557.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-07-24 21:58 <a href="http://www.phpweblog.net/cchxl/articles/1557.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CISCO交换机VLAN配置思路</title><link>http://www.phpweblog.net/cchxl/articles/1556.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Tue, 24 Jul 2007 13:56:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/1556.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/1556.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/1556.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/1556.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/1556.html</trackback:ping><description><![CDATA[在交换机上创建vlan<br>1.建立一个vtp管理域<br>&#215;为了在交换机上创建vlan，必须首先建立一个vtp管理域以使它能够核验网络上当前的vlan<br>&#215;Catalyst 4000 系列交换机模块只支持802.1q。<br>&#215;判断硬件是否支持干道，及硬件所支持的干道封装使用：show portcapabilities<br>首先运行 clear config allvtp command：<br>在基于IOS的交换机上配置VTP管理域或加入一个管理域:<br>switch# vlan database<br>switch(vlan)# vtp domain domain-name<br>在基于CLI的交换机上配置VTP管理域:<br>switch(enable) set vtp [domain domain-name] passwd password在基于IOS的交换机上配置VTP 模式:<br>switch# vlan database<br>switch(vlan)# vtp domain domain-name<br>switch(vlan)# vtp {sever|cilent|transparent}<br>switch(vlan)# vtp password password<br>在基于CLI的交换机上配置VTP 模式:<br>switch(enable) set vtp [domain domain-name] [mode{sever|cilent|transparent }][password password]<br>核验vtp的配置：<br>show vtp domain<br>show vtp statistics<br>在基于IOS的交换机上配置VTP版本:<br>&#215;VTP版本1是缺省配置<br>switch# vlan database<br>switch(vlan)# vtp v2-mode<br>在基于CLI的交换机上配置VTP版本 :<br>switch(enable) set vtp v2 enable在基于IOS的交换机上启动VTP剪裁:<br>switch# vlan database<br>switch(vlan)# vtp pruning<br>在基于CLI 的交换机上启动VTP剪裁:<br>switch(enable) set vtp pruning enable<br>（set vtp pruneeligible vlan－range）<br>不起用vtp修剪：<br>clear vtp pruneeligible vlan－range<br>核验vtp修剪的配置：<br>show trunk<br>2.创建Vlan在基于IOS的交换机上配置静态VLAN:<br>switch# vlan database<br>switch(vlan)# vlan vlan-num name vlan-name<br>switch(vlan)# exit<br>switch# configure teriminal<br>switch(config)# interface interface module/number<br>switch(config-if)# switchport mode access<br>switch(config-if)# switchport access vlan vlan-num<br>switch(config-if)# end<br>在基于CLI的交换机上配置静态VLAN:<br>switch(enable) set vlan vlan-num [name name]<br>switch(enable) set vlan vlan-num mod-num/port-list核验配置：show vlan<br>3.配置干道链路<br>干道是在两台catalyst交换机端口或catalyst交换机与路由器间的一条点对点链路。<br>干道链路可以承载多个vlan。<br>在基于IOS的交换机上配置干道链路<br>switch(config)# interface interface mod/port<br>switch(config-if)# switchport mode trunk<br>switch(config-if)# switchport trunk encapsulation {isl|dotlq}<br>switch(config-if)# switchport trunk allowed vlan remove vlan-list<br>switch(config-if)# switchport trunk allowed vlan add vlan-list<br>在基于CLI的交换机上配置干道链路:<br>switch(enable) set trunk module/port[on|off|desirable|auto|nonegotiate]<br>Vlan-range<br>
<img src ="http://www.phpweblog.net/cchxl/aggbug/1556.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-07-24 21:56 <a href="http://www.phpweblog.net/cchxl/articles/1556.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>此系统的本地策略不允许您采用交互式登录解决方法</title><link>http://www.phpweblog.net/cchxl/articles/1025.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Sat, 24 Mar 2007 01:58:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/1025.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/1025.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/1025.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/1025.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/1025.html</trackback:ping><description><![CDATA[如果计算机是一台不在域中的单独的Windows 2000计算机，参考以下步骤：<br /><br />1)       启动故障计算机至登录状态；<br /><br />2)       登录到网络中的另外一台Windows 2000 或 Windows XP的计算机上，打开开始，单击运行，键入cmd,回车；<br /><br />3)       在命令行模式下运行 net use \\computername\ipc$ /user:administrator password,请使用正确的参变量值替代其中的computername、password；<br /><br />4)       打开开始，单击运行，键入\\computername\c$\security\database, 在打开的窗口中重新命名secedit.sdb至色Secedit.old，将一个标准版本的数据库文件拷贝至该目录，标准版本的数据库文件可以在未更改过组策略的单独的相应的计算机的c:\winnt\security\database中获得。（假设您的系统安装在c:\）；<br /><br />5)       重新启动故障计算机，尝试登录。<br /><br /><br /><br />如果计算机是在域中一台Windows 2000客户端或member server，参考以下步骤：<br /><br />1)     请检查Site、Domain、OU级别的组策略，是否定义过本地登录，拒绝本地登录的选项，具体位置在 计算机配置&gt;Windows设置〉安全设置〉本地策略〉用户权利指派；<br /><br />2)     如在该设置中有错误设置，请更正后，重新启动客户端；<br /><br />3)     如果仍然不可以，请参考以上的五步重置secedit.db文件，断开故障计算机的网络，重新启动该计算机再尝试登录；<br /><br /><br /><br />如果该计算机是一台域控制器，请参考以下步骤：<br /><br />1）  以管理员的身份登录网络中的另外一台Windows 2000的计算机；<br /><br />2）  获得ntrights.exe Resource Kit工具，将之拷贝到系统盘的Winnt\system32目录中；<br /><br />3）  如果您确认该问题是因为更改的组策略，对某个用户或组设置了拒绝本地登录而导致，在命令行中运行：<br /><br />ntrights -m \\computer -u &lt;group or user to remove&gt; -r SeDenyInteractiveLogonRight<br /><br />4）  如果您确认该问题是因为更改的组策略，删除某个用户或组的本地登录的权限而导致，在命令行中运行：<br /><br />ntrights -m \\computer -u &lt;group or user to remove&gt; +r SeInteractiveLogonRight<br /><br />5）  重新启动故障计算机，再次尝试登录。<img src ="http://www.phpweblog.net/cchxl/aggbug/1025.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-03-24 09:58 <a href="http://www.phpweblog.net/cchxl/articles/1025.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>远程桌面的WEB链接</title><link>http://www.phpweblog.net/cchxl/articles/988.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Thu, 15 Mar 2007 02:53:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/988.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/988.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/988.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/988.html</trackback:ping><description><![CDATA[
		<span class="oblog_text"> 
<div style="FONT-SIZE: 14px">基于个人原因,我在笔记本上装了个苹果机的操作系统,没有windows远程桌面的客户端,也找不到用于苹果用于连接Windows Server的软件,在这就把终端服务器的一个小的功能说一下.<br />先要安装一下Internet信息服务,点击详细信息,万维网服务的详细信息，选上远程桌面WEB链接.安装基于web链接的客户端组件.</div><div><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/1_PQNUEeLSfuJp.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/1_PQNUEeLSfuJp.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /></div><div style="FONT-SIZE: 14px">服务器端启用远程桌面链接<br />还可以设定那些用户可以连接过来．如图：</div><div><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/2_jDktcene3tyi.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/2_jDktcene3tyi.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /></div><div style="FONT-SIZE: 14px">客户端访问<br />在开始菜单，运行框中输入HTTP//服务器名/TSWEB，<br />出现如图：若客户端第一次使用，会要求下载Ａctive控件，在服务器后的文本框中输入远程桌面的分辨率，选择全屏就跟mstsc(远程桌面客户端工具)一样，不是全屏就会在IE上显示，如图：</div><div><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/3_x8f2IDDku6Sc.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/3_x8f2IDDku6Sc.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /></div><div><div style="FONT-SIZE: 14px">我的服务器端装的是2003sp1 Enterprise Edition 版，可以安装终端服务配置，<br />主要用于客户端设备映射连接，这只是其中的好处，<br />Windows 2003终端服务具有三个主要优点．<br />快速，集中地部署应用程序，访问数据时仅占用低度带宽，由于可以通过任何设备（包括功能不够强大的硬件和非Windows桌面系统）访问最新应用程序，终端服务器提高了用户的生产力．</div><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/4_v15LWY95keMS.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/4_v15LWY95keMS.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /><br /><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/5_vaYhLA9z1WRw.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/5_vaYhLA9z1WRw.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /></div></span>
<img src ="http://www.phpweblog.net/cchxl/aggbug/988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-03-15 10:53 <a href="http://www.phpweblog.net/cchxl/articles/988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网络管理之 ICMP 篇</title><link>http://www.phpweblog.net/cchxl/articles/979.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Wed, 14 Mar 2007 08:26:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/979.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/979.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/979.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/979.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/979.html</trackback:ping><description><![CDATA[
		<span class="oblog_text"> 
<div style="FONT-SIZE: 14px">对TCP/IP协议你一定非常熟悉，但是对ICMP协议你可能就一无所知了。ICMP协议是一个非常重要的协议，它对于网络安全具有极其重要的意义。下面我们就来谈谈ICMP协议。<br /><br />什么是ICMP协议<br /><br />ICMP是“Internet Control Message Protocol”（Internet控制消息协议）的缩写。它是TCP/IP协议族的一个子协议，用于在IP主机、路由器之间传递控制消息。控制消息是指网络通不通、主机是否可达、路由是否可用等网络本身的消息。这些控制消息虽然并不传输用户数据，但是对于用户数据的传递起着重要的作用。<br /><br />我们在网络中经常会使用到ICMP协议，只不过我们觉察不到而已。比如我们经常使用的用于检查网络通不通的Ping命令，这个“Ping”的过程实际上就是ICMP协议工作的过程。还有其他的网络命令如跟踪路由的Tracert命令也是基于ICMP协议的。<br /><br />ICMP的重要性<br /><br />ICMP协议对于网络安全具有极其重要的意义。ICMP协议本身的特点决定了它非常容易被用于攻击网络上的路由器和主机。例如，在1999年8月海信集团“悬赏”50万元人民币测试防火墙的过程中，其防火墙遭受到的ICMP攻击达334050次之多，占整个攻击总数的90%以上！可见，ICMP的重要性绝不可以忽视！<br /><br />比如，可以利用操作系统规定的ICMP数据包最大尺寸不超过64KB这一规定，向主机发起“Ping of Death”（死亡之Ping）攻击。“Ping of Death” 攻击的原理是：如果ICMP数据包的尺寸超过64KB上限时，主机就会出现内存分配错误，导致TCP/IP堆栈崩溃，致使主机死机。<br /><br />此外，向目标主机长时间、连续、大量地发送ICMP数据包，也会最终使系统瘫痪。大量的ICMP数据包会形成“ICMP风暴”，使得目标主机耗费大量的CPU资源处理，疲于奔命。<br /><br />应对ICMP攻击<br /><br />虽然ICMP协议给黑客以可乘之机，但是ICMP攻击也并非无药可医。只要在日常网络管理中未雨绸缪，提前做好准备，就可以有效地避免ICMP攻击造成的损失。<br /><br /><br />对于“Ping of Death”攻击，可以采取两种方法进行防范：第一种方法是在路由器上对ICMP数据包进行带宽限制，将ICMP占用的带宽控制在一定的范围内，这样即使有ICMP攻击，它所占用的带宽也是非常有限的，对整个网络的影响非常少；第二种方法就是在主机上设置ICMP数据包的处理规则，最好是设定拒绝所有的ICMP数据包。<br /><br />设置ICMP数据包处理规则的方法也有两种，一种是在操作系统上设置包过滤，另一种是在主机上安装防火墙。具体设置如下：<br /><br />1．在Windows 2000 Server中设置ICMP过滤<br /><br />Windows 2000 Server提供了“路由与远程访问”服务，但是默认情况下是没有启动的，因此首先要启动它：点击“管理工具”中的“路由与远程访问”，启动设置向导。在其中选择“手动配置服务器”项，点击[下一步]按钮。稍等片刻后，系统会提示“路由和远程访问服务现在已被安装。要开始服务吗？”，点击[是]按钮启动服务。<br /><br />服务启动后，在计算机名称的分支下会出现一个“IP路由选择”，点击它展开分支，再点击“常规”，会在右边出现服务器中的网络连接（即网卡）。用鼠标右键点击你要配置的网络连接，在弹出的菜单中点击“属性”，会弹出一个网络连接属性的窗口，如图1所示。<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/20070213_e4696dbdc77c9db3d6b6kypz4vST0bNW.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/20070213_e4696dbdc77c9db3d6b6kypz4vST0bNW.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /><br /><br /></div><div style="FONT-SIZE: 14px">图1中有两个按钮，一个是“输入筛选器”（指对此服务器接受的数据包进行筛选），另一个是“输出筛选器”（指对此服务器发送的数据包进行筛选），这里应该点击[输入筛选器] 按钮，会弹出一个“添加筛选器”窗口，再点击[添加]按钮，表示要增加一个筛选条件。<br /><br />在“协议”右边的下拉列表中选择“ICMP”，在随后出现的“ICMP类型”和“ICMP编码”中均输入“255”，代表所有的ICMP类型及其编码。ICMP有许多不同的类型（Ping就是一种类型），每种类型也有许多不同的状态，用不同的“编码”来表示。因为其类型和编码很复杂，这里不再叙述。<br /><br />点击[确定]按钮返回“输入筛选器”窗口，此时会发现“筛选器”列表中多了一项内容（如图2所示）。点击[确定]按钮返回“本地连接”窗口，再点击[确定]按钮，此时筛选器就生效了，从其他计算机上Ping这台主机就不会成功了。<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/20070213_4694dc4ad23f52d2e123YGJt9Huv70Li.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/20070213_4694dc4ad23f52d2e123YGJt9Huv70Li.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /></div><div><div style="FONT-SIZE: 14px"><br />2． 用防火墙设置ICMP过滤<br /><br />现在许多防火墙在默认情况下都启用了ICMP过滤的功能。如果没有启用，只要选中“防御ICMP攻击”、“防止别人用ping命令探测”就可以了，如图3所示。<br /><br />通过以上讲解，你现在知道ICMP的重要性了吧？赶紧给你的服务器设置ICMP过滤吧。</div><br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/20070213_8eb6631a124fe88700e3mEN2HdiFWvc6.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/20070213_8eb6631a124fe88700e3mEN2HdiFWvc6.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> </div></span>
<img src ="http://www.phpweblog.net/cchxl/aggbug/979.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-03-14 16:26 <a href="http://www.phpweblog.net/cchxl/articles/979.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网络管理之 ARP篇</title><link>http://www.phpweblog.net/cchxl/articles/978.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Wed, 14 Mar 2007 08:23:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/978.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/978.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/978.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/978.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/978.html</trackback:ping><description><![CDATA[
		<span class="oblog_text">
				<div style="FONT-SIZE: 14px">我们知道，当我们在浏览器里面输入网址时，DNS服务器会自动把它解析为IP地址，浏览器实际上查找的是IP地址而不是网址。那么IP地址是如何转换为第二层物理地址（即MAC地址）的呢？在局域网中，这是通过ARP协议来完成的。ARP协议对网络安全具有重要的意义。通过伪造IP地址和MAC地址实现ARP欺骗，能够在网络中产生大量的ARP通信量使网络阻塞。所以网管们应深入理解ARP协议。<br /><br />一、什么是ARP协议<br /><br />ARP协议是“Address Resolution Protocol”（地址解析协议）的缩写。在局域网中，网络中实际传输的是“帧”，帧里面是有目标主机的MAC地址的。在以太网中，一个主机要和另一个主机进行直接通信，必须要知道目标主机的MAC地址。但这个目标MAC地址是如何获得的呢？它就是通过地址解析协议获得的。所谓“地址解析”就是主机在发送帧前将目标IP地址转换成目标MAC地址的过程。ARP协议的基本功能就是通过目标设备的IP地址，查询目标设备的MAC地址，以保证通信的顺利进行。<br /><br />二、ARP协议的工作原理<br /><br />在每台安装有TCP/IP协议的电脑里都有一个ARP缓存表，表里的IP地址与MAC地址是一一对应的，如附表所示。<br /><br />附表<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/20070213_e90190d76b5dfce608efCTvPzLHY90N7.gif');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/20070213_e90190d76b5dfce608efCTvPzLHY90N7.gif" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /><br /></div>
				<div style="FONT-SIZE: 14px">
						<br />我们以主机A（192.168.1.5）向主机B（192.168.1.1）发送数据为例。当发送数据时，主机A会在自己的ARP缓存表中寻找是否有目标IP地址。如果找到了，也就知道了目标MAC地址，直接把目标MAC地址写入帧里面发送就可以了；如果在ARP缓存表中没有找到相对应的IP地址，主机A就会在网络上发送一个广播，目标MAC地址是“FF.FF.FF.FF.FF.FF”，这表示向同一网段内的所有主机发出这样的询问：“192.168.1.1的MAC地址是什么？”网络上其他主机并不响应ARP询问，只有主机B接收到这个帧时，才向主机A做出这样的回应：“192.168.1.1的MAC地址是00-aa-00-62-c6-09”。这样，主机A就知道了主机B的MAC地址，它就可以向主机B发送信息了。同时它还更新了自己的ARP缓存表，下次再向主机B发送信息时，直接从ARP缓存表里查找就可以了。ARP缓存表采用了老化机制，在一段时间内如果表中的某一行没有使用，就会被删除，这样可以大大减少ARP缓存表的长度，加快查询速度。</div>
				<div>
						<br />
						<br />
						<img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/20070213_978f793086530e59e6d20qsK94NZfxKe.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/20070213_978f793086530e59e6d20qsK94NZfxKe.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /></div>
				<div>
						<div style="FONT-SIZE: 14px">三、如何查看ARP缓存表<br /><br />ARP缓存表是可以查看的，也可以添加和修改。在命令提示符下，输入“arp -a”就可以查看ARP缓存表中的内容了，如附图所示。<br /><br />用“arp -d”命令可以删除ARP表中某一行的内容；用“arp -s”可以手动在ARP表中指定IP地址与MAC地址的对应。</div>
				</div>
		</span>
<img src ="http://www.phpweblog.net/cchxl/aggbug/978.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-03-14 16:23 <a href="http://www.phpweblog.net/cchxl/articles/978.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>网络管理 TCP/UDP篇</title><link>http://www.phpweblog.net/cchxl/articles/977.html</link><dc:creator>草原的天空</dc:creator><author>草原的天空</author><pubDate>Wed, 14 Mar 2007 08:21:00 GMT</pubDate><guid>http://www.phpweblog.net/cchxl/articles/977.html</guid><wfw:comment>http://www.phpweblog.net/cchxl/comments/977.html</wfw:comment><comments>http://www.phpweblog.net/cchxl/articles/977.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.phpweblog.net/cchxl/comments/commentRss/977.html</wfw:commentRss><trackback:ping>http://www.phpweblog.net/cchxl/services/trackbacks/977.html</trackback:ping><description><![CDATA[
		<span class="oblog_text"> 
<div style="FONT-SIZE: 14px">我们学习过什么是“数据包”。理解数据包，对于网络管理的网络安全具有至关重要的意义。比如，防火墙的作用本质就是检测网络中的数据包，判断其是否违反了预先设置的规则，如果违反就加以阻止。图1就是瑞星个人版防火墙软件设置规则的界面。细心的读者会发现，图1中的“协议”栏中有“TCP”、“UDP”等名词，它们是什么意思呢？现在我们就来讲讲什么是TCP和UDP。<br /><br />面向连接的TCP<br /><br />“面向连接”就是在正式通信前必须要与对方建立起连接。比如你给别人打电话，必须等线路接通了、对方拿起话筒才能相互通话。<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/A_hYAJixgRW07z.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/A_hYAJixgRW07z.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /><br /></div><div style="FONT-SIZE: 14px"><br />TCP（Transmission Control Protocol，传输控制协议）是基于连接的协议，也就是说，在正式收发数据前，必须和对方建立可靠的连接。一个TCP连接必须要经过三次“对话”才能建立起来，其中的过程非常复杂，我们这里只做简单、形象的介绍，你只要做到能够理解这个过程即可。我们来看看这三次对话的简单过程：主机A向主机B发出连接请求数据包：“我想给你发数据，可以吗？”，这是第一次对话；主机B向主机A发送同意连接和要求同步（同步就是两台主机一个在发送，一个在接收，协调工作）的数据包：“可以，你什么时候发？”，这是第二次对话；主机A再发出一个数据包确认主机B的要求同步：“我现在就发，你接着吧！”，这是第三次对话。三次“对话”的目的是使数据包的发送和接收同步，经过三次“对话”之后，主机A才向主机B正式发送数据。<br /><br />TCP协议能为应用程序提供可靠的通信连接，使一台计算机发出的字节流无差错地发往网络上的其他计算机，对可靠性要求高的数据通信系统往往使用TCP协议传输数据。<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/B_iXkCSJ4yEEUB.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/B_iXkCSJ4yEEUB.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /></div><div style="FONT-SIZE: 14px">我们来做一个实验，用计算机A（安装Windows 2000 Server操作系统）从“网上邻居”上的一台计算机B拷贝大小为8,644,608字节的文件，通过状态栏右下角网卡的发送和接收指标就会发现：虽然是数据流是由计算机B流向计算机A，但是计算机A仍发送了3,456个数据包，如图2所示。这些数据包是怎样产生的呢？因为文件传输时使用了TCP/IP协议，更确切地说是使用了面向连接的TCP协议，计算机A接收数据包的时候，要向计算机B回发数据包，所以也产生了一些通信量。<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/C_44V1e2WCkEWX.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/C_44V1e2WCkEWX.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /></div><div style="FONT-SIZE: 14px">如果事先用网络监视器监视网络流量，就会发现由此产生的数据流量是9,478,819字节，比文件大小多出10.96%（如图3所示），原因不仅在于数据包和帧本身占用了一些空间，而且也在于TCP协议面向连接的特性导致了一些额外的通信量的产生。<br /><br />面向非连接的UDP协议<br /><br />“面向非连接”就是在正式通信前不必与对方先建立连接，不管对方状态就直接发送。这与现在风行的手机短信非常相似：你在发短信的时候，只需要输入对方手机号就OK了。<br /><br />UDP（User Data Protocol，用户数据报协议）是与TCP相对应的协议。它是面向非连接的协议，它不与对方建立连接，而是直接就把数据包发送过去<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/D_93XGHbu0nC2u.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/D_93XGHbu0nC2u.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> <br /></div><div><div style="FONT-SIZE: 14px">UDP适用于一次只传送少量数据、对可靠性要求不高的应用环境。比如，我们经常使用“ping”命令来测试两台主机之间TCP/IP通信是否正常，其实“ping”命令的原理就是向对方主机发送UDP数据包，然后对方主机确认收到数据包，如果数据包是否到达的消息及时反馈回来，那么网络就是通的。例如，在默认状态下，一次“ping”操作发送4个数据包（如图2所示）。大家可以看到，发送的数据包数量是4包，收到的也是4包（因为对方主机收到后会发回一个确认收到的数据包）。这充分说明了UDP协议是面向非连接的协议，没有建立连接的过程。正因为UDP协议没有连接的过程，所以它的通信效果高；但也正因为如此，它的可靠性不如TCP协议高。QQ就使用UDP发消息，因此有时会出现收不到消息的情况。<br />      TCP协议和UDP协议各有所长、各有所短，适用于不同要求的通信环境。TCP协议和UDP协议之间的差别如附表所示。<br /><br />　　附表：tcp协议和udp协议的差别<br /><br /><img onmousewheel="return imgzoom(this);" onmouseover="if(this.resized) this.style.cursor='hand';" onclick="if(!this.resized) {return false;} else {window.open('attachments/month_0702/E_NDQfY5B73Xje.jpg');}" alt="" src="http://www.winos.cn/forum/attachments/month_0702/E_NDQfY5B73Xje.jpg" onload="if(this.width &gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='点击在新窗口查看全图\nCTRL+鼠标滚轮放大或缩小';}" border="0" /> </div></div></span>
<img src ="http://www.phpweblog.net/cchxl/aggbug/977.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.phpweblog.net/cchxl/" target="_blank">草原的天空</a> 2007-03-14 16:21 <a href="http://www.phpweblog.net/cchxl/articles/977.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>