<?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>榆树网</title>
	<atom:link href="http://www.wenzk.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wenzk.com</link>
	<description>http://www.wenzk.com</description>
	<lastBuildDate>Thu, 02 Sep 2010 06:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>htpdate能浏览网页就能同步时间</title>
		<link>http://www.wenzk.com/archives/988</link>
		<comments>http://www.wenzk.com/archives/988#comments</comments>
		<pubDate>Thu, 02 Sep 2010 06:17:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[htpdate]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[同步]]></category>
		<category><![CDATA[时间]]></category>
		<category><![CDATA[时间服务器]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=988</guid>
		<description><![CDATA[看看同步时间的效果（默认只查询服务器时间，不修改本地时间）： # htpdate -d www.wenzk.com burst: 1 try: 1 when: 500000 www.wenzk.com             02 Sep 2010 06:13:47 GMT (0.491) =&#62; 0 #: 1 mean: 0 average: 0.000 Timezone: GMT+8 (CST,CDT) No time correction needed 只要能看网页（通过代理也行），就可以与相应的服务器同步时间，建议选择大网站作为同步源，小网站服务器本身的时间未必是准确的。程序相关信息： htpdate.i386 : HTTP based time synchronization tool Repo        : rpmforge Matched from: Description : The HTTP Time Protocol (HTP) is used [...]]]></description>
			<content:encoded><![CDATA[<p>看看同步时间的效果（默认只查询服务器时间，不修改本地时间）：</p>
<p># htpdate -d www.wenzk.com<br />
burst: 1 try: 1 when: 500000<br />
www.wenzk.com             02 Sep 2010 06:13:47 GMT (0.491) =&gt; 0<br />
#: 1 mean: 0 average: 0.000<br />
Timezone: GMT+8 (CST,CDT)<br />
No time correction needed</p>
<p><span id="more-988"></span>只要能看网页（通过代理也行），就可以与相应的服务器同步时间，建议选择大网站作为同步源，小网站服务器本身的时间未必是准确的。程序相关信息：</p>
<p>htpdate.i386 : HTTP based time synchronization tool<br />
Repo        : rpmforge<br />
Matched from:<br />
Description : The HTTP Time Protocol (HTP) is used to synchronize a computer&#8217;s<br />
: time with web servers as reference time source. Htpdate will<br />
: synchronize your computer&#8217;s time by extracting timestamps from<br />
: HTTP headers found in web servers responses. Htpdate can be<br />
: used as a daemon, to keep your computer synchronized.<br />
:<br />
: Accuracy of htpdate is usually better than 0.5 seconds (even<br />
: better with multiple servers). If this is not good enough for you,<br />
: try the ntpd package.</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/986" title="CentOS+GPS+Gpsd+ntpd架设时间服务器">CentOS+GPS+Gpsd+ntpd架设时间服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/883" title="Google拼音输入法无法同步用户词典和设置，提示：网络错误">Google拼音输入法无法同步用户词典和设置，提示：网络错误</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/988/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS+GPS+Gpsd+ntpd架设时间服务器</title>
		<link>http://www.wenzk.com/archives/986</link>
		<comments>http://www.wenzk.com/archives/986#comments</comments>
		<pubDate>Thu, 02 Sep 2010 03:17:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[gpsd]]></category>
		<category><![CDATA[NTP]]></category>
		<category><![CDATA[ntpd]]></category>
		<category><![CDATA[时间服务]]></category>
		<category><![CDATA[时间服务器]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=986</guid>
		<description><![CDATA[记录CentOS架设时间服务器要点： GPS: Gstar RS-232接口USB供电。 1、GPS连接COM1口。 2、从http://gpsd.berlios.de/下载gpsd安装，如果系统没有ncurses-devel包，系统将无法编译gpsmon程序。 3、启动gpsd程序，在/etc/rc.local增加 /bin/chmod o+rw /dev/ttyS0 /usr/local/sbin/gpsd -n /dev/ttyS0 4、/etc/ntp.conf文件增加 server 127.127.28.0 minpoll 4 maxpoll 4 fudge 127.127.28.0 time1 0.420 refid GPS server 127.127.28.1 minpoll 4 maxpoll 4 prefer fudge 127.127.28.1 refid GPS1 注意：在某些机器不使用/bin/chmod o+rw /dev/ttyS0修改ttS0的权限，ntpd也能读取掉相应的时间信息，但是在某些机器，死活也不好使。 相关文章htpdate能浏览网页就能同步时间 (0)gpsd-2.95的bug(gpsd.php json_decode error) (0)Google地图的WIFI定位技术 (1)]]></description>
			<content:encoded><![CDATA[<p>记录CentOS架设时间服务器要点：</p>
<p>GPS: Gstar RS-232接口USB供电。</p>
<p>1、GPS连接COM1口。</p>
<p>2、从http://gpsd.berlios.de/下载gpsd安装，如果系统没有ncurses-devel包，系统将无法编译gpsmon程序。</p>
<p>3、启动gpsd程序，在/etc/rc.local增加</p>
<pre class="brush: plain;">/bin/chmod o+rw /dev/ttyS0
/usr/local/sbin/gpsd -n /dev/ttyS0
</pre>
<p>4、/etc/ntp.conf文件增加</p>
<pre class="brush: plain;">server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS

server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid GPS1
</pre>
<p>注意：在某些机器不使用/bin/chmod o+rw /dev/ttyS0修改ttS0的权限，ntpd也能读取掉相应的时间信息，但是在某些机器，死活也不好使。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/988" title="htpdate能浏览网页就能同步时间">htpdate能浏览网页就能同步时间</a> (0)</li><li><a href="http://www.wenzk.com/archives/982" title="gpsd-2.95的bug(gpsd.php json_decode error)">gpsd-2.95的bug(gpsd.php json_decode error)</a> (0)</li><li><a href="http://www.wenzk.com/archives/270" title="Google地图的WIFI定位技术">Google地图的WIFI定位技术</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/986/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gpsd-2.95的bug(gpsd.php json_decode error)</title>
		<link>http://www.wenzk.com/archives/982</link>
		<comments>http://www.wenzk.com/archives/982#comments</comments>
		<pubDate>Sat, 28 Aug 2010 17:08:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[BUG]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[gpsd]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[定位]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=982</guid>
		<description><![CDATA[gpsd自带一个php程序，只要有php和php-gd就可以生成这样的界面：http://www.rjsystems.nl/gpsd/，可惜当我使用2.95版本的时候，却遇到了错误，按照INSTALL的方法把gpsd.php复制到web目录下，却发现json_decode error。 开始以为是php-json的问题，同事写了个简单的测试脚本，一切正常，最后观察返回的json数据，发现最后多了“]}”字符导致的。 在gpsd-2.95版本出现的bug，别的版本是否存在没有去研究过。 diff -u gpsd.c_old gpsd.c --- gpsd.c_old  2010-08-29 00:57:24.000000000 +0800 +++ gpsd.c      2010-08-29 00:57:39.000000000 +0800 @@ -1185,7 +1185,7 @@ } if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '&#92;&#48;';    /* trim trailing comma */ -       (void)strlcat(reply, &#34;]}]}\r\n&#34;, replylen); +       (void)strlcat(reply, &#34;]}\r\n&#34;, replylen); } else if (strncmp(buf, &#34;VERSION;&#34;, 8) == 0) [...]]]></description>
			<content:encoded><![CDATA[<p>gpsd自带一个php程序，只要有php和php-gd就可以生成这样的界面：<a href="http://www.rjsystems.nl/gpsd/" target="_self">http://www.rjsystems.nl/gpsd/</a>，可惜当我使用2.95版本的时候，却遇到了错误，按照INSTALL的方法把gpsd.php复制到web目录下，却发现json_decode error。</p>
<p><span id="more-982"></span>开始以为是php-json的问题，同事写了个简单的测试脚本，一切正常，最后观察返回的json数据，发现最后多了“]}”字符导致的。</p>
<p>在gpsd-2.95版本出现的bug，别的版本是否存在没有去研究过。</p>
<pre class="brush: plain;">diff -u gpsd.c_old gpsd.c
--- gpsd.c_old  2010-08-29 00:57:24.000000000 +0800
+++ gpsd.c      2010-08-29 00:57:39.000000000 +0800
@@ -1185,7 +1185,7 @@
 }
 if (reply[strlen(reply) - 1] == ',')
 reply[strlen(reply) - 1] = '&#92;&#48;';    /* trim trailing comma */
-       (void)strlcat(reply, &quot;]}]}\r\n&quot;, replylen);
+       (void)strlcat(reply, &quot;]}\r\n&quot;, replylen);
 } else if (strncmp(buf, &quot;VERSION;&quot;, 8) == 0) {
 buf += 8;
 json_version_dump(reply, replylen);
</pre>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/986" title="CentOS+GPS+Gpsd+ntpd架设时间服务器">CentOS+GPS+Gpsd+ntpd架设时间服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/270" title="Google地图的WIFI定位技术">Google地图的WIFI定位技术</a> (1)</li><li><a href="http://www.wenzk.com/archives/616" title="注册天涯社区的小bug">注册天涯社区的小bug</a> (0)</li><li><a href="http://www.wenzk.com/archives/444" title="服务器再次故障，仍然是sky2驱动问题">服务器再次故障，仍然是sky2驱动问题</a> (2)</li><li><a href="http://www.wenzk.com/archives/377" title="Google Gears GeolocationAPI">Google Gears GeolocationAPI</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/982/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何免费搭建自己的vps服务器？</title>
		<link>http://www.wenzk.com/archives/977</link>
		<comments>http://www.wenzk.com/archives/977#comments</comments>
		<pubDate>Wed, 25 Aug 2010 17:05:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenVZ]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[开源]]></category>
		<category><![CDATA[虚拟化]]></category>
		<category><![CDATA[虚拟机]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=977</guid>
		<description><![CDATA[首先在服务器上安装CENTOS5.X 确保能连上网络 一.准备工作 1.更新： yum check-update yum update2.打开防火墙8001端口 /sbin/iptables -I INPUT -p tcp –dport 8001 -j ACCEPT /etc/rc.d/init.d/iptables save /etc/init.d/iptables restart 二.安装OpenVZ(vps)软件 1.添加OpenVZ源 cd /etc/yum.repos.d wget http://download.openvz.org/openvz.repo rpm –import http://download.openvz.org/RPM-GPG-Key-OpenVZ2.安装OpenVZ yum search ovzkernel yum -y install ovzkernel yum -y install vzctl vzquota vi /etc/sysctl.conf看看以下代码是不是存在 net.ipv4.ip_forward = 1 net.ipv4.conf.default.proxy_arp = 0 net.ipv4.conf.all.rp_filter = 1 kernel.sysrq = [...]]]></description>
			<content:encoded><![CDATA[<p>首先在服务器上安装CENTOS5.X 确保能连上网络<br />
一.准备工作<br />
<span id="more-977"></span>1.更新：<br />
yum check-update<br />
yum update2.打开防火墙8001端口<br />
/sbin/iptables -I INPUT -p tcp –dport 8001 -j ACCEPT<br />
/etc/rc.d/init.d/iptables save<br />
/etc/init.d/iptables restart 二.安装OpenVZ(vps)软件<br />
1.添加OpenVZ源<br />
cd /etc/yum.repos.d<br />
wget <a href="http://download.openvz.org/openvz.repo">http://download.openvz.org/openvz.repo</a><br />
rpm –import <a href="http://download.openvz.org/RPM-GPG-Key-OpenVZ2">http://download.openvz.org/RPM-GPG-Key-OpenVZ2</a>.安装OpenVZ<br />
yum search ovzkernel<br />
yum -y install ovzkernel<br />
yum -y install vzctl vzquota<br />
vi /etc/sysctl.conf看看以下代码是不是存在<br />
net.ipv4.ip_forward = 1<br />
net.ipv4.conf.default.proxy_arp = 0<br />
net.ipv4.conf.all.rp_filter = 1<br />
kernel.sysrq = 1<br />
net.ipv4.conf.default.send_redirects = 1<br />
net.ipv4.conf.all.send_redirects = 0<br />
net.ipv4.icmp_echo_ignore_broadcasts = 1<br />
net.ipv4.conf.default.forwarding = 1<br />
生效<br />
sysctl -p<br />
vi /etc/sysconfig/selinux改为<br />
SELINUX=disabled<br />
SELINUXTYPE=targeted<br />
vi /etc/vz/vz.conf改为<br />
NEIGHBOUR_DEVS=all<br />
3.重新启动<br />
reboot4.查看内核<br />
uname -r显示<br />
2.6.18-128.2.1.el5.028stab064.4<br />
三.安装Vtonf的VPS控制面版<br />
1.安装依赖文件<br />
yum -y install vzpkg expect2.安装Vtonf控制面版<br />
cd /tmp<br />
wget <a href="http://mesh.dl.sourceforge.net/sourceforge/vtonf/vtonfinstaller.1.0-beta1.tar.gz">http://mesh.dl.sourceforge.net/sourceforge/vtonf/vtonfinstaller.1.0-beta1.tar.gz</a><br />
tar xvfz vtonfinstaller.1.0-beta1.tar.gz<br />
cd vtonfinstaller.1.0-beta1<br />
./install<br />
cd ../确定2个yes就进入安装了，安装过程中需要设置控制面版的管理员帐号和密码<br />
安装完成后使用<a href="http://ip:8001/">http://ip:8001</a>登陆Vtonf控制面版</p>
<p>From: <a href="http://www.hackhy.com/Article/3/32/html/6839.html" target="_blank">http://www.hackhy.com/Article/3/32/html/6839.html</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/935" title="单网卡多次PPPoE拨号问题">单网卡多次PPPoE拨号问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/457" title="CentOS 5.4 sky2驱动出错解决办法">CentOS 5.4 sky2驱动出错解决办法</a> (0)</li><li><a href="http://www.wenzk.com/archives/86" title="CentOS Mirroring HowTo">CentOS Mirroring HowTo</a> (0)</li><li><a href="http://www.wenzk.com/archives/962" title="Balancing Connections Over Multiple Links">Balancing Connections Over Multiple Links</a> (0)</li><li><a href="http://www.wenzk.com/archives/955" title="Linux Console下如何调节声卡音量大小">Linux Console下如何调节声卡音量大小</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/977/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>uRPF在思科和H3C上现实的差别</title>
		<link>http://www.wenzk.com/archives/970</link>
		<comments>http://www.wenzk.com/archives/970#comments</comments>
		<pubDate>Tue, 24 Aug 2010 03:24:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[H3C]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[uRPF]]></category>
		<category><![CDATA[思科]]></category>
		<category><![CDATA[路由器]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=970</guid>
		<description><![CDATA[以下文字来自H3C官方网站：http://www.h3c.com.cn/download.do?id=620562 URPF 处理流程 URPF 检查有严格（strict）型和松散（loose）型两种。此外，还可以支持ACL 与缺省路由的检查。 URPF 的处理流程如下： (1) 如果报文的源地址在路由器的FIB 表中存在对于strict 型检查，反向查找报文出接口，若其中至少有一个出接口和报文的入接口相匹配，则报文通过检查；否则报文将被拒绝。（反向查找是指查找以该报文源IP 地址为目的IP 地址的报文的出接口）对于loose 型检查，报文进行正常的转发。 (2) 如果报文的源地址在路由器的FIB 表中不存在，则检查缺省路由及URPF 的allow-default-route 参数。 对于配置了缺省路由，但没有配置参数allow-default-route 的情况，不管是strict型检查还是loose 型检查，只要报文的源地址在路由器的FIB 表中不存在，该 报文都将被拒绝； 对于配置了缺省路由，同时又配置了参数allow-default-route 的情况下，如果是strict 型检查，只要缺省路由的出接口与报文的入接口一致，则报文将通过 URPF 的检查，进行正常的转发；如果缺省路由的出接口和报文的入接口不一致，则报文将拒绝。如果是loose 型检查，报文都将通过URPF 的检查，进行 正常的转发。 (3) 当且仅当报文被拒绝后，才去匹配ACL。如果被ACL 允许通过，则报文继续进行正常的转发；如果被ACL 拒绝，则报文被丢弃。 以下文字来自CISCO官方网站：http://www.cisco.com/web/about/security/intelligence/unicast-rpf.html Introduction Network administrators can use Unicast Reverse Path Forwarding (Unicast RPF) to help limit the malicious traffic [...]]]></description>
			<content:encoded><![CDATA[<p>以下文字来自H3C官方网站：<a href="http://www.h3c.com.cn/download.do?id=620562" target="_blank">http://www.h3c.com.cn/download.do?id=620562</a></p>
<p>URPF 处理流程<br />
URPF 检查有严格（strict）型和松散（loose）型两种。此外，还可以支持ACL 与缺省路由的检查。<br />
URPF 的处理流程如下：<br />
(1) 如果报文的源地址在路由器的FIB 表中存在对于strict 型检查，反向查找报文出接口，若其中至少有一个出接口和报文的入接口相匹配，则报文通过检查；否则报文将被拒绝。（反向查找是指查找以该报文源IP 地址为目的IP 地址的报文的出接口）对于loose 型检查，报文进行正常的转发。<br />
(2) 如果报文的源地址在路由器的FIB 表中不存在，则检查缺省路由及URPF 的allow-default-route 参数。<br />
对于配置了缺省路由，但没有配置参数allow-default-route 的情况，不管是strict型检查还是loose 型检查，只要报文的源地址在路由器的FIB 表中不存在，该<br />
报文都将被拒绝；<br />
对于配置了缺省路由，同时又配置了参数allow-default-route 的情况下，如果是strict 型检查，只要缺省路由的出接口与报文的入接口一致，则报文将通过<br />
URPF 的检查，进行正常的转发；如果缺省路由的出接口和报文的入接口不一致，则报文将拒绝。如果是loose 型检查，报文都将通过URPF 的检查，进行<br />
正常的转发。<br />
(3) 当且仅当报文被拒绝后，才去匹配ACL。如果被ACL 允许通过，则报文继续进行正常的转发；如果被ACL 拒绝，则报文被丢弃。</p>
<p><span id="more-970"></span>以下文字来自CISCO官方网站：<a href="http://www.cisco.com/web/about/security/intelligence/unicast-rpf.html" target="_blank">http://www.cisco.com/web/about/security/intelligence/unicast-rpf.html</a><br />
<strong>Introduction</strong><br />
Network administrators can use Unicast Reverse Path Forwarding (Unicast RPF) to help limit the malicious traffic on an enterprise network. This security feature works by enabling a router to verify the reachability of the source address in packets being forwarded. This capability can limit the appearance of spoofed addresses on a network. If the source IP address is not valid, the packet is discarded. Unicast RPF works in one of three different modes: strict mode, loose mode, or VRF mode. Note that not all network devices support all three modes of operation. Unicast RPF in VRF mode will not be covered in this document.</p>
<p>When administrators use Unicast RPF in strict mode, the packet must be received on the interface that the router would use to forward the return packet. Unicast RPF configured in strict mode may drop legitimate traffic that is received on an interface that was not the router&#8217;s choice for sending return traffic. Dropping this legitimate traffic could occur when asymmetric routing paths are present in the network.</p>
<p>When administrators use Unicast RPF in loose mode, the source address must appear in the routing table. Administrators can change this behavior using the <strong>allow-default</strong> option, which allows the use of the default route in the source verification process. Additionally, a packet that contains a source address for which the return route points to the Null 0 interface will be dropped. An access list may also be specified that permits or denies certain source addresses in Unicast RPF loose mode.</p>
<p>Care must be taken to ensure that the appropriate Unicast RPF mode (loose or strict) is configured during the deployment of this feature because it can drop legitimate traffic. Although asymmetric traffic flows may be of concern when deploying this feature, Unicast RPF loose mode is a scalable option for networks that contain asymmetric routing paths.<br />
<strong>Unicast RPF in an Enterprise Network</strong><br />
In many enterprise environments, it is necessary to use a combination  of strict mode and loose mode Unicast RPF. The choice of the Unicast RPF  mode that will be used will depend on the design of the network segment  connected to the interface on which Unicast RPF is deployed.</p>
<p>Administrators should use Unicast RPF in strict mode on network interfaces for which all packets received on an interface are guaranteed to originate from the subnet assigned to the interface. A subnet composed of end stations or network resources fulfills this requirement. Such a design would be in place for an access layer network or a branch office where there is only one path into and out of the branch network. No other traffic originating from the subnet is allowed and no other routes are available past the subnet.</p>
<p>Unicast RPF loose mode can be used on an uplink network interface that has a default route associated with it.<br />
<strong>Unicast RPF Examples</strong><br />
<strong>Cisco IOS Devices</strong><br />
An important consideration for deployment is that Cisco Express Forwarding switching must be enabled for Unicast RPF to function. This command has been enabled by default as of IOS version 12.2. If it is not enabled, administrators can enable it with the following global configuration command: <strong>ip cef</strong></p>
<p>Unicast RPF is enabled on a per-interface basis. The <strong>ip verify unicast source reachable-via rx</strong> command enables Unicast RPF in strict mode. To enable loose mode, administrators can use the <strong>any</strong> option to enforce the requirement that the source IP address for a packet must appear in the routing table. The <strong>allow-default</strong> option may be used with either the <strong>rx</strong> or <strong>any</strong> option to include IP addresses not specifically contained in the routing table. The <strong>allow-self-ping</strong> option should not be used because it could create a denial of service condition. An access list such as the one that follows may also be configured to specifically permit or deny a list of addresses through Unicast RPF:</p>
<blockquote>
<pre>interface FastEthernet 0/0
ip verify unicast source reachable-via {rx | any} [allow-default]
[allow-self-ping] [<em>list</em>]</pre>
</blockquote>
<p>Addresses that should never appear on a network can be dropped by entering a route to a null interface. The following command will cause all traffic received from the 10.0.0.0/8 network to be dropped even if Unicast RPF is enabled in loose mode with the <strong>allow-default</strong> option: <strong>ip route 10.0.0.0 255.0.0.0 Null0</strong></p>
<p>从以上文字可以看出，CISCO在实现uRPF的时候考虑得比H3C稍微多了一点点，起码思科考虑到了路由表中下一跳地址为Null0接口的处理。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/563" title="最近那些事">最近那些事</a> (2)</li><li><a href="http://www.wenzk.com/archives/849" title="两个开源的Netflow Collector">两个开源的Netflow Collector</a> (0)</li><li><a href="http://www.wenzk.com/archives/846" title="关于Cisco 6509/7609 交换机Netflow的配置[转载]">关于Cisco 6509/7609 交换机Netflow的配置[转载]</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/970/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>单网卡多次PPPoE拨号实现方法</title>
		<link>http://www.wenzk.com/archives/965</link>
		<comments>http://www.wenzk.com/archives/965#comments</comments>
		<pubDate>Mon, 23 Aug 2010 15:40:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[PPPoE]]></category>
		<category><![CDATA[Vlan]]></category>
		<category><![CDATA[多网卡]]></category>
		<category><![CDATA[宽带]]></category>
		<category><![CDATA[桥接]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=965</guid>
		<description><![CDATA[本文着重分析如何使用“一块网卡”实现多次PPPoE拨号，大家都知道，在Linux下一块“物理网卡”只能实现一次PPPoE连接，本文列举4种方法来实现该功能。 方法一：虚拟机 这个方法也是最容易想到的，在网上也可以查到一堆资料。 如上图所示，在物理机器上安装虚拟机软件（如：VMware、Xen、Virtualbox等），在虚拟机中增加多块网卡，并且将虚拟网卡与物理网卡（eth0）进行“桥接”（注：这里的桥接不是Linux系统里面的桥接，而是虚拟机软件中配置虚拟网卡与物理网卡之间的关系）。在虚拟机安装Linux系统，即可以通过eth0、eth1、ethX来建立多个PPPoE连接了。 方法二：VLAN 这个方法通过VLAN来实现，不知道在网上是否有相关的资料，反正到目前为止我还没有搜索到相关的资料，应该属于自创吧，呵呵。 具体如下如： 如上如所示，做如下操作： 1、用交叉线（新的网卡已经不用交叉线了）把eth1和eth2连接起来。 2、在eth1和eth2上启动VLAN，在eth1上创建相应的vlan接口（eth1.10、eth1.11、eth1.12 &#8230;)，同样在eth2接口上也创建相应的vlan接口（eth2.10、eth2.11、eth2.12 &#8230;)。 3、把eth1.10、eth1.11、eth1.12&#8230;eth1.X与物理网卡eth0桥接。（注意，这里使用的是Linux系统自带的桥接功能）。 4、修改eth2.10、eth2.11、eth2.12 &#8230;eth2.X的MAC地址。（建议修改，MAC地址相同也能用）。 5、分别用eth2.10、eth2.11、eth2.12 &#8230;eth2.X进行PPPoE连接。 方法三：与方法二一致，只是eth1、eth2和中间的双绞线通过软件来实现（经试验OpenVPN是可行的），具体方法这里不详述。 方法四：X-router（Windows下的软件），详见：http://www.yitsoftware.com/XRouter/index.htm 相关文章单网卡多次PPPoE拨号问题 (0)ADSL改成小区宽带接入啦 (0)使用freebsd构建pppoe server服务器 (0)基于freebsd建立内核模式的pppoe服务器 (0)Guide: OpenVPN with Windows 7 (0)]]></description>
			<content:encoded><![CDATA[<p>本文着重分析如何使用“一块网卡”实现多次PPPoE拨号，大家都知道，在Linux下一块“物理网卡”只能实现一次PPPoE连接，本文列举4种方法来实现该功能。</p>
<p><span id="more-965"></span>方法一：虚拟机</p>
<p>这个方法也是最容易想到的，在网上也可以查到一堆资料。</p>
<p><a href="http://www.wenzk.com/wp-content/uploads/2010/08/PPPoE多次拨号1.png" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-966" title="PPPoE多次拨号1" src="http://www.wenzk.com/wp-content/uploads/2010/08/PPPoE多次拨号1-300x225.png" alt="" width="300" height="225" /></a></p>
<p>如上图所示，在物理机器上安装虚拟机软件（如：VMware、Xen、Virtualbox等），在虚拟机中增加多块网卡，并且将虚拟网卡与物理网卡（eth0）进行“桥接”（注：这里的桥接不是Linux系统里面的桥接，而是虚拟机软件中配置虚拟网卡与物理网卡之间的关系）。在虚拟机安装Linux系统，即可以通过eth0、eth1、ethX来建立多个PPPoE连接了。</p>
<p>方法二：VLAN</p>
<p>这个方法通过VLAN来实现，不知道在网上是否有相关的资料，反正到目前为止我还没有搜索到相关的资料，应该属于自创吧，呵呵。</p>
<p>具体如下如：</p>
<p><a href="http://www.wenzk.com/wp-content/uploads/2010/08/PPPoE多次拨号2.png" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-967" title="PPPoE多次拨号2" src="http://www.wenzk.com/wp-content/uploads/2010/08/PPPoE多次拨号2-300x225.png" alt="" width="300" height="225" /></a></p>
<p>如上如所示，做如下操作：</p>
<p>1、用交叉线（新的网卡已经不用交叉线了）把eth1和eth2连接起来。</p>
<p>2、在eth1和eth2上启动VLAN，在eth1上创建相应的vlan接口（eth1.10、eth1.11、eth1.12 &#8230;)，同样在eth2接口上也创建相应的vlan接口（eth2.10、eth2.11、eth2.12 &#8230;)。</p>
<p>3、把eth1.10、eth1.11、eth1.12&#8230;eth1.X与物理网卡eth0桥接。（注意，这里使用的是Linux系统自带的桥接功能）。</p>
<p>4、修改eth2.10、eth2.11、eth2.12 &#8230;eth2.X的MAC地址。（建议修改，MAC地址相同也能用）。</p>
<p>5、分别用eth2.10、eth2.11、eth2.12 &#8230;eth2.X进行PPPoE连接。</p>
<p>方法三：与方法二一致，只是eth1、eth2和中间的双绞线通过软件来实现（经试验OpenVPN是可行的），具体方法这里不详述。</p>
<p>方法四：X-router（Windows下的软件），详见：<a href="http://www.yitsoftware.com/XRouter/index.htm" target="_blank">http://www.yitsoftware.com/XRouter/index.htm</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/935" title="单网卡多次PPPoE拨号问题">单网卡多次PPPoE拨号问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/873" title="ADSL改成小区宽带接入啦">ADSL改成小区宽带接入啦</a> (0)</li><li><a href="http://www.wenzk.com/archives/819" title="使用freebsd构建pppoe server服务器">使用freebsd构建pppoe server服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/817" title="基于freebsd建立内核模式的pppoe服务器">基于freebsd建立内核模式的pppoe服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/503" title="Guide: OpenVPN with Windows 7">Guide: OpenVPN with Windows 7</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/965/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Balancing Connections Over Multiple Links</title>
		<link>http://www.wenzk.com/archives/962</link>
		<comments>http://www.wenzk.com/archives/962#comments</comments>
		<pubDate>Mon, 23 Aug 2010 11:05:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[多出口]]></category>
		<category><![CDATA[多链路]]></category>
		<category><![CDATA[负载均衡]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=962</guid>
		<description><![CDATA[General Idea Say you have access to multiple links to the Internet, such as several wireless networks in range. Wouldn&#8217;t it be nice to combine all that bandwidth into one big fat pipe? Unfortunately it&#8217;s not so easy. You can&#8217;t just trunk them together because they each have a different public IP address, gateway, etc. [...]]]></description>
			<content:encoded><![CDATA[<p><a name="idea"></p>
<h2>General Idea</h2>
<p></a> Say you have access to multiple links to the Internet, such as several wireless networks in range.  Wouldn&#8217;t it be nice to combine all that bandwidth into one big fat pipe?</p>
<p><span id="more-962"></span>Unfortunately it&#8217;s not so easy.  You can&#8217;t just  <a href="http://linux-ip.net/html/ether-bonding.html">trunk</a> them together because they each have a different public IP address, gateway, etc.</p>
<p>What you can do however, thanks to some nifty Linux <a href="http://www.netfilter.org/">NetFilter</a> extensions, is assign  outgoing connections to different interfaces.  This will allow protocols such as <a href="http://www.bittorrent.com/">BitTorrent</a> to utilize bandwidth from each of the links.</p>
<p>This document focuses on Linux iptables/NetFilter.  You can achieve pretty much the same result with <a href="http://lartc.org/howto/lartc.rpdb.multiple-links.html">Linux Advanced Routing</a> techniques.  One small difference, as the link mentions, is that routes are cached, so connections to frequently used sites will always go over the same link.  This may or may not be the behaviour you desire.</p>
<p><a name="prereq"></p>
<h2>Prerequisites</h2>
<p></a> You need a recent Linux kernel patched with support for the ROUTE target and either the &#8220;nth&#8221; or &#8220;random&#8221; match module.  These patches are available in NetFilter&#8217;s &#8220;patch-o-matic-ng&#8221; <a href="http://www.netfilter.org/downloads.html#svn">subversion</a> module.  I won&#8217;t go into how to apply the patches, as more than sufficient documentation is included with them.</p>
<p>Testing I did was on Linux 2.6.14.2 patched with a copy of patch-o-matic-ng checked out with svn on 2005-11-18.</p>
<p><a name="setup"></p>
<h2>Setup</h2>
<p></a> In the following examples, I use three interfaces:</p>
<ul>
<li><strong>eth0</strong>: Wired connection, 192.168.1.0/24, gateway 192.168.1.1, default route.</li>
<li><strong>eth1</strong>: Wireless connetion 1, 172.16.0.0/16, gateway 172.16.0.1</li>
<li><strong>rausb0</strong>: Wireless connetion 2, 192.168.0.0/24, gateway 192.168.0.1</li>
</ul>
<p>I use the connmark match/target to assign each connection to an interface, and make sure all the packets for the connection go over that one interface. Balancing the connections over the interfaces can be done with either &#8220;random&#8221; or &#8220;nth&#8221; match module.  I will give you both examples, choose which ever one you prefer.  The following commands are common to both methods.</p>
<p><strong>Common commands:</strong></p>
<pre># prevent incoming packets on masqueraded connections from being dropped
# as "martians" due to the destination address being translated before the
# rp_filter check is performed
echo 0 &gt; /proc/sys/net/ipv4/conf/eth1/rp_filter
echo 0 &gt; /proc/sys/net/ipv4/conf/rausb0/rp_filter

# Load protocol-specific connection tracking modules so that new connections
# associated with existing connections have state "RELATED" and inherit the
# same connmark.
modprobe ip_conntrack_ftp

# masquerade outgoing connections on secondary interfaces
iptables -t nat -A POSTROUTING -o eth1   -s ! 172.16.0.0/16  -m state --state NEW,RELATED -j MASQUERADE
iptables -t nat -A POSTROUTING -o rausb0 -s ! 192.168.0.0/24 -m state --state NEW,RELATED -j MASQUERADE

# create a chain for processing new outgoing connetions
iptables -t mangle -N NEW_OUT_CONN

# Skip connections we want to always go out wired interface
iptables -t mangle -A NEW_OUT_CONN -d 192.168.1.0/24 -j RETURN
iptables -t mangle -A NEW_OUT_CONN -p tcp -m multiport --destination-ports 21,22,80,443,6667 -j RETURN
iptables -t mangle -A NEW_OUT_CONN -p udp --dport 53 -j RETURN

# have new outgoing connections pass through the above chain
iptables -t mangle -A OUTPUT -o eth0 -m state --state NEW -j NEW_OUT_CONN

# send packets out chosen interface
iptables -t mangle -A OUTPUT -m connmark --mark 2 -j ROUTE --gw 172.16.0.1 --continue
iptables -t mangle -A OUTPUT -m connmark --mark 3 -j ROUTE --gw 192.168.0.1 --continue
</pre>
<p><strong>The &#8220;random&#8221; method:</strong></p>
<pre># 34% of the time go out the default interface
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 0
iptables -t mangle -A NEW_OUT_CONN -m random --average 34 -j RETURN

# 33% of the time go out eth1 (50% of the remaining probability)
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 2
iptables -t mangle -A NEW_OUT_CONN -m random --average 50 -j RETURN

# else (hopefully 33% of the time) go out rausb0
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 3
</pre>
<p><strong>The &#8220;nth&#8221; method:</strong></p>
<pre># 1st of every 3 connections goes out the default interface
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 0
iptables -t mangle -A NEW_OUT_CONN -m nth --counter 1 --every 3 --packet 0 -j RETURN

# 2nd of every 3 connections goes out eth1
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 2
iptables -t mangle -A NEW_OUT_CONN -m nth --counter 1 --every 3 --packet 1 -j RETURN

# 3rd of every 3 connections goes out rausb0
iptables -t mangle -A NEW_OUT_CONN -j CONNMARK --set-mark 3
iptables -t mangle -A NEW_OUT_CONN -m nth --counter 1 --every 3 --packet 2 -j RETURN
</pre>
<p><strong>Handling when an interface goes down:</strong></p>
<p>This script will make sure no packets get routed over a secondary interface that has gone down.  Put it in your /etc/network/if-down.d/ (Debian), or equivalent, directory and chmod +x it.</p>
<pre>#!/bin/sh

if [ "$IFACE" = "eth1" ]; then
  iptables -t mangle -D OUTPUT -m connmark --mark 2 -j ROUTE --gw 172.16.0.1 --continue 2&gt;/dev/null
fi

if [ "$IFACE" = "rausb0" ]; then
  iptables -t mangle -D OUTPUT -m connmark --mark 3 -j ROUTE --gw 192.168.0.1 --continue 2&gt;/dev/null
fi

exit 0
</pre>
<p><strong>Handling when an interface comes back up:</strong></p>
<p>This script will allow an interface to be used again when it comes back up. Put it in your /etc/network/if-up.d/ (Debian), or equivalent, directory and chmod +x it.</p>
<pre>#!/bin/sh

if [ "$IFACE" = "eth1" ]; then
  iptables -t mangle -A OUTPUT -m connmark --mark 2 -j ROUTE --gw 172.16.0.1 --continue 2&gt;/dev/null
fi

if [ "$IFACE" = "rausb0" ]; then
  iptables -t mangle -A OUTPUT -m connmark --mark 3 -j ROUTE --gw 192.168.0.1 --continue 2&gt;/dev/null
fi

exit 0
</pre>
<p><a name="results"></p>
<h2>Results</h2>
<p></a> <img src="http://www.wenzk.com/wp-content/uploads/2010/08/d49e_multilink-results.png" alt="Screenshot of BitTornado" /><br />
Not too shaby I think.  Normally with my single DSL connection alone I get somewhere around 150 KB/s.  Maybe if there&#8217;s a smarter way to distribute connections this could be improved upon.  Optimally my 3 test links combined would add up to 450 KB/s.</p>
<p><a name="todo"></p>
<h2>TODO</h2>
<p></a></p>
<ul>
<li>Write scripts to make setting all this up a snap.</li>
<li>Figure out a way to translate outgoing FTP &#8216;PORT&#8217; commands for all links.</li>
</ul>
<p><a name="changelog"></p>
<h2>ChangeLog</h2>
<p></a> <em>Mon Jan  2 05:43:47 PST 2006</em><br />
Michael Heimpold pointed out that &#8211;average 33 was wrong for the second -m random rule.</p>
<p><em>Fri Jan 13 09:37:12 PST 2006</em><br />
Michael Heimpold figured out that RELATED connections (set as such by modules like ip_conntrack_ftp) inherit the same connmark.  Changed the masquerading rules to also match RELATED packets.  Now passive FTP works reliably.</p>
<p>From: <a href="http://tetro.net/misc/multilink.html" target="_blank">http://tetro.net/misc/multilink.html</a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/944" title="Links Load balancing">Links Load balancing</a> (0)</li><li><a href="http://www.wenzk.com/archives/942" title="Netfilter Connmark">Netfilter Connmark</a> (0)</li><li><a href="http://www.wenzk.com/archives/610" title="通过iptables的recent模块保护某些私有服务">通过iptables的recent模块保护某些私有服务</a> (2)</li><li><a href="http://www.wenzk.com/archives/45" title="其实Recent还可以这么用">其实Recent还可以这么用</a> (0)</li><li><a href="http://www.wenzk.com/archives/43" title="巧用Recent模块加固Linux安全">巧用Recent模块加固Linux安全</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/962/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blue.box又是一个ISO</title>
		<link>http://www.wenzk.com/archives/960</link>
		<comments>http://www.wenzk.com/archives/960#comments</comments>
		<pubDate>Sun, 22 Aug 2010 17:01:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[FreeBPX]]></category>
		<category><![CDATA[Freeswitch]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[VoIP]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=960</guid>
		<description><![CDATA[blue.box是2600hz项目的一个ISO发行版本，基于CentOS5.5 x86_64，包含：FreeSWITCH 1.06, FreeSWITCH Sound files, Blue.Box 1.0, Apache 2.2.3,  MySQL 5.1.46, and PHP 5.3.2。似乎2600hz是FreePBX3.0独立出来的一个项目，这个项目优先支持FreeSWITCH，从FreeSWITCH作者看来，他对Asterisk及其不满的情况下，才开始这了这个项目，应该比较有前途吧。 下载地址：http://www.2600hz.org/downloads/ 相关文章为何我的LinkSys SPA1001无法注册 (0)Asterisk/Freeiris使用过程中碰到的一些问题及注意事项 (0)连接两台asterisk服务器 (0)Linksys SIP网关NAT问题 (0)ASTERISK之SIP对接及注册设置 (0)]]></description>
			<content:encoded><![CDATA[<p>blue.box是2600hz项目的一个ISO发行版本，基于CentOS5.5 x86_64，包含：FreeSWITCH 1.06, FreeSWITCH Sound files, Blue.Box 1.0, Apache 2.2.3,  MySQL 5.1.46, and PHP 5.3.2。似乎2600hz是FreePBX3.0独立出来的一个项目，这个项目优先支持FreeSWITCH，从FreeSWITCH作者看来，他对Asterisk及其不满的情况下，才开始这了这个项目，应该比较有前途吧。</p>
<p>下载地址：http://www.2600hz.org/downloads/</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/953" title="为何我的LinkSys SPA1001无法注册">为何我的LinkSys SPA1001无法注册</a> (0)</li><li><a href="http://www.wenzk.com/archives/951" title="Asterisk/Freeiris使用过程中碰到的一些问题及注意事项">Asterisk/Freeiris使用过程中碰到的一些问题及注意事项</a> (0)</li><li><a href="http://www.wenzk.com/archives/926" title="连接两台asterisk服务器">连接两台asterisk服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/922" title="Linksys SIP网关NAT问题">Linksys SIP网关NAT问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/919" title="ASTERISK之SIP对接及注册设置">ASTERISK之SIP对接及注册设置</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/960/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Console下如何调节声卡音量大小</title>
		<link>http://www.wenzk.com/archives/955</link>
		<comments>http://www.wenzk.com/archives/955#comments</comments>
		<pubDate>Sat, 21 Aug 2010 08:18:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[准系统]]></category>
		<category><![CDATA[声音]]></category>
		<category><![CDATA[混音器]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=955</guid>
		<description><![CDATA[前一段时间从淘宝上掏来一个准系统，放家里当路由器使，之所以不使用商用的路由器，主要是想在路由器上安装linux系统，实现自动连接多路VPN等特殊功能。 在CentOS5下安装上mplayer和vlc播放器后，播放mp3，接上耳机结果没声音，通过lsmod查看声卡驱动应该是没问题的，相应的模块都加载进来了。应该是混音器的问题，于是找寻Linux下Console混音器软件alsa-utils。 [wzk@ELM_HR ~]$ yum -v search alsa-utils Loading &#34;fastestmirror&#34; plugin Loading &#34;kmod&#34; plugin Config time: 0.226 Loading Fedora Extras kernel module support. Yum Version: 3.2.22 Setting up Package Sacks pkgsack time: 0.099 rpmdb time: 0.000 ================================ Matched: alsa-utils ================================= alsa-utils.i386 : Advanced Linux Sound Architecture (ALSA) utilities Repo        : base Matched from: 从上面可以看到，alsa-utils可以直接通过yum install来安装，安装后运行alsamixer，可以看到如下界面： [...]]]></description>
			<content:encoded><![CDATA[<p>前一段时间从淘宝上掏来一个准系统，放家里当路由器使，之所以不使用商用的路由器，主要是想在路由器上安装linux系统，实现自动连接多路VPN等特殊功能。</p>
<p><span id="more-955"></span><a href="http://www.wenzk.com/wp-content/uploads/2010/08/PICT0277.jpg" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-956" title="MINOLTA DIGITAL CAMERA" src="http://www.wenzk.com/wp-content/uploads/2010/08/PICT0277-300x224.jpg" alt="" width="300" height="224" /></a></p>
<p>在CentOS5下安装上mplayer和vlc播放器后，播放mp3，接上耳机结果没声音，通过lsmod查看声卡驱动应该是没问题的，相应的模块都加载进来了。应该是混音器的问题，于是找寻Linux下Console混音器软件alsa-utils。</p>
<pre class="brush: plain;">[wzk@ELM_HR ~]$ yum -v search alsa-utils
Loading &quot;fastestmirror&quot; plugin
Loading &quot;kmod&quot; plugin
Config time: 0.226
Loading Fedora Extras kernel module support.
Yum Version: 3.2.22
Setting up Package Sacks
pkgsack time: 0.099
rpmdb time: 0.000
================================ Matched: alsa-utils =================================
alsa-utils.i386 : Advanced Linux Sound Architecture (ALSA) utilities
Repo        : base
Matched from:
</pre>
<p>从上面可以看到，alsa-utils可以直接通过yum install来安装，安装后运行alsamixer，可以看到如下界面：</p>
<p><a href="http://www.wenzk.com/wp-content/uploads/2010/08/aslamixer.png" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-957" title="aslamixer" src="http://www.wenzk.com/wp-content/uploads/2010/08/aslamixer-300x182.png" alt="" width="300" height="182" /></a></p>
<p>注意：“MM”表示被禁音了，按m即可取消，Master和PCM不能被禁音，按Esc退出。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/977" title="如何免费搭建自己的vps服务器？">如何免费搭建自己的vps服务器？</a> (0)</li><li><a href="http://www.wenzk.com/archives/962" title="Balancing Connections Over Multiple Links">Balancing Connections Over Multiple Links</a> (0)</li><li><a href="http://www.wenzk.com/archives/944" title="Links Load balancing">Links Load balancing</a> (0)</li><li><a href="http://www.wenzk.com/archives/942" title="Netfilter Connmark">Netfilter Connmark</a> (0)</li><li><a href="http://www.wenzk.com/archives/935" title="单网卡多次PPPoE拨号问题">单网卡多次PPPoE拨号问题</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/955/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为何我的LinkSys SPA1001无法注册</title>
		<link>http://www.wenzk.com/archives/953</link>
		<comments>http://www.wenzk.com/archives/953#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:47:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[SIP]]></category>
		<category><![CDATA[SPA1001]]></category>
		<category><![CDATA[VoIP]]></category>
		<category><![CDATA[软交换]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=953</guid>
		<description><![CDATA[环境：Freeiris2 + Linksys SPA1001 + Linux + iptables + ip_nat_sip 现象：服务器启动后（iptables也启动了），后打开Linksys SPA1001无法注册（在此之前SPA1001曾经注册到服务器上），相同的帐号，用X-lite可以注册。 解决办法： 1、SPA1001启动后，停止iptables，等待一段时间后重新启动iptables即可。 2、Linux的iptables启动的时候，不加载“ip_nat_sip”模块，有可能“ip_conntrack_sip”也不要加载。 3、启动Asterisk之前删除“/var/lib/asterisk/astdb”文件。 以上方法任选其一即可。 经过分析发现，其实就是被Asterisk、SPA1001、ip_nat_sip和UDP给愚弄了。 主要问题： SPA 1001：该死的SPA1001去连接SIP服务器的时候，居然是用5060这个源端口。 Asterisk：会产生/var/lib/asterisk/astdb文件，用于记录所有SIP client的IP地址和端口号，下次重新启动后，会主动对端口为5060的IP地址发送一个OPTIONS&#8230;的报文。 UDP：UDP报文是面向无连接的，所以ip_nat_sip去检查连接状态的时候，就会通过源、目的IP地址和端口来确定是否同一个连接。 /var/lib/asterisk/astdb文件的内容： # strings astdb /SIP/Registry/8001 192.168.1.1:5060:300:8001:sip:8001@192.168.1.1:5060 Asterisk启动后，SPA1001尚未启动前/proc/net/ip_conntrack里面的相关内容： udp      17 3590 src=192.168.1.254 dst=192.168.1.1 sport=5060 dport=5060 packets=25 bytes=14500 [UNREPLIED] src=192.168.1.1 dst=192.168.1.254 sport=5060 dport=5060 packets=0 bytes=0 mark=0 secmark=0 use=1 给SPA1001加电后/proc/net/ip_conntrack里面的相关内容： udp      17 3596 src=192.168.1.254 [...]]]></description>
			<content:encoded><![CDATA[<p>环境：Freeiris2 + Linksys SPA1001 + Linux + iptables + ip_nat_sip</p>
<p>现象：服务器启动后（iptables也启动了），后打开Linksys SPA1001无法注册（在此之前SPA1001曾经注册到服务器上），相同的帐号，用X-lite可以注册。</p>
<p>解决办法：</p>
<p>1、SPA1001启动后，停止iptables，等待一段时间后重新启动iptables即可。</p>
<p>2、Linux的iptables启动的时候，不加载“ip_nat_sip”模块，有可能“ip_conntrack_sip”也不要加载。</p>
<p>3、启动Asterisk之前删除“/var/lib/asterisk/astdb”文件。</p>
<p>以上方法任选其一即可。</p>
<p><span id="more-953"></span>经过分析发现，其实就是被Asterisk、SPA1001、ip_nat_sip和UDP给愚弄了。</p>
<p>主要问题：</p>
<p>SPA 1001：该死的SPA1001去连接SIP服务器的时候，居然是用5060这个源端口。</p>
<p>Asterisk：会产生/var/lib/asterisk/astdb文件，用于记录所有SIP client的IP地址和端口号，下次重新启动后，会主动对端口为5060的IP地址发送一个OPTIONS&#8230;的报文。</p>
<p>UDP：UDP报文是面向无连接的，所以ip_nat_sip去检查连接状态的时候，就会通过源、目的IP地址和端口来确定是否同一个连接。</p>
<p>/var/lib/asterisk/astdb文件的内容：</p>
<p># strings astdb<br />
/SIP/Registry/8001<br />
192.168.1.1:5060:300:8001:sip:8001@192.168.1.1:5060</p>
<p>Asterisk启动后，SPA1001尚未启动前/proc/net/ip_conntrack里面的相关内容：</p>
<p>udp      17 3590 src=192.168.1.254 dst=192.168.1.1 sport=5060 dport=5060 packets=25 bytes=14500 [UNREPLIED] src=192.168.1.1 dst=192.168.1.254 sport=5060 dport=5060 packets=0 bytes=0 mark=0 secmark=0 use=1</p>
<p>给SPA1001加电后/proc/net/ip_conntrack里面的相关内容：</p>
<p>udp      17 3596 src=192.168.1.254 dst=192.168.1.1 sport=5060 dport=5060 packets=31 bytes=17980 src=192.168.1.1 dst=192.168.1.254 sport=5060 dport=5060 packets=5 bytes=2477 [ASSURED] mark=0 secmark=0 use=1</p>
<p>系统居然把SPA1001注册的报文与之前Asterisk发送的那个OPTIONS报文给关联上了，导致Asterisk一直无法收到注册请求。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/951" title="Asterisk/Freeiris使用过程中碰到的一些问题及注意事项">Asterisk/Freeiris使用过程中碰到的一些问题及注意事项</a> (0)</li><li><a href="http://www.wenzk.com/archives/915" title="How do I change my default Maint password?">How do I change my default Maint password?</a> (0)</li><li><a href="http://www.wenzk.com/archives/926" title="连接两台asterisk服务器">连接两台asterisk服务器</a> (0)</li><li><a href="http://www.wenzk.com/archives/919" title="ASTERISK之SIP对接及注册设置">ASTERISK之SIP对接及注册设置</a> (0)</li><li><a href="http://www.wenzk.com/archives/913" title="Trixbox的SIP Trunk配置">Trixbox的SIP Trunk配置</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/953/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
