Knowledge points to 13

Network installation and cobbler linux system

NIC boot (PXE NIC) (built-dhcp client -> tftp client)

TFTP (UDP69 port) built-in network card. (TFTP, telnet protocol is non-independent services, relying on xinetd, systemd to activate) (tftp tftp-server client server)

TFTP only five executable commands: rrq wrq data ack error

PXE works:

 

 1, client sends a request to the dhcp ip address on the pxe server, dhcp client detects whether legitimate (mostly detect client network card mac address), if legitimate client ip address is returned, and will start the file transfer location information of pxelinux.0 to client

2, client sends a request message to the TFTP acquired pxelinux.0 on pxe server, TFTP client after receiving the message again sent pxelinux.o size information, to test whether clent satisfied, when the size of the consent received TFTP client information sent back after the official document sent to the client pxelinux.0

3, client executes the received file pxelinux.0

4, client transmits to TFTP server configuration file for the machine (in the TFTP pxelinux.cfg directory service), the profile back TFTP client, then performing subsequent operations according to the client profile

5, Client sending a request to the linux kernel TFTP, TFTP kernel after receiving the message sent to the client

After 6, client transmits a request to the TFTP root file system information, TFTP received return message linux root file system

7, client download and install the source file, read the automated installation scripts.

TFTP configuration file

 

TFTP shared directory

 

 Set boot. .

 

 

(List of startup options by selecting the CD-ROM isolinux.cfg (start menu) directory, and then load the kernel and virtual file system, the kernel (kernel comes with) and then start anaconda, read the ks.cfg file)

配置dhcp服务指向下载pxelinux.0(bootloader446字节)的地址:tftp服务端的路径

next-server ******;

filename "pxelinux.0";(bootloader) (syslinux包提供)     (locate .....  ;  updatedb)

拷贝菜单风格menu.c32(syslinux包提供)

服务端安装tftp-server:文件路径/var/lib/tftpboot

必要文件:

 

以光盘中isolinux.cfg为基础制作菜单并重命名为default

在写入内核文件及虚拟文件系统时注意路径

 

^后的字母为快捷键

 

菜单项

 

两个系统均可安装:

 

菜单项default 文件内容:

 

 

Cobbler安装:(6或7   内存分配大小1.5G以上,否则安装错误)

(首先确保安装httpd、tftp、cobbler、dhcpd)

systemctl start httpd    、tftp、cobblerd、dhcpd

执行cobbler check 后会出现如下图:

 

1、修改server,引导cobber服务器的其他主机可访问的ip(本机ip)

 

2、修改next server,引导tftp服务器,去下载pxelinux.0(bootloader)(本机ip)

 

3、开启tftp服务

systemctl start tftp

4、下载启动管理(pxelinux.0(bootloader)和menu.c32(菜单格式))

联网:cobbler get-loaders

未联网:cp  /usr/share/syslinux/{pxelinux.0,menu.c32}   /var/lib/tftpboot

获取(pxelinux.0和menu.c32)

5、开启rsyncd服务(无关紧要,可不启动)

systemctl start rsyncd

6、debian的镜像(可忽略)

7、修改cobbler口令,默认为cobbler

使用openssl passwd -1生成口令

 

8、重启cobblerd服务

systemctl start cobblerd

 

9、在/etc/cobbler/settings中修改manage_dhcp改为1,然后修改模板(/etc/cobbler/dhcp.template),自动配置DHCP配置文件配置DHCP(与cobbler相关联的,而非本机的)

 

cobbler sync   通过cobbler软件同步dhcpd配置到本机dhcp设置

10、重启dhcpd服务  systemctl restart dhcpd

11、导入创建yum源

 

cobbler import --path=/cd7  --name=centos7.6-86_64  --arch=x86_64(cpu架构,默认为x86_64)

cobbler distro/profile list(导入安装包后自动生成一对   包和ks文件)

12、准备ks文件

cp ks.cfg /var/lib/cobbler/kickstarts/   将ks文件放入相关目录

vim /var/lib/cobbler/kickstarts/ks.cfg       将url  --url=$tree

cobbler profile add --name Centos7.6-x86_64pro  --distro=Centos7.6-x86_64  --kickstart=/var/lib/cobbler/kickstarts/ks.cfg(需要写绝对路径)

 

13、开始为电脑安装系统。

 

复制安装光盘,cobbler在pex***.cfg/default文件中

自动生成对应菜单项

 

ks应答文件中的yum源的配置

 

yum源:

 

菜单选项:

 

增加自制ks文件:(绝对路径)

 

删除无用菜单:

 

 

 

基于web的cobbler:(基于httpd、dhcpd、tftp服务)

/etc/cobbler/settings:cobbler主要配置文件

default _password_crypted:加密登录口令

manage_dhcp:1

manage_tftpd:1

pxe_just_once:1

nest_server:<tftp服务器的IP地址>

server:<cobbler服务器的IP地址>

cobbler check命令:cobbler环境检查

下载启动管理(pxelinux.0(bootloader)和menu.c32(菜单格式))

联网:cobbler get-loaders 

不联网:cp   /usr/share/syslinux/{pxelinux.0,menu.c32}   /var/lib/tftpboot

管理distro(符合cobbler格式的安装包)

cobbler import --name=centos-7.5-x86_64 --path=/media/cdrom --arch=x86_64

管理profile(菜单label)

cobbler profile add --name=centos-7.5 --disrto=centos-7.5-x86_64 --kickstart=/var/lib/cobbler/kickstarts/centos_x86_64.cfg

查看profiles

cobbler profile list

查看引导文件

cat /var/lib/tftpboot/pxelinux.cfg/default

同步cobbler配置

cobble sync

 

cobbler-web:

sohu源和其他源配合使用安装cobbler-web;要求python1.6.**

执行systemctl restart httpd

authn_configfile验证***user.digst

增加cobbler管理用户

 

authn_pam验证

***users.conf

使用linux本机账户登录

 

 

Guess you like

Origin www.cnblogs.com/FightMG/p/11334199.html