Skip to content

Commit 2efb991

Browse files
authored
Create almalinux9-controller.sh
1 parent c3f1231 commit 2efb991

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/almalinux9-controller.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
echo "start: $(date)" >> /root/setup.log
4+
hostnamectl set-hostname controller
5+
echo -e "[main]\ndns=none" > /etc/NetworkManager/conf.d/90-dns-none.conf
6+
systemctl reload NetworkManager
7+
rm -f /etc/resolv.conf
8+
echo "nameserver 127.0.0.1" > /etc/resolv.conf
9+
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
10+
chattr +i /etc/resolv.conf
11+
dnf -y install dnsmasq
12+
systemctl enable dnsmasq
13+
cat << EOF > /etc/dnsmasq.conf
14+
interface=lo0
15+
interface=eth0
16+
dhcp-range=11.12.13.100,11.12.13.150,255.255.255.0,512h
17+
dhcp-option=3
18+
EOF
19+
sed -i 's/^#\$ModLoad imudp/$ModLoad imudp/g' /etc/rsyslog.conf
20+
sed -i 's/^#\$UDPServerRun 514/$UDPServerRun 514/g' /etc/rsyslog.conf
21+
sed -i 's/^#\$ModLoad imtcp/$ModLoad imtcp/g' /etc/rsyslog.conf
22+
sed -i 's/^#\$InputTCPServerRun 514/$InputTCPServerRun 514/g' /etc/rsyslog.conf
23+
systemctl restart rsyslog
24+
firewall-cmd --permanent --add-service dhcp
25+
firewall-cmd --permanent --add-service dns
26+
firewall-cmd --permanent --add-service syslog
27+
firewall-cmd --reload
28+
systemctl start dnsmasq
29+
echo "end: $(date)" >> /root/setup.log

0 commit comments

Comments
 (0)