don't dream your life, live your dreams !
Contents
Edit file /etc/sysconfig/network-scripts/ifcfg-ens33:
| DEVICE=ens33 BOOTPROTO=none BROADCAST=192.168.0.255 HWADDR=00:0A:BC:DE:FF:1E IPADDR=192.168.0.16 NETMASK=255.255.255.0 ONBOOT=yes GATEWAY=192.168.0.1 TYPE=Ethernet IPV6INIT=no DNS1=192.168.0.2 DNS2=192.168.0.3 DOMAIN=my-domain.local | 
In the file /etc/resolv.conf you will see these lines:
| search my-domain.local nameserver 192.168.0.2 nameserver 192.168.0.3 | 
#!/bin/bash
# get current device (i.e. ens33)
currentDevice=`nmcli d | grep connected | awk '{split($1,a,"\t"); print a[1]}'`
echo "start manually device $currentDevice"
ifup $currentDevice
echo "edit /etc/sysconfig/network-scripts/ifcfg-$currentDevice and set ONBOOT=yes"
sed -i "s/^\(ONBOOT=\).*$/\1yes/g" /etc/sysconfig/network-scripts/ifcfg-$currentDevice
Edit /etc/udev/rules.d/70-persistent-net.rules
And update the MAC adress:
| # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0A:BC:DE:FF:1E", ATTR{type}=="1", KERNEL=="eth*", NAME="ens33" | 
| ip route show | 
#!/bin/bash
echo "get release rpm from fedora"
yum -y install epel-release
#echo "enable Red Hat Software Collections (SCL) repository"
#yum -y install centos-release-scl
echo "clean all and update"
yum clean all
yum -y install deltarpm
yum -y update
#!/bin/bash
echo "install firewalld"
yum -y install firewalld
echo "activate firewalld at startup"
systemctl enable firewalld.service
echo "start service"
systemctl start firewalld.service
#!/bin/bash
echo "install ntp"
yum -y install ntp
echo "activate ntp on boot"
systemctl enable ntpd.service
echo "start ntp service"
systemctl start ntpd.service
Edit the file : /etc/selinux/config and set SELINUX to disabled like this:
#!/bin/bash
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
echo "disable selinux temporary (without reboot)"
setenforce 0
Note: changes will take effect after reboot.
#!/bin/bash
echo "install ifconfig"
yum -y install net-tools
echo "install locate"
yum -y install mlocate
updatedb
echo "install wget"
yum -y install wget
echo "install dos2unix"
yum -y install dos2unix
echo "install telnet client"
yum -y install telnet
echo "install zip tools"
yum -y install zip unzip
#!/bin/bash
## Package Manager
echo "install yum-cron"
yum -y install yum-cron
echo "activate yum-cron at startup"
systemctl enable yum-cron.service
echo "start service"
systemctl start yum-cron.service
#!/bin/bash
echo "install nrpe"
yum -y install nrpe nagios-plugins-all
echo "start nrpe on boot"
systemctl enable nrpe.service
echo "add service nrpe (port 5666) to firewall"
firewall-cmd --permanent --zone=public --add-port=5666/tcp
echo "sudoers configuration (deal with issue 'NRPE: Unable to read output')"
chmod 755 /etc/sudoers
sed -i "s/^\(Defaults\s*requiretty\)/#\1/" /etc/sudoers
chmod 0440 /etc/sudoers
echo "allow every one to connect to nrpe"
sed -i "s/^\(allowed_hosts\)/#\1/" /etc/nagios/nrpe.cfg
echo "start nrpe"
systemctl start nrpe.service
  Copyright © 2025 My linux world - by Marc RABAHI  
  Design by Marc RABAHI and encelades.
  
  admin