网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

pxe自动值守脚本-创新互联

是基于VMware虚拟机上安装实验的!

成都创新互联公司服务项目包括洮南网站建设、洮南网站制作、洮南网页制作以及洮南网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,洮南网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到洮南省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

#!/bin/bash
#修改IP地址            
#sed -i 's/dhcp/static/' /etc/sysconfig/network-scripts/ifcfg-ens32
#echo "
#IPADDR=192.168.100.100
#NETMASK=255.255.255.0" >> /etc/sysconfig/network-scripts/ifcfg-ens32
#systemctl restart network

#配置本地yum
#mount /dev/cdrom /mnt
#mkdir /etc/yum.repos.d/bak && mv /etc/yum.repos.d/C* /etc/yum.repos.d/bak
#echo "
#[base]
#name=base
#baseurl=file:///mnt
#gpgcheck=0
#enabled=1" >> /etc/yum.repos.d/base.repo
#yum clean all && yum list

#安装dhcp,配置dhcp配置文件
[ ! -e /etc/dhcp/dhcpd.conf ] && echo "没有安装DHCP服务,现在安装!"; yum -y install dhcp  
echo  " subnet 192.168.220.0 netmask 255.255.255.0 {
        range 192.168.220.10 192.168.220.20;
        option routers 192.168.220.115;
#        option domain-name-servers 114.114.114.114;
        next-server 192.168.220.115;
        filename \"pxelinux.0\" ;
        }" > /etc/dhcp/dhcpd.conf

#安装tftp和修改配置文件
[ ! -e /etc/xinetd.d/tftp ] && echo "没有安装TFTP,现在安装!";yum -y install tftp-server
sed -i '/disable/s/yes/no/' /etc/xinetd.d/tftp

#安装syslinux
[ ! -e /usr/share/syslinux/pxelinux.0 ] && yum -y install syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

#安装ftp
[ ! -e /etc/vsftpd/vsftpd.conf ] && yum -y install vsftpd
mkdir /var/ftp/centos7
#umount /mnt && mount /dev/cdrom /var/ftp/centos7/
mount /dev/cdrom /var/ftp/centos7/
cp /var/ftp/centos7/images/pxeboot/vmlinuz /var/lib/tftpboot/
cp /var/ftp/centos7/images/pxeboot/initrd.img /var/lib/tftpboot/

echo "
#platform=x86, AMD64, 或 Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --plaintext 123
# System language
lang zh_CN
# Firewall configuration
firewall --disabled
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
firstboot --disable
# SELinux configuration
selinux --disabled

# Network information
network  --bootproto=dhcp --device=ens32
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all
# Disk partitioning information
part /boot --fstype="xfs" --size=500
part /home --fstype="xfs" --size=2048
part swap --fstype="swap" --size=2048
part / --fstype="xfs" --grow --size=1

%packages
@^gnome-desktop-environment
@base
@core
@desktop-debugging
@dial-up
@directory-client
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@java-platform
@multimedia
@network-file-system-client
@networkmanager-submodules
@print-client
@x11
chrony
kexec-tools

%end " > /var/ftp/ks.cfg

#配置编辑default启动菜单
mkdir /var/lib/tftpboot/pxelinux.cfg
echo "
default auto
prompt 1

label auto
  kernel vmlinuz
  append initrd=initrd.img method=ftp://192.168.220.115/centos7 ks=ftp://192.168.220.115/ks.cfg

label linux text
  kernel vmlinuz
  append text initrd=initrd.img method=ftp://192.168.220.115/centos7

label linux rescue
  kernel vmlinuz
  append rescue initrd=initrd.img method=ftp://192.168.220.115/centos7
" > /var/lib/tftpboot/pxelinux.cfg/default

setenforce 0
systemctl stop firewalld
systemctl start tftp
systemctl start dhcpd
systemctl start vsftpd

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


本文名称:pxe自动值守脚本-创新互联
分享地址:http://bjjierui.cn/article/dcidpo.html

其他资讯