No internet acess from KVM VM

I am not getting Internet access from my virtual machine?

When I start a VM I do see virbr0 is up, however when I open a browser from the VM, there is no Internet access?

I can however ping my local host and that seems to be working.

virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 52:54:00:7c:ee:4e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever

Same exact problem since one week or more.

ran a zypper dup earlier today to see if this could be fixed by itself magically, no luck.

Also, i did set iptables in /etc/libvirt/network.conf, no difference.

I create another nat interface, no luck.
Deleted the default interface and recreated, no luck.

1 Like

Is IP forwarding enabled?

cat /proc/sys/net/ipv4/ip_forward

@bamje I pretty much tired the solution you listed, also no luck!

@jsulig seem like it is, if 1 = yes

$ cat /proc/sys/net/ipv4/ip_forward
1

I found this post

1 Like

OK I got things working!

@jsulig thanks for the link to the issues! I tired this earlier but it didn’t work. I made the mistake of uncommenting the line in the file “/etc/libvirt/network.conf” rather than change it to “iptables”.

Here are my steps I used to get things working.

I install “Wicked Service” from yast → software management

After I opened Network settings: yast → network setting
From the “Global Options” page made sure to select “Wicked Service”
After this I edit “/etc/libvirt/network.conf” and uncommented

firewall_backend = "nfptables"

Note I am using “nfptables” and not “iptables”, not sure if by installing “Wicked Services” this is the reason it’s now working.

The network is working again in KVM.

1 Like

I too have changed from iptables to nfptables and the virbr0 interface is UP now.
also vnet interfaces appeared.

So something is improved.

Even so, unfortunately my vms cannot access internet.

i can also resolve dns queries, and ip forwarding is enabled.

I installed kvm and virtmanager from yast…

can anyone point me in the right direction? i am out of ideas

nvm i resolved this putting back iptables in /etc/libvirt/network.conf
don’t ask me why, now it is working correctly

@bamje The other step I failed to mention is, I enabled both IPv4/v6 forwarding from “Network settings” after I selected to use “Wicked Service” to configure the network settings.

Hopefully that last little bit will give your Internet access.

FYI: virbr0 and vnet will appear, up and running only after the VM is running, this has nothing to do with network settings.

Hope this helps.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.