﻿<?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>IT博客-network-随笔分类-學習心得</title><link>http://www.cnitblog.com/snfnvtk/category/5542.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 06:07:47 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 06:07:47 GMT</pubDate><ttl>60</ttl><item><title>dhcp install</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Tue, 17 Jun 2008 16:37:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45839.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45839.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45839.html</trackback:ping><description><![CDATA[<p>下载最新的dhcp***.tar.gz<br><br>&nbsp;cp dhpc***.tar.gz /tmp<br>&nbsp;&nbsp;&nbsp;tar xvzf dhcp***.tar.gz<br>&nbsp;&nbsp;&nbsp;cd dhcp***<br>&nbsp;&nbsp;&nbsp;./configure<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;make<br>&nbsp;&nbsp;&nbsp;make install<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;cp&nbsp;server/dhcpd.conf&nbsp; /etc/<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;/etc/init.d/dhcdbd start<br><br>&nbsp;开机启动<br>&nbsp;chkconfig --add&nbsp;dhcdbd<br>&nbsp;&nbsp;chkconfig --level&nbsp; 2345 dhcdbd on<br>&nbsp;<br>&nbsp;设置单域dhcp<br><br>vi /etc/dhcpd.conf<br><br>&nbsp; #option domain-name "example";<br><br>&nbsp;ddns-update-style ad-hoc<br><br>&nbsp;option domain-name-servers 192.168.1.1;<br><br>&nbsp;default-lease-time 600;<br>&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;max-lease-time 7200;<br><br>&nbsp;authoritative;<br><br>subnet 192.168.1.0 netmask 255.255.255.0 {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;range 192.168.1.10 192.168.1.200;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;option routers&nbsp;192.168.1.254;<br>&nbsp;&nbsp;&nbsp;}<br><br><br>&nbsp;更多配置,请查看dhcpd.conf<br><br><br>&nbsp;&nbsp;还有一个要注意的地方,<br><br>&nbsp;那就是以tar安装的包..在/tmp/dhcp***/server/dhcpd.leases.5中有个说明,<br>&nbsp;需要一个DHCP&nbsp;Client database<br><br>dhcpd.leases - DHCP client lease database<br><br>有这样一段<br><br>hen dhcpd is first installed, there is no lease database.&nbsp;&nbsp; However,<br>dhcpd requires that a lease database be present before it will start.<br>To make the initial lease database, just create an empty file called<br>DBDIR/dhcpd.leases.&nbsp;&nbsp; You can do this with:<br>.PP<br>.nf<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch DBDIR/dhcpd.leases<br><br><br>&nbsp;所以在启动服务前最好在<br><br>&nbsp;/var/state/dhcp/ 目录下面新建一个dhcpd.leases<br><br>&nbsp;touch /var/state/dhcp/dhcpd.leases<br><br>另在/tmp/dhcp***/README&nbsp;中找到一段在LINUX下安装DHCP服务器的说明<br>如下:<br>&nbsp; LINUX: BROADCAST</p>
<p>If you are running a recent version of Linux, this won't be a problem,<br>but on older versions of Linux (kernel versions prior to 2.2), there<br>is a potential problem with the broadcast address being sent<br>incorrectly.</p>
<p>In order for dhcpd to work correctly with picky DHCP clients (e.g.,<br>Windows 95), it must be able to send packets with an IP destination<br>address of 255.255.255.255.&nbsp; Unfortunately, Linux changes an IP<br>destination of 255.255.255.255 into the local subnet broadcast address<br>(here, that's 192.5.5.223).</p>
<p>This isn't generally a problem on Linux 2.2 and later kernels, since<br>we completely bypass the Linux IP stack, but on old versions of Linux<br>2.1 and all versions of Linux prior to 2.1, it is a problem - pickier<br>DHCP clients connected to the same network as the ISC DHCP server or<br>ISC relay agent will not see messages from the DHCP server.&nbsp;&nbsp; It *is*<br>possible to run into trouble with this on Linux 2.2 and later if you<br>are running a verson of the DHCP server that was compiled on a Linux<br>2.0 system, though.</p>
<p>It is possible to work around this problem on some versions of Linux<br>by creating a host route from your network interface address to<br>255.255.255.255.&nbsp;&nbsp; The command you need to use to do this on Linux<br>varies from version to version.&nbsp;&nbsp; The easiest version is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -host 255.255.255.255 dev eth0</p>
<p>On some older Linux systems, you will get an error if you try to do<br>this.&nbsp;&nbsp; On those systems, try adding the following entry to your<br>/etc/hosts file:</p>
<p>255.255.255.255 all-ones</p>
<p>Then, try:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -host all-ones dev eth0</p>
<p>Another route that has worked for some users is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -net 255.255.255.0 dev eth0</p>
<p>If you are not using eth0 as your network interface, you should<br>specify the network interface you *are* using in your route command.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: IP BOOTP AGENT</p>
<p>Some versions of the Linux 2.1 kernel apparently prevent dhcpd from<br>working unless you enable it by doing the following:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent</p>
<p><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: MULTIPLE INTERFACES</p>
<p>Very old versions of the Linux kernel do not provide a networking API<br>that allows dhcpd to operate correctly if the system has more than one<br>broadcast network interface.&nbsp; However, Linux 2.0 kernels with version<br>numbers greater than or equal to 2.0.31 add an API feature: the<br>SO_BINDTODEVICE socket option.&nbsp; If SO_BINDTODEVICE is present, it is<br>possible for dhcpd to operate on Linux with more than one network<br>interface.&nbsp; In order to take advantage of this, you must be running a<br>2.0.31 or greater kernel, and you must have 2.0.31 or later system<br>headers installed *before* you build the DHCP Distribution.</p>
<p>We have heard reports that you must still add routes to 255.255.255.255<br>in order for the all-ones broadcast to work, even on 2.0.31 kernels.<br>In fact, you now need to add a route for each interface.&nbsp;&nbsp; Hopefully<br>the Linux kernel gurus will get this straight eventually.</p>
<p>Linux 2.1 and later kernels do not use SO_BINDTODEVICE or require the<br>broadcast address hack, but do support multiple interfaces, using the<br>Linux Packet Filter.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LINUX: 802.1q VLAN INTERFACES</p>
<p>If you're using 802.1q vlan interfaces on Linux, it is necessary to<br>vconfig the subinterface(s) to rewrite the 802.1q information out of<br>packets received by the dhcpd daemon via LPF:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vconfig set_flag eth1.523 1 1</p>
<p>Note that this may affect the performance of your system, since the<br>Linux kernel must rewrite packets received via this interface.&nbsp; For<br>more information, consult the vconfig man pages.<br><br><br>&nbsp;这个文件告诉我们..<br>It is possible to work around this problem on some versions of Linux<br>by creating a host route from your network interface address to<br>255.255.255.255.&nbsp;&nbsp; The command you need to use to do this on Linux<br>varies from version to version.&nbsp;&nbsp; The easiest version is<br><br>说明一些版本的LINUX上运行可能出再错误,我们需要添加一条<br>路由<br>&nbsp; route add -host 255.255.255.255 dev eth0<br><br>On some older Linux systems, you will get an error if you try to do<br>this.&nbsp;&nbsp; On those systems, try adding the following entry to your<br>/etc/hosts file:<br>255.255.255.255 all-ones&nbsp;<br><br>&nbsp;在一些老的版本的LINUX 可能会出现错误.所以我们得编辑<br>&nbsp;/etc/hosts<br>&nbsp;加入下面一行<br><br>255.255.255.255 all-ones&nbsp;(这个名字可以自己定义,方便记忆.你也可以写成255.255.255.255 dhcp.)<br><br>&nbsp;然后在添加路由的时候,你可以用下面的命令:<br><br>&nbsp;&nbsp;route add -host&nbsp;all-ones dev eth0;<br><br>Another route that has worked for some users is:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; route add -net 255.255.255.0 dev eth0<br>If you are not using eth0 as your network interface, you should<br>specify the network interface you *are* using in your route command.<br><br>&nbsp;这个是说明是为了在你不使用eth0的时候.你可以用其它接口代替命令行中的接口.<br><br>&nbsp;Some versions of the Linux 2.1 kernel apparently prevent dhcpd from<br>working unless you enable it by doing the following:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在现在新的版本里,可能用到的是<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo 1 &gt;/proc/sys/net/ipv4/ip_forward<br><br>&nbsp;有一些版本的内核可能不允许dhcp工作.你就得使用下面的命令<br>&nbsp; echo 1 &gt;/proc/sys/net/ipv4/ip_bootp_agent<br><br>&nbsp;端口多路复用问题.是针对一些老板本的内核.自己看着办吧!<br><br><br>最后就是一个802.1Q虚拟接口的问题....<br>没有研究过...<br>&nbsp;<br><br><br><br>&nbsp;<br><br>&nbsp;<br>&nbsp;&nbsp;<br><br><br>&nbsp;&nbsp;&nbsp;</p>
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-18 00:37 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/18/45839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vsftp 安装过程</title><link>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Wed, 11 Jun 2008 16:16:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/45469.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/45469.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/45469.html</trackback:ping><description><![CDATA[<p>先下载最新的vsftp包.<br><br><br>&nbsp; tar -xvzf vsftp-****.tar.gz<br><br><br>&nbsp;cd vsftp0****<br><br>&nbsp;make<br>&nbsp;<br>&nbsp;make install<br>&nbsp;<br>&nbsp;cp vsftpd.conf&nbsp; /etc/vsftpd.conf<br></p>
&nbsp;创建/var/ftp目录.<br><br>&nbsp;groupadd ftp<br><br>&nbsp;useradd -g ftp&nbsp;-d /var/ftp ftp<br><br>&nbsp;<br><br>&nbsp;
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/45469.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2008-06-12 00:16 <a href="http://www.cnitblog.com/snfnvtk/archive/2008/06/12/45469.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gcc安装</title><link>http://www.cnitblog.com/snfnvtk/archive/2007/10/10/34616.html</link><dc:creator>network</dc:creator><author>network</author><pubDate>Tue, 09 Oct 2007 16:22:00 GMT</pubDate><guid>http://www.cnitblog.com/snfnvtk/archive/2007/10/10/34616.html</guid><wfw:comment>http://www.cnitblog.com/snfnvtk/comments/34616.html</wfw:comment><comments>http://www.cnitblog.com/snfnvtk/archive/2007/10/10/34616.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/snfnvtk/comments/commentRss/34616.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/snfnvtk/services/trackbacks/34616.html</trackback:ping><description><![CDATA[因为要以编译方式安装apache.所以先装gcc <br>步骤: <br>1.在cd2找到gcc-3.2.2-5.i386.rpm <br>cp gcc-3.2.2-5.i386.rpm /usr/local/gcc <br>在cd1找到下列文件.复制到/usr/local/gcc <br>binutils-xxx.rpm <br>cpp-xxx.rpm <br>glib-devel-xxx.rpm <br>在网上下载 <br>kernel-headers-xxx.rpm <br>安装： <br>cd /usr/local/gcc <br>rpm -ivh binutils-* <br>rpm -ivh cpp-* <br>rpm -ivh kernel-headers-* <br>rpm -ivh glibc-devel-* <br>rpm -ivh gcc-* 
<img src ="http://www.cnitblog.com/snfnvtk/aggbug/34616.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/snfnvtk/" target="_blank">network</a> 2007-10-10 00:22 <a href="http://www.cnitblog.com/snfnvtk/archive/2007/10/10/34616.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>