Code: Select all
# Generated by iptables-save v1.6.1 on Tue Jun 16 11:48:26 2020
*nat
:PREROUTING ACCEPT [161:11068]
:INPUT ACCEPT [154:9783]
:OUTPUT ACCEPT [91:5893]
:POSTROUTING ACCEPT [91:5893]
-A POSTROUTING -s 192.168.122.0/24 -d 224.0.0.0/24 -j RETURN
-A POSTROUTING -s 192.168.122.0/24 -d 255.255.255.255/32 -j RETURN
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p tcp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -p udp -j MASQUERADE --to-ports 1024-65535
-A POSTROUTING -s 192.168.122.0/24 ! -d 192.168.122.0/24 -j MASQUERADE
COMMIT
# Completed on Tue Jun 16 11:48:26 2020
# Generated by iptables-save v1.6.1 on Tue Jun 16 11:48:26 2020
*mangle
:PREROUTING ACCEPT [40574:26336022]
:INPUT ACCEPT [40522:26320930]
:FORWARD ACCEPT [49:14063]
:OUTPUT ACCEPT [30165:58477299]
:POSTROUTING ACCEPT [30214:58491362]
-A POSTROUTING -o virbr0 -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
COMMIT
# Completed on Tue Jun 16 11:48:26 2020
# Generated by iptables-save v1.6.1 on Tue Jun 16 11:48:26 2020
*raw
:PREROUTING ACCEPT [70452:57894427]
:OUTPUT ACCEPT [59720:89718199]
COMMIT
# Completed on Tue Jun 16 11:48:26 2020
# Generated by iptables-save v1.6.1 on Tue Jun 16 11:48:26 2020
*filter
:INPUT ACCEPT [40558:26344256]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [30211:58501425]
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT
-A FORWARD -d 192.168.122.0/24 -o virbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -s 192.168.122.0/24 -i virbr0 -j ACCEPT
-A FORWARD -i virbr0 -o virbr0 -j ACCEPT
-A FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
-A FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -o virbr0 -p udp -m udp --dport 68 -j ACCEPT
COMMIT
# Completed on Tue Jun 16 11:48:26 2020
libvirt also supports other network modes (https://wiki.libvirt.org/page/VirtualNetworking). Would any of those be better?