#!/bin/bash ###################################################################### # 0、 Centos 6.6 x86_64 # 设置服务器IP地址为192.168.11.250 # 确保该网络中无DHCP服务 # 且192.168.11.100 - 200 无机器使用 ###################################################################### # 1、配置yum源,安装TFTP、FTP、DHCP服务 ###################################################################### #!/bin/bash mkdir /mnt/cdromxxx umount /dev/sr0 mount /dev/sr0 /mnt/cdromxxx mkdir /etc/yum.repos.d/bak mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/ echo '[local] name=local baseurl=file:///mnt/cdromxxx gpgcheck=0 enabled=1 '>/etc/yum.repos.d/local.repo yum install dhcp tftp-server vsftpd syslinux -y rm -rf /etc/yum.repos.d/local.repo mv /etc/yum.repos.d/bak/* /etc/yum.repos.d/ rm -rf /etc/yum.repos.d/bak umount /dev/sr0 rm -rf /mnt/cdromxxx ###################################################################### # 2、配置DHCP服务 ###################################################################### #!/bin/bash echo 'ddns-update-style interim; ignore client-updates; option space PXE; option PXE.mtftp-ip code 1 = ip-address; option PXE.mtftp-cport code 2 = unsigned integer 16; option PXE.mtftp-sport code 3 = unsigned integer 16; option PXE.mtftp-tmout code 4 = unsigned integer 8; option PXE.mtftp-delay code 5 = unsigned integer 8; option arch code 93 = unsigned integer 16; class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 192.168.11.250; if option arch = 00:02 { filename "ia64/elilo.efi"; } else { filename "legacy/pxelinux.0"; } } #next-server 192.168.11.250; #指定TFTP服务器的地址 #filename "legacy/pxelinux.0"; #指定PXE引导程序的文件名 subnet 192.168.11.0 netmask 255.255.255.0 { option routers 192.168.11.1; option subnet-mask 255.255.255.0; range 192.168.11.100 192.168.11.200; option broadcast-address 192.168.11.255; } '>/etc/dhcp/dhcpd.conf /etc/init.d/dhcpd restart chkconfig dhcpd on ###################################################################### # 3、配置FTP服务 ###################################################################### mkdir /var/ftp/pub/isoxxx mount /dev/sr0 /var/ftp/pub/isoxxx echo 'mount /dev/sr0 /var/ftp/pub/isoxxx'>>/etc/rc.local echo '#platform=x86, AMD64, 或 Intel EM64T #version=DEVEL # Firewall configuration firewall --enabled --ssh # Install OS instead of upgrade install # Use network installation url --url="ftp://192.168.11.250/pub/isoxxx" # Root password rootpw --iscrypted $1$2B0mua0h$2VLnGqw4bvQpvEHuBhObP. # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --permissive # Do not configure the X Window System skipx # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone --isUtc Asia/Shanghai # System bootloader configuration bootloader --location=mbr # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all # Disk partitioning information part / --fstype="ext4" --grow --size=1 %packages @base @console-internet @core @debugging @directory-client @hardware-monitoring @java-platform @large-systems @network-file-system-client @performance @perl-runtime @server-platform @server-policy @workstation-policy pax oddjob sgpio device-mapper-persistent-data samba-winbind certmonger pam_krb5 krb5-workstation perl-DBD-SQLite %end %pre %end %post %end '>/var/ftp/pub/ks.cfg /etc/init.d/vsftpd restart chkconfig vsftpd on ###################################################################### # 4、配置TFTP服务 ###################################################################### sed -i '8 s/^/ disable=no\n/' /etc/xinetd.d/tftp mkdir /var/lib/tftpboot/legacy cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/legacy cp /var/ftp/pub/isoxxx/p_w_picpaths/pxeboot/{initrd.img,vmlinuz} /var/lib/tftpboot/legacy cp /var/ftp/pub/isoxxx/isolinux/{boot.msg,vesamenu.c32} /var/lib/tftpboot/legacy mkdir /var/lib/tftpboot/legacy/pxelinux.cfg echo 'default linux prompt 1 timeout 5 display boot.msg F1 boot.msg F2 options.msg F3 general.msg F4 param.msg F5 rescue.msg label linux kernel vmlinuz append ks=ftp://192.168.11.250/pub/ks.cfg initrd=initrd.img ksdevice=eth0 '>/var/lib/tftpboot/legacy/pxelinux.cfg/default /etc/init.d/xinetd restart chkconfig tftp on chkconfig xinetd on ###################################################################### # 5、更改系统安全设置 ###################################################################### setenforce 0 echo '# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=permissive # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted'>/etc/sysconfig/selinux /etc/init.d/iptables stop chkconfig iptables off
PXE安装Centos 6.6 x86-64 basic server
原创
©著作权归作者所有:来自51CTO博客作者www1707的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Linux平台x86_64|aarch64架构如何实现轻量级RTSP服务
技术背景我们在做Linux平台x86_64架构或aarch64架构的推送模块的时候,有公司提出这样的技术需求,希望在Linux平台,实现轻量级RTSP服务,实现对摄像头或屏幕对外RTSP拉流,同步到大屏上去。技术实现废话不多说,直接上代码,先调用start_rtsp_server()指定端口号,启动RTSP服务。LogInit(); NT_SmartPublisherSDKAPI push_a
linux x86 rtsp linux arm64 rtsp linux arm64 rtsp服务器 linux arm64 rtsp 大牛直播SDK -
关于CentOS-6.6-x86_64-bin-DVD安装vsftp问题
centos配置vsftp服务器缺少插件
服务器 虚拟机 file 配置文件