|
|
|
@ -20,6 +20,7 @@ yum install -y dhcp tftp tftp-server syslinux wget vsftpd pykickstart |
|
|
|
|
# 配置dhcp |
|
|
|
|
color Info "配置dhcp" |
|
|
|
|
ipaddr=$(ip -4 -f inet a show dev ens33 | awk '/inet/{print $2}') |
|
|
|
|
gateway=$(ip r show dev ens33 | awk '/default via/{print $3}') |
|
|
|
|
cat > /etc/dhcp/dhcpd.conf << EOF |
|
|
|
|
ddns-update-style interim; |
|
|
|
|
ignore client-updates; |
|
|
|
@ -32,9 +33,9 @@ allow unknown-clients; |
|
|
|
|
subnet ${ipaddr%.*}.0 netmask 255.255.255.0 |
|
|
|
|
{ |
|
|
|
|
range ${ipaddr%.*}.100 ${ipaddr%.*}.200; |
|
|
|
|
option domain-name-servers ${ipaddr%.*}.1; |
|
|
|
|
option domain-name-servers ${gateway}; |
|
|
|
|
option domain-name "server1.example.com"; |
|
|
|
|
option routers ${ipaddr%.*}.1; |
|
|
|
|
option routers ${gateway}; |
|
|
|
|
option broadcast-address ${ipaddr%.*}.255; |
|
|
|
|
default-lease-time 600; |
|
|
|
|
max-lease-time 7200; |
|
|
|
@ -117,7 +118,13 @@ cat > /var/ftp/pub/ks.cfg <<EOF |
|
|
|
|
%end |
|
|
|
|
|
|
|
|
|
%post |
|
|
|
|
# curl -s -L https://download.beyourself.org.cn/shell-project/os/get-os-init.sh | sh |
|
|
|
|
sed -i 's/#UseDNS.*/UseDNS=no/g' /etc/ssh/sshd_config |
|
|
|
|
#curl -s -L https://download.beyourself.org.cn/shell-project/os/get-os-init.sh | sh |
|
|
|
|
#yum install -y python3 python3-devel gcc |
|
|
|
|
#curl -s -L https://download.beyourself.org.cn/python-project/os/jumpserver-register.py -o /opt/jumpserver-register.py |
|
|
|
|
#pip3 install requests httpsig -i https://mirrors.aliyun.com/pypi/simple |
|
|
|
|
#python3 /opt/jumpserver-register.py `ip -4 -f inet a show dev ens33 | awk '/inet/{print $2}' | cut -d'/' -f 1` 192.168.96.180 47849e56-81b5-4fe6-a7d4-7d7578abfc32 ab17fa93-8f4f-4547-802f-be81a6197937 d6638212-8896-4596-9b30-ec0e5aa5905c 9ead5ec2-ba29-4b0a-b4d1-75657eec4306 |
|
|
|
|
|
|
|
|
|
%end |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|