#!/bin/bash uklid() { systemctl stop nfs-server systemctl stop vsftpd systemctl stop rpcbind.socket rpcbind.service rpc-statd.service #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 INTERFACE="enp6s0u1" if ! ip link show "$INTERFACE" &>/dev/null; then echo "'$INTERFACE' neexistuje." exit 1 fi 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 ethtool -K enp6s0u1 rx off tx off 2>/dev/null 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 --except-interface=lo --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 \ --dhcp-authoritative \ --enable-tftp --tftp-root=/srv/tftp \ --dhcp-boot=lpxelinux.0 \ --dhcp-option=209,archiso_pxe.cfg \ --dhcp-broadcast \ --dhcp-host=1c:86:0b:2f:de:17,192.168.1.109\ --dhcp-ignore-clid \ --dhcp-option=210,/