0

I created a virtual machine via qemu/kvm on my machine.

The NIC name of this virtual machine is virbr0, and it is managed by the libvirt area of the firewall:

$ sudo firewall-cmd --zone=libvirt --list-all
libvirt (active)
  target: ACCEPT
  icmp-block-inversion: no
  interfaces: virbr0
  sources: 
  services: dhcp dhcpv6 dns ssh tftp
  ports: 
  protocols: icmp ipv6-icmp
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 
        rule priority="32767" reject

Since there is no network security problem, I want to directly make the firewall open all host ports to the virtual machine.

what should I do?

1 Answer 1

0

In fact, just add tcp and udp to protocols.

$ alias f-c-p="sudo firewall-cmd --permanent --zone=libvirt"
$ f-c-p --add-protocols tcp
$ f-c-p --add-protocols udp
$ sudo firewall-cmd --reload

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.