A-A+

RHEL6 Kickstart无人值守安装(未完)

2015年11月25日 站长资讯 暂无评论

条件:两台虚拟机,一台作为测试环境,一台作为被安装客户端

FTP+TFTP+DHCP+KICKstart+PXE+NFS

一:配置yum源

1.挂载镜像

[root@localhost ~]# mount /dev/sr0 /mnt

mount: block device /dev/sr0 is write-protected, mounting read-only

2.编辑Yum源

  1. vi /etc/yum.repos.d/rhel-source.repo      
  2. [root@localhost ~]# more /etc/yum.repos.d/rhel-source.repo  
  3. [rhel-source]  
  4. name=Red Hat Enterprise Linux $releasever - $basearch - Source  
  5. baseurl=file:///mnt/Server  
  6. enabled=1  
  7. gpgcheck=1  
  8. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release  

3.导入gpgkey

[root@localhost ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[root@localhost ~]

第二:安装ftp

1,yum安装vsftpd包

yum -y install vsftpd

wKiom1L6NGPik5lSAAN2zTX26yc518.jpg

2.启动ftp服务服务

[root@localhost ~]# /etc/init.d/vsftpd start

为 vsftpd 启动 vsftpd:[确定]

3.设置为开机启动

[root@localhost ~]# chkconfig 查看vsftp是关闭的

[root@localhost ~]# chkconfig vsftpd on

[root@localhost ~]# chkconfig 查看vsftpd服务已经开启

三,安装TFTP

1,YUM安装TFTP包

  1. [root@localhost ~]# yum install tftp* –y  
  2. Loaded plugins: product-id, refresh-packagekit, subscription-manager  
  3. Updating Red Hat repositories.  
  4. Setting up Install Process  
  5. Resolving Dependencies  
  6. --> Running transaction check  
  7. ---> Package tftp.i686 0:0.49-5.1.el6 will be installed  
  8. ---> Package tftp-server.i686 0:0.49-5.1.el6 will be installed  
  9. --> Processing Dependency: xinetd for package: tftp-server-0.49-5.1.el6.i686   
  10. --> Running transaction check  
  11. ---> Package xinetd.i686 2:2.3.14-31.el6 will be installed  
  12. --> Finished Dependency Resolution  

2.修改配置文件

vi /etc/xinetd.d/tftp

wKioL1L6NtPTEOG7AAI7r_sBwOE229.jpg

利用set nu显示行数,修改13,14行保存

3.重启xinetd服务

[root@localhost ~]# /etc/init.d/xinetd restart

停止 xinetd:[失败]

正在启动 xinetd:[确定]

4,用chkconfig查看xinetd默认是开机启动的,因此不需要设置。查看端口侦听状态

root@localhost ~]# lsof -i:69

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

xinetd 2475 root 5u IPv4 19706 0t0 UDP *:tftp

四.安装dhcp

1.yum安装dhcp包

yum install dhcp -y

2,修改配置文件

  1. [root@localhost ~]# more /etc/dhcp/dhcpd.conf  
  2. #  
  3. # DHCP Server Configuration file.  
  4. #   see /usr/share/doc/dhcp*/dhcpd.conf.sample  
  5. #   see 'man 5 dhcpd.conf'  
  6. #  
  7. ddns-update-style interim;  
  8. ignore client-updates;  
  9.   
  10. subnet 192.168.2.0 netmask 255.255.255.0 {  
  11.   
  12. option routers     192.168.2.250;  
  13. option subnet-mask 255.255.255.0;  
  14.   
  15. filename "pxelinux.0";  
  16. next-server 192.168.2.21       
  17.   
  18. option domain-name-servers 192.168.2.250;  
  19.   
  20. range dynamic-bootp 192.168.2.1 192.168.2..200;  
  21.   
  22. default-lease-time 21600;  
  23. max-lease-time 43200;  
  24. }  

subnet是分配ip地址的网段,option routers是配置的默认网关ip,subnet-umask是子网掩码,

而next-server则是本机ip

3,启动dhcp并将其设置为开机启动

/etc/init.d/dhcpd start

正在启动 dhcpd:[成功]

[root@localhost ~]# chkconfig dhcpd on

现在就可以配置kickstart了。

标签:

给我留言