<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[刘佳的技术日志、博客]]></title> 
<link>http://www.52zhe.cn/index.php</link> 
<description><![CDATA[技术的事，喜欢就研究。]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[刘佳的技术日志、博客]]></copyright>
<item>
<link>http://www.52zhe.cn/read.php/.htm</link>
<title><![CDATA[RHCE环境创建、简单架设dhcpd、tftp，客户端实现网络启动]]></title> 
<author>kook &lt;admin@yourname.com&gt;</author>
<category><![CDATA[RHCE]]></category>
<pubDate>Thu, 11 Oct 2007 12:28:41 +0000</pubDate> 
<guid>http://www.52zhe.cn/read.php/.htm</guid> 
<description>
<![CDATA[ 
	RHCE环境创建、简单架设dhcpd、tftp，客户端实现网络启动<br/>1:架设dhcpd服务<br/>安装略<br/>查看/etc/dhcpd.conf配置文件内容<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>ddns-update-style interim;<br/>ignore client-updates;<br/><span style="color: #FF0000;"><br/>allow booting;<br/>filename "pxelinux.0";<br/></span><br/>subnet 192.168.0.0 netmask 255.255.255.0 &#123;<br/><br/># --- default gateway<br/> &nbsp; &nbsp; &nbsp; &nbsp;option routers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.0.254;<br/> &nbsp; &nbsp; &nbsp; &nbsp;option subnet-mask &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;255.255.255.0;<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;option nis-domain &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "domain.org";<br/> &nbsp; &nbsp; &nbsp; &nbsp;option domain-name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"domain.org";<br/> &nbsp; &nbsp; &nbsp; &nbsp;option domain-name-servers &nbsp; &nbsp; &nbsp;192.168.1.1;<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;option time-offset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-18000; # Eastern Standard Time<br/># &nbsp; &nbsp; &nbsp; option ntp-servers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;192.168.1.1;<br/># &nbsp; &nbsp; &nbsp; option netbios-name-servers &nbsp; &nbsp; 192.168.1.1;<br/># --- Selects point-to-point node (default is hybrid). Don't change this unless<br/># -- you understand Netbios very well<br/># &nbsp; &nbsp; &nbsp; option netbios-node-type 2;<br/><br/># &nbsp; &nbsp; &nbsp; range dynamic-bootp 192.168.0.128 192.168.0.254;<br/> &nbsp; &nbsp; &nbsp; &nbsp;default-lease-time 21600;<br/> &nbsp; &nbsp; &nbsp; &nbsp;max-lease-time 43200;<br/><br/> &nbsp; &nbsp; &nbsp; &nbsp;# we want the nameserver to appear at a fixed address<br/> &nbsp; &nbsp; &nbsp; &nbsp;host ns &#123;<br/><span style="color: #FF0000;"><br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next-server 192.168.0.254;<br/></span><br/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hardware ethernet 12:34:56:78:AB:CD;<br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fixed-address 192.168.0.100;<br/> &nbsp; &nbsp; &nbsp; &nbsp;&#125;<br/>&#125;<br/></div></div><br/><br/>2:tftp服务配置<br/>安装略<br/>修改配置文件<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>[root@rhce ~]# cat /etc/xinetd.d/tftp<br/># default: off<br/># description: The tftp server serves files using the trivial file transfer &#92;<br/># &nbsp; &nbsp; &nbsp; protocol. &nbsp;The tftp protocol is often used to boot diskless &#92;<br/># &nbsp; &nbsp; &nbsp; workstations, download configuration files to network-aware printers, &#92;<br/># &nbsp; &nbsp; &nbsp; and to start the installation process for some operating systems.<br/>service tftp<br/>&#123;<br/><span style="color: #FF0000;"> &nbsp; &nbsp; &nbsp; &nbsp;disable&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= no</span><br/> &nbsp; &nbsp; &nbsp; &nbsp;socket_type &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = dgram<br/> &nbsp; &nbsp; &nbsp; &nbsp;protocol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= udp<br/> &nbsp; &nbsp; &nbsp; &nbsp;wait &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= yes<br/> &nbsp; &nbsp; &nbsp; &nbsp;user &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= root<br/> &nbsp; &nbsp; &nbsp; &nbsp;server &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= /usr/sbin/in.tftpd<br/> &nbsp; &nbsp; &nbsp; &nbsp;server_args &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = -s /tftpboot<br/> &nbsp; &nbsp; &nbsp; &nbsp;per_source &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= 11<br/> &nbsp; &nbsp; &nbsp; &nbsp;cps &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 100 2<br/> &nbsp; &nbsp; &nbsp; &nbsp;flags &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = IPv4<br/>&#125;<br/></div></div><br/><br/>配置目录/tftpboot目录下的文件解析，pxelinux.0来源自syslinux,在tftpboot下面的默认位置目录文件<br/>pxelinux.cfg/default,文件来自光盘CD中的isolinux目录。default来自isolinux.cfg。<br/><div class="code"><br/>&#91;root@rhce tftpboot&#93;# locate pxelinux.0<br/>/usr/lib/syslinux/pxelinux.0<br/>&#91;root@rhce tftpboot&#93;# cp /usr/lib/syslinux/pxelinux.0 &nbsp;/tftpboot/<br/>&#91;root@rhce tftpboot&#93;# cp &nbsp;/misc/cd/isolinux/* /tftpboot/<br/>&#91;root@rhce tftpboot&#93;# mkdir pxelinux.cfg<br/>&#91;root@rhce tftpboot&#93;# cp isolinux.cfg pxelinux.cfg/default<br/>&#91;root@rhce ~&#93;# tree -C /tftpboot/<br/>/tftpboot/<br/>&#124;-- TRANS.TBL<br/>&#124;-- boot.cat<br/>&#124;-- boot.msg<br/>&#124;-- general.msg<br/>&#124;-- initrd.img<br/>&#124;-- isolinux.bin<br/>&#124;-- isolinux.cfg<br/>&#124;-- memtest<br/>&#124;-- options.msg<br/>&#124;-- param.msg<br/>&#124;-- pxelinux.0<br/>&#124;-- pxelinux.cfg<br/>&#124; &nbsp; `-- default<br/>&#124;-- rescue.msg<br/>&#124;-- splash.lss<br/>`-- vmlinuz<br/><br/>1 directory, 15 files<br/>&#91;root@rhce tftpboot&#93;# cat pxelinux.cfg/default<br/>default linux<br/>prompt 1<br/>timeout 600<br/>display boot.msg<br/>F1 boot.msg<br/>F2 options.msg<br/>F3 general.msg<br/>F4 param.msg<br/>F5 rescue.msg<br/>label linux<br/> &nbsp;kernel vmlinuz<br/> &nbsp;append initrd=initrd.img<br/>label text<br/> &nbsp;kernel vmlinuz<br/> &nbsp;append initrd=initrd.img text<br/>label ks<br/> &nbsp;kernel vmlinuz<br/> &nbsp;append ks initrd=initrd.img<br/>label local<br/> &nbsp;localboot 1<br/>label memtest86<br/> &nbsp;kernel memtest<br/> &nbsp;append -<br/></div><br/><br/>三：iptables的部分设置<br/>从netstat获取xinetd的端口，或者/etc/services里面获取的<br/>开放xinetd的端口69访问<br/><div class="code"><br/>&#91;root@rhce ~&#93;# netstat -nap &#124; grep xinetd<br/>udp &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 0.0.0.0:69 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0.0.0.0:* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1682/xinetd<br/>unix &nbsp;2 &nbsp; &nbsp; &nbsp;&#91; &#93; &nbsp; &nbsp; &nbsp; &nbsp; DGRAM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4524 &nbsp; 1682/xinetd<br/>&#91;root@rhce ~&#93;# cat /etc/services &#124; grep tftp<br/>tftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;69/tcp<br/>tftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;69/udp<br/>tftp-mcast &nbsp; &nbsp; &nbsp;1758/tcp<br/>tftp-mcast &nbsp; &nbsp; &nbsp;1758/udp<br/>mtftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1759/udp<br/>subntbcst_tftp &nbsp;247/tcp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # SUBNTBCST_TFTP<br/>subntbcst_tftp &nbsp;247/udp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # SUBNTBCST_TFTP<br/>etftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1818/tcp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Enhanced Trivial File Transfer Protocol<br/>etftp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1818/udp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Enhanced Trivial File Transfer Protocol<br/>tftps &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3713/tcp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# TFTP over TLS<br/>tftps &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3713/udp &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# TFTP over TLS<br/>&#91;root@rhce ~&#93;# cat /etc/sysconfig/iptables<br/># Firewall configuration written by system-config-securitylevel<br/># Manual customization of this file is not recommended.<br/>*filter<br/>:INPUT ACCEPT &#91;0:0&#93;<br/>:FORWARD ACCEPT &#91;0:0&#93;<br/>:OUTPUT ACCEPT &#91;0:0&#93;<br/>:RH-Firewall-1-INPUT - &#91;0:0&#93;<br/>-A INPUT -j RH-Firewall-1-INPUT<br/>-A FORWARD -j RH-Firewall-1-INPUT<br/>-A RH-Firewall-1-INPUT -i lo -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p 50 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p 51 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT<br/>-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited<br/>COMMIT<br/></div><br/><br/>四:重启服务、添加服务,开机自启动。<br/><div class="code"><br/>&#91;root@rhce ~&#93;# /etc/init.d/dhcpd restart<br/>关闭 dhcpd： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#91;确定&#93;<br/>启动 dhcpd： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#91;确定&#93;<br/>&#91;root@rhce ~&#93;# /etc/init.d/xinetd restart<br/>停止 xinetd： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#91;确定&#93;<br/>启动 xinetd： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#91;确定&#93;<br/>&#91;root@rhce ~&#93;# /etc/init.d/iptables restart<br/>清除防火墙规则： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#91;确定&#93;<br/>把 chains 设置为 ACCEPT 策略：filter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#91;确定&#93;<br/>正在卸载 Iiptables 模块： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#91;确定&#93;<br/>应用 iptables 防火墙规则： &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#91;确定&#93;<br/>载入额外 iptables 模块：ip_conntrack_netbios_ns ip_conntrac&#91;确定&#93;<br/>&#91;root@rhce ~&#93;# chkconfig dhcpd on<br/>&#91;root@rhce ~&#93;# chkconfig xinetd on<br/>&#91;root@rhce ~&#93;# chkconfig iptables on<br/>&#91;root@rhce ~&#93;# chkconfig tftp on<br/></div>
]]>
</description>
</item><item>
<link>http://www.52zhe.cn/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] RHCE环境创建、简单架设dhcpd、tftp，客户端实现网络启动]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.52zhe.cn/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>