Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PXE automatically installs CentOS7

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

First, set up an unattended server to install software (PXE + DHCP+TFTP+ Kickstart+ FTP) IP:172.168.1.200

System version: CentOS Linux release 7.4.1708 (Core)

Close selinux,firewalld

[root@localhost] # axel-n 100 http://mirror.nsc.liu.se/centos-store/7.4.1708/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso

[root@localhost ~] # mount CentOS-7-x86_64-Minimal-1708.iso / media/

[root@localhost ~] # yum-y install vsftpd tftp tftp-server xinetd system-config-kickstart syslinux

Second, modify the configuration file

[root@localhost ~] # vim / etc/xinetd.d/tftp

Service tftp {socket_type = dgram protocol = udp wait = yes user = root server = / usr/sbin/in.tftpd server_args =-s / tftpboot # modify disable = no # modify per_source = 11 cps = 100 2 flags = IPv4}

[root@localhost ~] # cp/ usr/share/doc/dhcp-4.2.5/dhcpd.conf.example / etc/dhcp/dhcpd.conf

[root@localhost ~] # > / etc/dhcp/dhcpd.conf

[root@localhost ~] # vim / etc/dhcp/dhcpd.conf

Subnet 172.168.1.0 netmask 255.255.255.0 {range 172.168.1.100 172.168.1.199 option domain-name-servers 172.168.1.1 option domain-name "internal.example.org"; option routers 172.168.1.1 option broadcast-address 172.168.1.255mit.defaultmurf LeaseMutual time 600 makesleaseMAXMAXMAXEMAXEMAXEMAXMAXEMAXE 7200 ExtMutual server 172.168.1.200 sectional filename "pxelinux.0";} III, configure tftp to share files.

[root@localhost ~] # mkdir / tftpboot

[root@localhost ~] # mkdir / tftpboot/pxelinux.cfg

[root@localhost ~] # cp / usr/share/syslinux/pxelinux.0 / tftpboot/

[root@localhost ~] # cp / media/images/pxeboot/initrd.img / tftpboot/

[root@localhost ~] # cp / media/images/pxeboot/vmlinuz / tftpboot/

[root@localhost ~] # cp / media/isolinux/isolinux.cfg / tftpboot/pxelinux.cfg/default

Modify default, specify the way to install the operating system and the ks.cfg file path (modify the first line and 64 lines do not change) 1 default linux # the first line is changed to this way 64 append initrd=initrd.img inst.repo= ftp://172.168.1.200/pub inst.ks= ftp://172.168.1.200/ks.cfg # 64 lines are modified to configure the unattended package

[root@localhost yum.repos.d] # pwd

/ etc/yum.repos.d

[root@localhost yum.repos.d] # vim server.repo

[centos7] name=my-centos7baseurl= file:///var/ftp/pubenabled=1gpgcheck=0

[root@localhost ~] # cd / var/ftp/pub/

[root@localhost] # cp-r / media/*.

[root@localhost ~] # cp anaconda-ks.cfg / var/ftp/ks.cfg

[root@localhost ~] # egrep-v "^ # | ^ $" / var/ftp/ks.cfg

[root@localhost ~] # systemctl enable vsftpd xinetd dhcpd

[root@localhost ~] # systemctl restart vsftpd xinetd dhcpd

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report