<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux ABC &#187; 网络</title>
	<atom:link href="http://www.linuxabc.net.cn/category/network/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxabc.net.cn</link>
	<description>那些人/那些事...</description>
	<lastBuildDate>Tue, 09 Feb 2010 14:09:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>查询外网IP地址</title>
		<link>http://www.linuxabc.net.cn/network/how-to-identify-public-ip-address.html</link>
		<comments>http://www.linuxabc.net.cn/network/how-to-identify-public-ip-address.html#comments</comments>
		<pubDate>Wed, 01 Jul 2009 03:31:13 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/how-to-identify-public-ip-address.html</guid>
		<description><![CDATA[申请adsl的用户，有时候想知道自己的外网IP地址，可以到http://www.ip.cn/进行查询。
]]></description>
			<content:encoded><![CDATA[<p>申请adsl的用户，有时候想知道自己的外网IP地址，可以到<a title="http://www.ip.cn/" href="http://www.ip.cn/">http://www.ip.cn/</a>进行查询。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/how-to-identify-public-ip-address.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layer2&amp;Layer3 switch intro(CCNP BCMAN)</title>
		<link>http://www.linuxabc.net.cn/network/layer2-and-layer3-switch-intro.html</link>
		<comments>http://www.linuxabc.net.cn/network/layer2-and-layer3-switch-intro.html#comments</comments>
		<pubDate>Wed, 10 Jun 2009 01:14:00 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[交换机]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/layer2-and-layer3-switch-intro.html</guid>
		<description><![CDATA[a layer2 switch performs essentially the same function as a transparent bridge. however, a switch can have many ports and can perform hardware-based bridging. Frames are forwarded using specialized hardware, called application-specific integrated circuits(ASICs). This hardware gives switching great scalability, with wire-speed performance, low latency, low cost, and high-port density. 
the router can become a [...]]]></description>
			<content:encoded><![CDATA[<p>a layer2 switch performs essentially the same function as a transparent bridge. however, a switch can have many ports and can perform hardware-based bridging. Frames are forwarded using specialized hardware, called application-specific integrated circuits(ASICs). This hardware gives switching great scalability, with wire-speed performance, low latency, low cost, and high-port density. </p>
<p>the router can become a bottleneck due to a latency of packet examination and processing. </p>
<p>Layer 3 switches are designed to examine and forward packets in high-speed LAN environments. Whereas, a router might impose a bottleneck to forwarding throughput, a Layer 3 switch can be placed anywhere in the network with little or no performance penalty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/layer2-and-layer3-switch-intro.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wi-Fi、Linux和无线网卡</title>
		<link>http://www.linuxabc.net.cn/debian/wi-fi-linux-and-wireless-card.html</link>
		<comments>http://www.linuxabc.net.cn/debian/wi-fi-linux-and-wireless-card.html#comments</comments>
		<pubDate>Wed, 15 Apr 2009 15:51:39 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[网络]]></category>
		<category><![CDATA[wi-fi]]></category>
		<category><![CDATA[wpa]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/debian/wi-fi-linux-and-wireless-card.html/</guid>
		<description><![CDATA[记得2003年的时候，Wi-Fi设备用的是wep加密协议，由于安全性问题而未能获得广泛应用。过去几年802.11获得长足的进步，WPA1/2，EAP-TLS等多种加密技术的实现大大促进了Wi-Fi的传播，AP和无线网卡产品异常丰富，然而兼容Linux的还是屈指可数，能在Linux成功安装无线网卡的不仅仅靠技术和忍者神龟般的耐性，更多时候还要看人品！sigh，什么世道&#8230;
闲话少提，下面说说我在Debian lenny中安装Linksys WPC54G v1.2的经历，希望对大家有所帮助。
在安装无线网卡之前有必要先了解一下Wi-Fi的工作方式：
AP：是access point的简称，它将多个无线设备连接，无线设备通过它进行互联，也通过它联系外界，譬如互联网。
WPA：全称是Wi-Fi Protected Access，是一种基于预协商key的加密方式，WPA之前802.11采用了WEP，后来证明是一种失败的加密方式，在安全性方面给Wi-Fi带来了很差的声誉，影响Wi-Fi的普及，WPA的出现扭转了乾坤。个人用户用得最多的是PSK，Pre shared key。
详细的介绍需要大家google之，这里一两句话也说不清，下面开始进入正题了。
安装无线网卡
在Linux中安装无线网卡驱动有两种方式，一种是通过ndiswrapper使用windows的驱动，另一种使用linux的原生驱动。
在第一种方式中，ndiswrapper是Linux内核中的一个模块，用于在linux内核中加载和运行windows内核的API和NDIS API驱动，换句话来说就是ndiswrapper将linux伪装成windows，使得无线网卡的 windows驱动可以跑在linux之上。Linux fans从心理上是抵触这种方式的，感觉要低于windows一等，其次在实际应用中也存在一些恼人的问题，因此是Plan B。
第二种方式是安装原生的linux的驱动，这种方式是最正宗的，直接由内核驱动硬件，效率也更高些，因此尽可能采用这种方式。可是目前linux针对无线网卡的驱动不多，因此在购买无线网卡之前需要确认一下是否兼容linux，下面是无线网卡的linux兼容列表：http://linux-wless.passys.nl/，该链接是从http://wiki.debian.org/Wi-Fi中摘录出来的，按理来说可信度极高，然而在上面的网址中我无法分辨Linksys WPC54G v1.2是否在兼容之列，也顾不了那么多了，先试了再说。 
1. 查看自己的无线网卡的芯片

alfie:~# lspci -vnn &#124; less
...
02:00.0 Network controller &#91;0280&#93;: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller &#91;14e4:4320&#93; &#40;rev 03&#41;
        Subsystem: Linksys WPC54G &#91;1737:4320&#93;
        Flags: bus master, [...]]]></description>
			<content:encoded><![CDATA[<p>记得2003年的时候，Wi-Fi设备用的是wep加密协议，由于安全性问题而未能获得广泛应用。过去几年802.11获得长足的进步，WPA1/2，EAP-TLS等多种加密技术的实现大大促进了Wi-Fi的传播，AP和无线网卡产品异常丰富，然而兼容Linux的还是屈指可数，能在Linux成功安装无线网卡的不仅仅靠技术和忍者神龟般的耐性，更多时候还要看人品！sigh，什么世道&#8230;</p>
<p>闲话少提，下面说说我在Debian lenny中安装Linksys WPC54G v1.2的经历，希望对大家有所帮助。</p>
<p>在安装无线网卡之前有必要先了解一下Wi-Fi的工作方式：</p>
<p>AP：是access point的简称，它将多个无线设备连接，无线设备通过它进行互联，也通过它联系外界，譬如互联网。</p>
<p>WPA：全称是Wi-Fi Protected Access，是一种基于预协商key的加密方式，WPA之前802.11采用了WEP，后来证明是一种失败的加密方式，在安全性方面给Wi-Fi带来了很差的声誉，影响Wi-Fi的普及，WPA的出现扭转了乾坤。个人用户用得最多的是PSK，Pre shared key。</p>
<p>详细的介绍需要大家google之，这里一两句话也说不清，下面开始进入正题了。</p>
<h4>安装无线网卡</h4>
<p>在Linux中安装无线网卡驱动有两种方式，一种是通过ndiswrapper使用windows的驱动，另一种使用linux的原生驱动。</p>
<p>在第一种方式中，ndiswrapper是Linux内核中的一个模块，用于在linux内核中加载和运行windows内核的API和NDIS API驱动，换句话来说就是ndiswrapper将linux伪装成windows，使得无线网卡的 windows驱动可以跑在linux之上。Linux fans从心理上是抵触这种方式的，感觉要低于windows一等，其次在实际应用中也存在一些恼人的问题，因此是Plan B。</p>
<p>第二种方式是安装原生的linux的驱动，这种方式是最正宗的，直接由内核驱动硬件，效率也更高些，因此尽可能采用这种方式。可是目前linux针对无线网卡的驱动不多，因此在购买无线网卡之前需要确认一下是否兼容linux，下面是无线网卡的linux兼容列表：<a href="http://linux-wless.passys.nl/">http://linux-wless.passys.nl/</a>，该链接是从http://wiki.debian.org/Wi-Fi中摘录出来的，按理来说可信度极高，然而在上面的网址中我无法分辨Linksys WPC54G v1.2是否在兼容之列，也顾不了那么多了，先试了再说。 </p>
<h5>1. 查看自己的无线网卡的芯片</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># lspci -vnn | less</span>
...
02:<span style="color: #000000;">00.0</span> Network controller <span style="color: #7a0874; font-weight: bold;">&#91;</span>0280<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Broadcom Corporation BCM4306 802.11b<span style="color: #000000; font-weight: bold;">/</span>g Wireless LAN Controller <span style="color: #7a0874; font-weight: bold;">&#91;</span>14e4:<span style="color: #000000;">4320</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">rev</span> 03<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        Subsystem: Linksys WPC54G <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1737</span>:<span style="color: #000000;">4320</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
        Flags: bus master, fast devsel, latency <span style="color: #000000;">64</span>, IRQ <span style="color: #000000;">11</span>
        Memory at <span style="color: #000000;">24000000</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">32</span>-bit, non-prefetchable<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">size</span></span>=8K<span style="color: #7a0874; font-weight: bold;">&#93;</span>
        Capabilities: <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">40</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Power Management version <span style="color: #000000;">2</span>
        Kernel driver <span style="color: #000000; font-weight: bold;">in</span> use: b43-pci-bridge
        Kernel modules: ssb
...</pre></div></div>

<p>可以看到已经识别到了Linksys WPC54G的网卡，它使用的芯片是Broadcom的BCM4320（我自己也说不清是4306还是4320，在<a href="http://lin">http://lin</a>&#8230;中说是以[14e4:4320]里面的数字为准）。</p>
<p>针对Broadcom的芯片，linux社区专门提供了b43驱动，在2.6.17-rc2时，内核引入了bcm43xx这个驱动，从2.6.24开始引入了b43legacy和b43，并废掉bcm43xx，其中b43主要负责Broadcom4306 ver2之后的芯片，而b43legacy负责802.11b之前的芯片。 </p>
<h5>2. 安装b43-fwcutter</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># aptitude install b43-fwcutter</span></pre></div></div>

<p>安装b43-fwcutter之后会提示是否自动去http://downloads.openwrt.org/sources下载相应的firmware并解压，此时应该选择否，因为openwrt.org时不时会失效，还是手工下载安全些。有两个下载地址可供选择，一个是http://downloads.openwrt.org/sources，另一个是<a href="http://mirror2.openwrt.org/sources">http://mirror2.openwrt.org/sources</a>，我选择了最新的firmware：broadcom-wl-4.150.10.5.tar.bz2 </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># wget /home/software/ http://mirror2.openwrt.org/sources/ broadcom-wl-4.150.10.5.tar.bz2</span>
alfie:~<span style="color: #666666; font-style: italic;"># cd /home/software &amp;amp;&amp;amp; b43-fwcutter -w /lib/firmware</span></pre></div></div>

<p>说明：/lib/firmware是linux内核模块默认去寻找Broadcom无线网卡的firmware的目录。</p>
<p>这里需要说明一下无线网卡的工作机理，无线网卡在工作的时候需要从驱动里面将firmware提取出来，灌入无线网卡的芯片中，由安装在OS中的驱动进行调用操控。由于firmware都是私有的，无法包含在Debian这个发行版里面，所以需要执行下载驱动、抽取firmware这个步骤，在windows中，无线网卡的驱动会帮你搞定这一切，再一次感受到了有钱就是上帝。</p>
<p>装完网卡的驱动和firmware，接下来要测试一下网卡是否可以正常启动，这个时候就需要用到wireless-tools中的iwconfig和iwlist了。</p>
<h5>3、安装wireless-tools</h5>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># aptitude install wireless-tools</span>
alfie:~<span style="color: #666666; font-style: italic;"># iwlist wlan0 scan</span>
wlan0     Scan completed :
          Cell 01 - Address: 00:<span style="color: #000000;">14</span>:BF:F2:05:B7
                    ESSID:<span style="color: #000000; font-weight: bold;">&amp;</span>quot;dd-wrt<span style="color: #000000; font-weight: bold;">&amp;</span>quot;
                    Mode:Master
                    Channel:<span style="color: #000000;">6</span>
                    Frequency:<span style="color: #000000;">2.437</span> GHz <span style="color: #7a0874; font-weight: bold;">&#40;</span>Channel <span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                    <span style="color: #007800;">Quality</span>=<span style="color: #000000;">73</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">100</span>  Signal <span style="color: #007800;">level</span>=-<span style="color: #000000;">56</span> dBm  Noise <span style="color: #007800;">level</span>=-<span style="color: #000000;">69</span> dBm
                    Encryption key:on
                    IE: WPA Version <span style="color: #000000;">1</span>
                        Group Cipher : TKIP
                        Pairwise Ciphers <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> : TKIP
                        Authentication Suites <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> : PSK
                    Bit Rates:<span style="color: #000000;">1</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">2</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">5.5</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">11</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">18</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s
                              <span style="color: #000000;">24</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">36</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">54</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">6</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">9</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s
                              <span style="color: #000000;">12</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s; <span style="color: #000000;">48</span> Mb<span style="color: #000000; font-weight: bold;">/</span>s
                    Extra:<span style="color: #007800;">tsf</span>=000000295b4c72c0</pre></div></div>

<p>说明网卡已经检测到AP的信号了，还接收到了广播的ESSID。 </p>
<p>iwconfig有点类似于ifconfig，功能强大，可以配置无线网卡，包括essid，ip地址，wep等，详细使用请多看看man，不是playboy哦。</p>
<p>网卡已经可以正常工作了，接下来就是要处理wpa了，因为我的AP启用了WPA psk这种验证模式。</p>
<h5>4、安装wpasupplicant</h5>
<p>下面是debian lenny中对wpasupplicant的介绍：WPA and WPA2 are methods for securing wireless networks, the former using IEEE 802.1X, and the latter using IEEE 802.11i. This software provides key negotiation with the WPA Authenticator, and controls association with IEEE 802.11i networks.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">alfie:~<span style="color: #666666; font-style: italic;"># aptitude install wpasupplicant</span>
alfie:~<span style="color: #666666; font-style: italic;"># vim /etc/network/interfaces</span>
auto-hotplug wlan0
iface wlan0 inet dhcp
  wpa-ssid ssidName
  wpa-psk wpaPskKey</pre></div></div>

<p>接着重启下网卡，就可以正常接入接入AP了。</p>
<p>Debian对wpasupplicant做了特别处理，在其它发行版中，wpa-supplicant无法灵活的处理roaming，但是Debian为wpasupplicant增加了ifupdown的脚本，因此很容易在interfaces中实现，另外Debian wiki还推荐使用network-manager来处理无线连接，只是我习惯了console。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/debian/wi-fi-linux-and-wireless-card.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linksys WRT-54G，一个不老的传说</title>
		<link>http://www.linuxabc.net.cn/network/wrt-54g-is-a-legend-forever.html</link>
		<comments>http://www.linuxabc.net.cn/network/wrt-54g-is-a-legend-forever.html#comments</comments>
		<pubDate>Tue, 18 Nov 2008 17:01:38 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[linksys]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[wrt-54g]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/wrt-54g-is-a-legend-forever.html/</guid>
		<description><![CDATA[ Linksys 于2003年底推出了一款优秀的无线路由器：WRT-54G。一开始的时候，它并不引人注意，人们仅仅把它当作一个无线接入点而已。不过选择了linux作为操作系统给它带来了一个意想不到的机会，那就是用户可以根据自己的需要，在上面自由的修改和发布新的firmware。随着一些功能丰富的第三方firmware的出现，它终于散发出了迷人的魅力，为广大玩家所追捧。Linksys至今依然生产销售WRT-54G这个系列的产品，足见其受欢迎的程度，WRT-54G还在续写着一个不老的传说。

那么它究竟有什么能耐让玩家如此推崇呢？下面让alflie带领你深入它那神奇的世界一探究竟。厄，且慢，是WRT-54G 的firmware让它流行起来的，所以不妨先来看看它们演变的历程。
WRT-54G刚推出的时候，官方firmware的功能并不强大，不久后，一家叫做sveasoft公司看到的其中的契机，在其基础上开发了Alchemy，并按每份拷贝收取20美元，这就让开源社区的用户大为不满了，连Linksys都遵循GPL开放了官方firmware的源代码，凭什么sveasoft这个第三方的firmware却要收费，于是，一些热心的发烧友重起炉灶，开发了其他的版本，目前比较流行的是HyperWRT，DD-WRT和OpenWRT。其中HyperWRT的理念是忠于官方版本，只增加小部分功能，追求高稳定性；OpenWRT的理念则是设计一个通用的最小内核，让该内核也可以运行在其他品牌的无线路由器上，然后由其他人在上面开发新的功能插件，不过它的易用性就比较差了，需要通过命令行来配置；而DD-WRT追求的则是最完善的功能和最佳的易用性，它的确做到了这一点，因而赢得了广大用户芳心。平心而论，OpenWRT的开发模式才是正确的方向，它的ipkg就很好用，一些高阶的用户更偏爱OpenWRT，相信OpenWRT日后必有大的作为。
目前DD-WRT是最流行的版本，为了照顾大部分读者，我选择了DD-WRT作为范例，现在让我们开始WRT-54G的神奇之旅吧。
一、路由与交换
顾名思义，WRT-54G的一项重要的功能就是支持路由。
市面上，和WRT-54G同等级别的网络设备，比如ASUS adsl modem和D-link VPN网关等，都只支持静态路由和RIP，而DD-WRT除了支持前面两种外，还支持企业级别的动态路由协议：OSPF和BGP。实现路由功能的模块是BIRD，相对于linux下著名的路由软件Quagga （前身是zebra）一点也不逊色。有兴趣的读者可以参考www.bird.org。
WRT-54G提供了5个以太网口和1个无线网口。其中5个以太网口又分出1个WAN口和4个LAN口。得益于linux的高灵活性和可配置性，我们可以在DD-WRT中对这六个网口进行自由组合，创建多个vlan，最大可以支持15个，另外DD-WRT还支持tag（802.1q），和trunk，亦即在多条链路之间负载均衡。结合路由和交换，WRT-54G完全可以在小型企业的网络里面一展身手，作为三层交换机非常合适。事实上，国外一些中小型企业就专门购买WRT-54G，将firmware刷成DD-WRT，关闭无线功能，启用路由和划分vlan，配置tag和trunk来取代高昂的网络设备。
花这么少的钱就能使用万元级别网络设备的功能，真不可思议！
二、无线功能
另一个重要的功能当然就是无线啦。因为工作的关系，alfie曾试用过多种品牌无线路由器，相比之下，WRT-54G的无线信号和稳定性要高于同级别的其他品牌，如TP-Link，D-Link和netgear等，比cisco稍差，不过买一个cisco 1240G就可以买8个WRT-54G了。WRT-54G还提供了异常丰富的物理调配选项，从速率到发射功率不一而足，比1240G尤过之而无不及。单纯从物理性能方面的比较还无法表现出DD-WRT的优势，其丰富的无线安全选项才是我喜欢它的原因。DD-WRT支持WEP，WPA和WPA2加密方式，支持radius认证和802.1x端口安全，在企业中组网的时候，完全可以在其上实施微软的PEAP这种最流行、方便的安全方案。
此外，DD-WRT还支持WDS，在工地或者仓库这些空旷，布线不方便的地方，这项功能就有用武之地了，可以通过两个WRT-54G桥接两个LAN，与此同时还可以扮演AP的角色。
DD-WRT的无线功能非常丰富，即适合家庭使用，也满足企业网中苛刻的要求。
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/11/image12.png"><img title="image" style="border-right: 0px; border-top: 0px; display: inline; margin: 0px 10px 0px 0px; border-left: 0px; border-bottom: 0px" height="194" alt="image" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/11/image-thumb12.png" width="257" align="left" border="0" /></a> Linksys 于2003年底推出了一款优秀的无线路由器：WRT-54G。一开始的时候，它并不引人注意，人们仅仅把它当作一个无线接入点而已。不过选择了linux作为操作系统给它带来了一个意想不到的机会，那就是用户可以根据自己的需要，在上面自由的修改和发布新的firmware。随着一些功能丰富的第三方firmware的出现，它终于散发出了迷人的魅力，为广大玩家所追捧。Linksys至今依然生产销售WRT-54G这个系列的产品，足见其受欢迎的程度，WRT-54G还在续写着一个不老的传说。</p>
<p><span id="more-158"></span></p>
<p>那么它究竟有什么能耐让玩家如此推崇呢？下面让alflie带领你深入它那神奇的世界一探究竟。厄，且慢，是WRT-54G 的firmware让它流行起来的，所以不妨先来看看它们演变的历程。</p>
<p>WRT-54G刚推出的时候，官方firmware的功能并不强大，不久后，一家叫做sveasoft公司看到的其中的契机，在其基础上开发了Alchemy，并按每份拷贝收取20美元，这就让开源社区的用户大为不满了，连Linksys都遵循GPL开放了官方firmware的源代码，凭什么sveasoft这个第三方的firmware却要收费，于是，一些热心的发烧友重起炉灶，开发了其他的版本，目前比较流行的是HyperWRT，DD-WRT和OpenWRT。其中HyperWRT的理念是忠于官方版本，只增加小部分功能，追求高稳定性；OpenWRT的理念则是设计一个通用的最小内核，让该内核也可以运行在其他品牌的无线路由器上，然后由其他人在上面开发新的功能插件，不过它的易用性就比较差了，需要通过命令行来配置；而DD-WRT追求的则是最完善的功能和最佳的易用性，它的确做到了这一点，因而赢得了广大用户芳心。平心而论，OpenWRT的开发模式才是正确的方向，它的ipkg就很好用，一些高阶的用户更偏爱OpenWRT，相信OpenWRT日后必有大的作为。</p>
<p>目前DD-WRT是最流行的版本，为了照顾大部分读者，我选择了DD-WRT作为范例，现在让我们开始WRT-54G的神奇之旅吧。</p>
<h5>一、路由与交换</h5>
<p>顾名思义，WRT-54G的一项重要的功能就是支持路由。</p>
<p>市面上，和WRT-54G同等级别的网络设备，比如ASUS adsl modem和D-link VPN网关等，都只支持静态路由和RIP，而DD-WRT除了支持前面两种外，还支持企业级别的动态路由协议：OSPF和BGP。实现路由功能的模块是BIRD，相对于linux下著名的路由软件Quagga （前身是zebra）一点也不逊色。有兴趣的读者可以参考www.bird.org。</p>
<p>WRT-54G提供了5个以太网口和1个无线网口。其中5个以太网口又分出1个WAN口和4个LAN口。得益于linux的高灵活性和可配置性，我们可以在DD-WRT中对这六个网口进行自由组合，创建多个vlan，最大可以支持15个，另外DD-WRT还支持tag（802.1q），和trunk，亦即在多条链路之间负载均衡。结合路由和交换，WRT-54G完全可以在小型企业的网络里面一展身手，作为三层交换机非常合适。事实上，国外一些中小型企业就专门购买WRT-54G，将firmware刷成DD-WRT，关闭无线功能，启用路由和划分vlan，配置tag和trunk来取代高昂的网络设备。</p>
<p>花这么少的钱就能使用万元级别网络设备的功能，真不可思议！</p>
<h5>二、无线功能</h5>
<p>另一个重要的功能当然就是无线啦。因为工作的关系，alfie曾试用过多种品牌无线路由器，相比之下，WRT-54G的无线信号和稳定性要高于同级别的其他品牌，如TP-Link，D-Link和netgear等，比cisco稍差，不过买一个cisco 1240G就可以买8个WRT-54G了。WRT-54G还提供了异常丰富的物理调配选项，从速率到发射功率不一而足，比1240G尤过之而无不及。单纯从物理性能方面的比较还无法表现出DD-WRT的优势，其丰富的无线安全选项才是我喜欢它的原因。DD-WRT支持WEP，WPA和WPA2加密方式，支持radius认证和802.1x端口安全，在企业中组网的时候，完全可以在其上实施微软的PEAP这种最流行、方便的安全方案。</p>
<p>此外，DD-WRT还支持WDS，在工地或者仓库这些空旷，布线不方便的地方，这项功能就有用武之地了，可以通过两个WRT-54G桥接两个LAN，与此同时还可以扮演AP的角色。</p>
<p>DD-WRT的无线功能非常丰富，即适合家庭使用，也满足企业网中苛刻的要求。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/wrt-54g-is-a-legend-forever.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何升级Huawei-S3952的VRP</title>
		<link>http://www.linuxabc.net.cn/network/how-to-upgrade-the-huawei-s3952-vrp.html</link>
		<comments>http://www.linuxabc.net.cn/network/how-to-upgrade-the-huawei-s3952-vrp.html#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:43:39 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[交换机]]></category>
		<category><![CDATA[华为]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/how-to-upgrade-the-huawei-s3952-vrp.html/</guid>
		<description><![CDATA[每种产品都有生命周期，为了保障用户的权宜，提高产品的竞争力，网络设备往往使用通用的系统平台，例如cisco路由器的系统平台是IOS，而华为交换机的系统平台则称之为VRP。
S3952是华为公司推出的一款企业级三层交换机，在alfie参与的某个项目中，由于所使用的S3952的VRP版本过低，不支持VRRP功能，所以需要进行升级，然而升级的过程中遇到很多挫 折，在这里写出来供有升级需求的读者参考。

一、下载最新的VRP
可以到H3C这个官方论坛下载全系列华为交换机的最新VRP软件包，下载的帐号和密码可在精华帖中找到。
最新的版本是S3900EI-VRP310-R1510P18，下载下来的是一个压缩包，里面主要有：

S3900_V322.btm 
S3900EI-VRP310-R1510P18.bin 

其中，S3900_V322.btm是bootrom，相当于X86系统中的BIOS，用来引导OS，显然S3900EI-VRP310-R1510P18.bin就是华为交换机的操作系统，也就是VRP了。
根据软件包自带的说明文档，一共有三种升级方式 

xmodem 
tftp 
ftp 

网上很多文档都说xmodem是最安全的，所以Alfie先选择第一种方式，说明文档中提到先bootrom中将波特率设为115200，然后再在超级终端中设置波特率为115200，然而无法修改“连接”里面的波特率，于是新建一个连接，波特率选择115200，接着就犯困了，该不该将目前的连接停掉，使用“新的连接”来连接交换机？为了安全起见，我放弃了修改波特率的做法，直接选择bootrom默认的9600，然后开始通过xmodem download file to flash。
让我郁闷的是，S3900EI-VRP310-R1510P18.bin才3.8M，然后足足让我等了一个半小时才拷进flash，更让我抓狂的是，重启后flash了里面还是旧的版本，使用display all files in flash发现新的版本根本没有拷进flash。
换！由于cisco用的是tftp，所以这一次选择tftp，过程倒并没有遇到令人挠头的困惑，传输的时间也很长，等了20分钟，满以为这次应该没问题，谁知道最后又给出load file failed的提示，什么意思啊？拒绝我也得给个理由啊。华为在这方面做得就比不上cisco。
fu*k，为了这个特性，我已经整整耗费了一个下午。没办法，再试试ftp吧。有了先前tftp的经验，这个过程就更简单了。一个字，爽，前面两个小时的等待憋了一肚子气，这次很快不到1分钟就全部传到flash了，虽然随后给出了flash空间不够的错误故障，不过我至少知道了错误的原因，删掉一个旧的 VRP后，重新传送，reboot，display version，YESSSS！终于看到了可爱的VRRP命令。
亲身的体验告诉我，xmodem是三种方式中最差的，tftp则一般，FTP则是最好的，速度快，错误提示详细。
二、升级步骤：
&#160;
1、使用console线连接 
2、重启交换机
3、在staring &#8230;的时候狂按ctrl+B 
4、选择3. Display all files in flash
先检查一下剩余的flash是否能装新的vrp，如果不够的话要先删除就的VRP，删除可以用命令4. Delete file from flash
5、选择6. Enter bootrom upgrade menu
每个新的软件包都会附带和软件包相对应的bootrom，虽然旧的bootrom可能也可以引导新的VRP，不过还是建议将旧的bootrom升级到新的bootrom    
6、选择1. Set FTP protocol parameter

Load File name&#160;&#160;&#160;&#160; 交换机要下载的文件名 
Switch IP address&#160; 交换机IP地址 

说明：升级前，先创建一个vlan，分配IP地址，将某个端口划分到该vlan，插上FTP server网线，将该FTPserver IP地址设为和交换机IP地址同一网断。使用ping命令验证连通性以及稳定性，如果掉包的话要考虑换个端口或网线，否则下面的传送过程可能会出错

Server IP [...]]]></description>
			<content:encoded><![CDATA[<p>每种产品都有生命周期，为了保障用户的权宜，提高产品的竞争力，网络设备往往使用通用的系统平台，例如cisco路由器的系统平台是IOS，而华为交换机的系统平台则称之为VRP。</p>
<p><a href="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/huaweis3952.jpg"><img title="huawei-S3952" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 10px; border-right-width: 0px" height="79" alt="huawei-S3952" src="http://www.linuxabc.net.cn/wp-content/uploads/2008/10/huaweis3952-thumb.jpg" width="304" align="right" border="0" /></a>S3952是华为公司推出的一款企业级三层交换机，在alfie参与的某个项目中，由于所使用的S3952的VRP版本过低，不支持VRRP功能，所以需要进行升级，然而升级的过程中遇到很多挫 折，在这里写出来供有升级需求的读者参考。</p>
<p><span id="more-90"></span></p>
<h4>一、下载最新的VRP</h4>
<p>可以到H3C这个官方论坛下载全系列华为交换机的最新VRP软件包，下载的帐号和密码可在精华帖中找到。</p>
<p>最新的版本是S3900EI-VRP310-R1510P18，下载下来的是一个压缩包，里面主要有：</p>
<ol>
<li>S3900_V322.btm </li>
<li>S3900EI-VRP310-R1510P18.bin </li>
</ol>
<p>其中，S3900_V322.btm是bootrom，相当于X86系统中的BIOS，用来引导OS，显然S3900EI-VRP310-R1510P18.bin就是华为交换机的操作系统，也就是VRP了。</p>
<p>根据软件包自带的说明文档，一共有三种升级方式 </p>
<ol>
<li>xmodem </li>
<li>tftp </li>
<li>ftp </li>
</ol>
<p>网上很多文档都说xmodem是最安全的，所以Alfie先选择第一种方式，说明文档中提到先bootrom中将波特率设为115200，然后再在超级终端中设置波特率为115200，然而无法修改“连接”里面的波特率，于是新建一个连接，波特率选择115200，接着就犯困了，该不该将目前的连接停掉，使用“新的连接”来连接交换机？为了安全起见，我放弃了修改波特率的做法，直接选择bootrom默认的9600，然后开始通过xmodem download file to flash。</p>
<p>让我郁闷的是，S3900EI-VRP310-R1510P18.bin才3.8M，然后足足让我等了一个半小时才拷进flash，更让我抓狂的是，重启后flash了里面还是旧的版本，使用display all files in flash发现新的版本根本没有拷进flash。</p>
<p>换！由于cisco用的是tftp，所以这一次选择tftp，过程倒并没有遇到令人挠头的困惑，传输的时间也很长，等了20分钟，满以为这次应该没问题，谁知道最后又给出load file failed的提示，什么意思啊？拒绝我也得给个理由啊。华为在这方面做得就比不上cisco。</p>
<p>fu*k，为了这个特性，我已经整整耗费了一个下午。没办法，再试试ftp吧。有了先前tftp的经验，这个过程就更简单了。一个字，爽，前面两个小时的等待憋了一肚子气，这次很快不到1分钟就全部传到flash了，虽然随后给出了flash空间不够的错误故障，不过我至少知道了错误的原因，删掉一个旧的 VRP后，重新传送，reboot，display version，YESSSS！终于看到了可爱的VRRP命令。</p>
<p>亲身的体验告诉我，xmodem是三种方式中最差的，tftp则一般，FTP则是最好的，速度快，错误提示详细。</p>
<h4>二、升级步骤：</h4>
<h5>&#160;</h5>
<h5>1、使用console线连接 </h5>
<h5>2、重启交换机</h5>
<h5>3、在staring &#8230;的时候狂按ctrl+B </h5>
<h5>4、选择3. Display all files in flash</h5>
<p>先检查一下剩余的flash是否能装新的vrp，如果不够的话要先删除就的VRP，删除可以用命令4. Delete file from flash</p>
<h5>5、选择6. Enter bootrom upgrade menu</h5>
<p>每个新的软件包都会附带和软件包相对应的bootrom，虽然旧的bootrom可能也可以引导新的VRP，不过还是建议将旧的bootrom升级到新的bootrom    </p>
<h5>6、选择1. Set FTP protocol parameter</h5>
<ul>
<li>Load File name&#160;&#160;&#160;&#160; 交换机要下载的文件名 </li>
<li>Switch IP address&#160; 交换机IP地址 </li>
</ul>
<p>说明：升级前，先创建一个vlan，分配IP地址，将某个端口划分到该vlan，插上FTP server网线，将该FTPserver IP地址设为和交换机IP地址同一网断。使用ping命令验证连通性以及稳定性，如果掉包的话要考虑换个端口或网线，否则下面的传送过程可能会出错</p>
<ul>
<li>Server IP address&#160; 下载文件所在FTP的IP地址 </li>
<li>FTP User Name&#160;&#160;&#160;&#160;&#160; 登录FTP server的用户名 </li>
<li>FTP User Password&#160; 登录FTP server的用户口令 </li>
</ul>
<h5>9、bootrom升级过程很快，接下来回退到boot菜单 </h5>
<h5>10、选择1. Download application file to flash</h5>
<p>接下来的步骤跟升级bootrom一样，不过到最后交换机会提示你修改VRP文件的属性，有main/backup/none可选，请选择main，它的意思是将作为主VRP文件，下次交换机重启时将加载该VRP，如果选择backup则仅仅是将该文件放在flash里面作备份。none不知道是什么意思，没研究。</p>
<h5>11、重启</h5>
<p>这便大功告成了！！</p>
<p>哦，忘了告诉大家了，SI是不支持VRRP了，所以就别费心升级新版本了。如果您已经进行到这一步却发现无法使用VRRP，嘿嘿，谁让你先前不先通读全文呢？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/how-to-upgrade-the-huawei-s3952-vrp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何配置华为S3900交换机的端口镜像</title>
		<link>http://www.linuxabc.net.cn/network/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e5%8d%8e%e4%b8%bas3900%e4%ba%a4%e6%8d%a2%e6%9c%ba%e7%9a%84%e7%ab%af%e5%8f%a3%e9%95%9c%e5%83%8f.html</link>
		<comments>http://www.linuxabc.net.cn/network/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e5%8d%8e%e4%b8%bas3900%e4%ba%a4%e6%8d%a2%e6%9c%ba%e7%9a%84%e7%ab%af%e5%8f%a3%e9%95%9c%e5%83%8f.html#comments</comments>
		<pubDate>Thu, 23 Oct 2008 07:03:52 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[交换机]]></category>
		<category><![CDATA[华为]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e5%8d%8e%e4%b8%bas3900%e4%ba%a4%e6%8d%a2%e6%9c%ba%e7%9a%84%e7%ab%af%e5%8f%a3%e9%95%9c%e5%83%8f.html/</guid>
		<description><![CDATA[最新的项目需要在汇聚S3900上面做一个镜像，捕获和SMS系统连接的那个端口的数据包，翻遍了华为的《Quidway S3900系列以太网交换机 命令手册-Release 1510(V1.01).pdf》又做了n多实验，终于大概了解的华为交换机做端口镜像的要点。
配置步骤如下：
一、定义mirroring group

system-view
mirroring-group 2 #group_id

二、定义被镜像的端口，也就是源端口

mirroring-group 2 mirroring-port eth 1/0/4 both

其中both指的是从该端口进来和出去的数据包都将被捕获，还可以选择inbound和outbound
三、定义目的端口

mirroring-group 2 monitor-port eth 1/0/10

接着将网线查到eth1/0/10，启用ethereal，promisc模式捕获。
在该交换机的配置中eth1/0/4属于vlan 40，eth1/0/10属于管理vlan。它们不需要处于同一个vlan。
四、查看mirroring group

disp mirroring-group 2

通过上面镜像的包很杂，所以在利用ehereal做分析的时候可利用filter进行过滤。
说明：曾经想在交换机上面应用acl，只捕获感兴趣的包，但是发现华为的文档是错的，在《Quidway S3900系列以太网交换机 命令手册-Release1510(V1.01).pdf》中有一个例子：

&#60;quidway&#62; system-view 
System View: return to User View with Ctrl+Z. 
[Quidway] interface GigabitEthernet1/1/4 
[Quidway-GigabitEthernet1/1/4] monitor-port 
[Quidway-GigabitEthernet1/1/4] quit 
[Quidway] interface GigabitEthernet1/1/1 
[Quidway-GigabitEthernet1/1/1] mirrored-to inbound ip-group 2000 monitor-interface

依葫芦画瓢，我在S3900上面做了如下的配置：
1、定义源端口

int eth 1/0/4
mirrored-to inbound ip-group 3000 rule 30 monitor-interface

2、定义目的端口

int [...]]]></description>
			<content:encoded><![CDATA[<p>最新的项目需要在汇聚S3900上面做一个镜像，捕获和SMS系统连接的那个端口的数据包，翻遍了华为的《Quidway S3900系列以太网交换机 命令手册-Release 1510(V1.01).pdf》又做了n多实验，终于大概了解的华为交换机做端口镜像的要点。</p>
<p><strong>配置步骤如下</strong>：</p>
<h5>一、定义mirroring group</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">system-view
mirroring-group 2 #group_id</pre></div></div>

<h5>二、定义被镜像的端口，也就是源端口</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mirroring-group 2 mirroring-port eth 1/0/4 both</pre></div></div>

<p>其中both指的是从该端口进来和出去的数据包都将被捕获，还可以选择inbound和outbound</p>
<h5>三、定义目的端口</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mirroring-group 2 monitor-port eth 1/0/10</pre></div></div>

<p>接着将网线查到eth1/0/10，启用ethereal，promisc模式捕获。</p>
<p>在该交换机的配置中eth1/0/4属于vlan 40，eth1/0/10属于管理vlan。它们不需要处于同一个vlan。</p>
<h5>四、查看mirroring group</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">disp mirroring-group 2</pre></div></div>

<p>通过上面镜像的包很杂，所以在利用ehereal做分析的时候可利用filter进行过滤。</p>
<p>说明：曾经想在交换机上面应用acl，只捕获感兴趣的包，但是发现华为的文档是错的，在《Quidway S3900系列以太网交换机 命令手册-Release1510(V1.01).pdf》中有一个例子：</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&lt;quidway&gt; system-view 
System View: return to User View with Ctrl+Z. 
[Quidway] interface GigabitEthernet1/1/4 
[Quidway-GigabitEthernet1/1/4] monitor-port 
[Quidway-GigabitEthernet1/1/4] quit 
[Quidway] interface GigabitEthernet1/1/1 
[Quidway-GigabitEthernet1/1/1] mirrored-to inbound ip-group 2000 monitor-interface</pre></div></div>

<p>依葫芦画瓢，我在S3900上面做了如下的配置：</p>
<h5>1、定义源端口</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">int eth 1/0/4
mirrored-to inbound ip-group 3000 rule 30 monitor-interface</pre></div></div>

<h5>2、定义目的端口</h5>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">int eth 1/0/10
&nbsp;
monitor-port</pre></div></div>

<p>我发现不论怎么调整acl，都无法在目的端口捕获到数据包，华为的文档真是太滥，相比之下，cisco这方面做得很好。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%ae%e5%8d%8e%e4%b8%bas3900%e4%ba%a4%e6%8d%a2%e6%9c%ba%e7%9a%84%e7%ab%af%e5%8f%a3%e9%95%9c%e5%83%8f.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何通过modem远程控制路由器</title>
		<link>http://www.linuxabc.net.cn/network/how-to-remote-control-cisco-router-with-modem.html</link>
		<comments>http://www.linuxabc.net.cn/network/how-to-remote-control-cisco-router-with-modem.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 01:29:47 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[路由器]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/how-to-remote-control-cisco-router-with-modem.html/</guid>
		<description><![CDATA[alfie所任职的公司有很多仓库，而仓库的地理位置都比较偏远，而且当地都没有技术支持，一旦出现专线线路故障，处理起来非常棘手，所以如果能够远程控制路由器就显得格外重要。 
条件：

电话线 
具有DB9或DB26适配口的外置modem 

cisco路由器都有AUX口，而且附送一条RJ45-DB9的控制线和DB9-DB26的转换头，如果modem是DB9的，可以直接使用RJ-DB9将modem跟路由器连接起来；如果是DB26，则可以将DB9-DB26转换头和RJ45-DB9连起来，同样可以连接modem和路由器。    若要通过modem远程控制路由器，需要做

配置modem自动应答 
配置路由器的aux口 
配置路由器的enable secret/password 
用windows自带的拨号程序进行远程登陆 

1、配置modem自动应答
首先需要登陆modem，才能做进一步的配置。
PC可以通过DB26-DB9连接modem，用超级终端连接控制；也可以用RJ45-DB26，在路由器里远程登陆到modem进行配置。    下面以第二种方法为例：     在路由器里面通过sh line可以看到，modem连接到vty N上，接着通过telnet loopback_ip 20xx，xx代表vty的N，在alfie的例子中是05，所以

telnet 10.0.0.10 2005
username：
password：
at&#38;amp;1
OK
at&#38;amp;F1
OK


2、配置路由器的aux口
配置如下：

line aux 0
 password cisco
 modem InOut
 modem autoconfigure discovery
 transport input all
 stopbits 1
 speed 38400
 flowcontrol hardware


需要特别注意的是speed的参数，1700系列为38400，2500以上系列的则为115200。 
3、配置路由器的特权密码 

router&#62;en
router#enable secret your_password
router#wr


4、windows自带的拨号程序进行拨号 
同时应该启用windows的拨号程序进行拨号。为了方便排错，最好选中拨号属性中的“安全措施-交互式登陆及运行脚本”中的显示终端端口。 
至此，所有的配置完毕了，现在可以通过modem来远程管理路由器了。
]]></description>
			<content:encoded><![CDATA[<p>alfie所任职的公司有很多仓库，而仓库的地理位置都比较偏远，而且当地都没有技术支持，一旦出现专线线路故障，处理起来非常棘手，所以如果能够远程控制路由器就显得格外重要。 </p>
<p>条件：</p>
<ol>
<li>电话线 </li>
<li>具有DB9或DB26适配口的外置modem </li>
</ol>
<p>cisco路由器都有AUX口，而且附送一条RJ45-DB9的控制线和DB9-DB26的转换头，如果modem是DB9的，可以直接使用RJ-DB9将modem跟路由器连接起来；如果是DB26，则可以将DB9-DB26转换头和RJ45-DB9连起来，同样可以连接modem和路由器。    <br />若要通过modem远程控制路由器，需要做</p>
<ol>
<li>配置modem自动应答 </li>
<li>配置路由器的aux口 </li>
<li>配置路由器的enable secret/password </li>
<li>用windows自带的拨号程序进行远程登陆 </li>
</ol>
<h5>1、配置modem自动应答</h5>
<p>首先需要登陆modem，才能做进一步的配置。</p>
<p>PC可以通过DB26-DB9连接modem，用超级终端连接控制；也可以用RJ45-DB26，在路由器里远程登陆到modem进行配置。    <br />下面以第二种方法为例：     <br />在路由器里面通过sh line可以看到，modem连接到vty N上，接着通过telnet loopback_ip 20xx，xx代表vty的N，在alfie的例子中是05，所以</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">telnet 10.0.0.10 2005
username：
password：
at&amp;amp;1
OK
at&amp;amp;F1
OK</pre></div></div>

</p>
<h5>2、配置路由器的aux口</h5>
<p>配置如下：</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">line aux 0
 password cisco
 modem InOut
 modem autoconfigure discovery
 transport input all
 stopbits 1
 speed 38400
 flowcontrol hardware</pre></div></div>

</p>
<p>需要特别注意的是speed的参数，1700系列为38400，2500以上系列的则为115200。 </p>
<h5>3、配置路由器的特权密码 </h5>
<p>
<div class="wp_syntax"><div class="code"><pre class="cisco" style="font-family:monospace;">router&gt;en
router#enable secret your_password
router#wr</pre></div></div>

</p>
<h5>4、windows自带的拨号程序进行拨号 </h5>
<p>同时应该启用windows的拨号程序进行拨号。为了方便排错，最好选中拨号属性中的“安全措施-交互式登陆及运行脚本”中的显示终端端口。 </p>
<p>至此，所有的配置完毕了，现在可以通过modem来远程管理路由器了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/how-to-remote-control-cisco-router-with-modem.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用hping扫描端口</title>
		<link>http://www.linuxabc.net.cn/network/how-to-use-hping2-for-port-scanning.html</link>
		<comments>http://www.linuxabc.net.cn/network/how-to-use-hping2-for-port-scanning.html#comments</comments>
		<pubDate>Mon, 06 Oct 2008 05:32:46 +0000</pubDate>
		<dc:creator>alfie</dc:creator>
				<category><![CDATA[网络]]></category>
		<category><![CDATA[hping]]></category>

		<guid isPermaLink="false">http://www.linuxabc.net.cn/network/how-to-use-hping2-for-port-scanning.html/</guid>
		<description><![CDATA[hping是一个短小精湛的网络分析工具，主要功能有：

防火墙测试 
实用的端口扫描 
网络检测，可以用不同的协议、服务类型（TOS）、IP分片 
手工探测MTU（最大传输单元）路径 
先进的路由跟踪，支持所有的协议 
远程操作系统探测 
远程的运行时间探测 
TCP/IP堆栈审计 

目前的稳定版本是hping-2.0-rc3，作者似乎已经停止了更新，不过没关系，这个版本已经足够稳定了。hping博大精深，最有用无疑是可以用来构造tcp/ip包进行检测，今天alfie仅讲解如何用来扫描端口。
参数S表示扫描，p表示扫描的端口
如果端口处于服务状态的话，flags应该是SA，否则是RA

   Q:\&#62;hping -S 192.168.100.175 -p 80 
   HPING 192.168.100.175 (Intel(R) PRO/1000 MT Network Connection 192.168.100.175) 1S set, 40 headers + 0 data bytes  
   len=46 ip=192.168.100.175 ttl=128 DF id=49361 sport=80 flags=SA seq=0 win=64512 rtt=0.0 ms  
   len=46 [...]]]></description>
			<content:encoded><![CDATA[<p>hping是一个短小精湛的网络分析工具，主要功能有：</p>
<ol>
<li>防火墙测试 </li>
<li>实用的端口扫描 </li>
<li>网络检测，可以用不同的协议、服务类型（TOS）、IP分片 </li>
<li>手工探测MTU（最大传输单元）路径 </li>
<li>先进的路由跟踪，支持所有的协议 </li>
<li>远程操作系统探测 </li>
<li>远程的运行时间探测 </li>
<li>TCP/IP堆栈审计 </li>
</ol>
<p>目前的稳定版本是<a href="http://www.hping.org/hping2.win32.tar.gz" target="_blank">hping-2.0-rc3</a>，作者似乎已经停止了更新，不过没关系，这个版本已经足够稳定了。hping博大精深，最有用无疑是可以用来构造tcp/ip包进行检测，今天alfie仅讲解如何用来扫描端口。</p>
<p>参数S表示扫描，p表示扫描的端口</p>
<p>如果端口处于服务状态的话，flags应该是SA，否则是RA</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">   Q:\&gt;hping -S 192.168.100.175 -p 80 
   HPING 192.168.100.175 (Intel(R) PRO/1000 MT Network Connection 192.168.100.175) 1S set, 40 headers + 0 data bytes  
   len=46 ip=192.168.100.175 ttl=128 DF id=49361 sport=80 flags=SA seq=0 win=64512 rtt=0.0 ms  
   len=46 ip=192.168.100.175 ttl=128 DF id=49362 sport=80 flags=SA seq=1 win=64512 rtt=0.0 ms  
       — 192.168.100.175 hping statistics —  
   2 packets transmitted, 2 packets received, 0% packet loss  
   round-trip min/avg/max = 0.0/0.0/0.0 ms</pre></div></div>

<p>另外-p 后面还可以用++，此时每次扫描端口时会自动增加。</p>
<p>以后有机会再讲解如何利用hping2构造数据包做防火墙的规则测试。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxabc.net.cn/network/how-to-use-hping2-for-port-scanning.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
