#!/bin/bash uklid() { systemctl stop nfs-server systemctl stop vsftpd #iptables -t nat -D POSTROUTING -o enp10s0 -j MASQUERADE iptables -t nat -D POSTROUTING -s 192.168.1.104/29 -o enp10s0 -j MASQUERADE 2>/dev/null sysctl -w net.ipv4.ip_forward=0 > /dev/null sysctl -w net.ipv4.conf.all.arp_announce=0 sysctl -w net.ipv4.conf.all.arp_ignore=0 pkill dnsmasq ifconfig enp6s0u1 0.0.0.0 nmcli device set enp6s0u1 managed yes echo -e "\n--- PXE stop ---" exit 0 } trap uklid EXIT nmcli device set enp6s0u1 managed no ip addr flush dev enp6s0u1 ip addr add 192.168.1.110/29 brd 192.168.1.111 dev enp6s0u1 ip link set enp6s0u1 up sysctl -w net.ipv4.conf.all.arp_announce=2 sysctl -w net.ipv4.conf.all.arp_ignore=1 sysctl -w net.ipv4.ip_forward=1 iptables -t nat -A POSTROUTING -s 192.168.1.104/29 -o enp10s0 -j MASQUERADE systemctl start vsftpd systemctl start nfs-server dnsmasq --interface=enp6s0u1 --bind-interfaces --no-daemon \ --server=192.168.1.1 \ --dhcp-range=192.168.1.105,192.168.1.109,255.255.255.248,12h \ --dhcp-option=option:router,192.168.1.110 \ --dhcp-option=option:dns-server,192.168.1.110 \ --enable-tftp --tftp-root=/srv/tftp \ --dhcp-boot=lpxelinux.0 \ --dhcp-option=209,archiso_pxe.cfg \ --dhcp-option=210,/