-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch-libvirt-IPTABLES-NFTABLES-UFW.sh
53 lines (44 loc) · 1.35 KB
/
patch-libvirt-IPTABLES-NFTABLES-UFW.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
echo "fix ufw after a reboot https://devtidbits.com/2019/07/31/ufw-service-not-loading-after-a-reboot/"
echo 'Fedora 34 users mostly for virsh and nftable support'
echo 'virsh net-autostart && virsh net-start replace and fix for fedora outdating "iptables" for nftables'
echo '*****REVIEW SCRIPT, SCRIPT WILL PAUSE FOR 5 SECONDS CRTL-C to review SCRIPT********'
sleep 5s
setenforce 0
sleep 1s
yum install libvirt-client -y
yum install network-scripts -y
yum install iptables-utils -y
yum install iptables-compat -y
yum install iptables-nft -y
yum install iptables-libs -y
rpm -e --nodeps iptables
rpm -e --nodeps firewalld
rpm -e --nodeps firewalld-filesystem
rpm -e --nodeps iptables-legacy-libs
rpm -e --nodeps iptables-legacy
yum install iptables-legacy-libs -y
yum install ufw -y
ldconfig
#echo 'recommended ufw'
# ufw enable
# ufw status verbose
# ufw delete 1
# ufw delete 1
# ufw default deny outgoing
# ufw default deny incoming
# ufw allow out 53
# ufw allow out 80
# ufw allow out 443
# echo 'IPV6=no' >> /etc/ufw/ufw.conf
# ufw disable
# ufw enable
# echo 'add your outgoing ports as ufw allow out "port"'
# ufw status verbose
systemctl restart libvirtd
virsh net-start default
virsh net-autostart default
set enforce 1
ausearch -c 'iptables' --raw | audit2allow -M my-iptables
semodule -X 300 -i my-iptables.pp
yum install NetworkManager-tui -y