Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Non-functional network in kvm guest with virtio net
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
PF4Public
n00b
n00b


Joined: 28 Jan 2019
Posts: 60

PostPosted: Mon Aug 26, 2019 7:36 pm    Post subject: [solved] Non-functional network in kvm guest with virtio net Reply with quote

Recently I have tried to install Gentoo in a KVM guest. Everything went fine except for the networking.
Whatever I tried, networking refused to work. DHCP could not obtain IP address. Manually setting IP and gateway didn't help either. With tcpdump at DHCP server I have confirmed that DHCP got the request and replied, but the virtio net didn't receive it. Its RX counters were not increased. TX counters on the contrary did increase.
Only when I have replaced virtio net with rtl nic, everything started working properly.
What is the problem with virtio net?
Interesting observation is that this KVM host also has a number of Debian guests with virtio net and those have absolutely no problem with it. Thus I suppose that it could be some kernel configuration option which allows virtio net receiving packets?
This is weird anyway...


Last edited by PF4Public on Tue Aug 27, 2019 11:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1730
Location: Frankfurt, Germany

PostPosted: Mon Aug 26, 2019 8:20 pm    Post subject: Reply with quote

1) Please show us how you start QEMU/KVM (the parameters you use to start QEMU/KVM).

2) Please post the kernel config of the guest using wgetpaste.
Back to top
View user's profile Send private message
PF4Public
n00b
n00b


Joined: 28 Jan 2019
Posts: 60

PostPosted: Mon Aug 26, 2019 8:44 pm    Post subject: Reply with quote

Hi, mike155
I'm actually using libvirt. Here is the config of this particular VM: https://bpaste.net/show/WOCD
Kernel config is here: http://dpaste.com/3XK54V4
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Aug 26, 2019 8:55 pm    Post subject: Reply with quote

PF4Public,

This looks good.
Code:
    <interface type='bridge'>
      <mac address='52:54:00:db:48:91'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>


but that's with rtl8139 emulated hardware, not virtio.

Your kernel looks OK to me too.

-- edit --

How is br0 configured on your host?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1730
Location: Frankfurt, Germany

PostPosted: Mon Aug 26, 2019 9:07 pm    Post subject: Reply with quote

I agree with NeddySeagoon.

It should probably look like:
Code:
<interface type='bridge'>
    <source bridge='br0'/>
    <mac address='52:54:00:db:48:91'/>
    <model type='virtio'/>
 </interface>
Back to top
View user's profile Send private message
PF4Public
n00b
n00b


Joined: 28 Jan 2019
Posts: 60

PostPosted: Mon Aug 26, 2019 9:36 pm    Post subject: Reply with quote

mike155 wrote:
I agree with NeddySeagoon.

It should probably look like:
Code:
<interface type='bridge'>
    <source bridge='br0'/>
    <mac address='52:54:00:db:48:91'/>
    <model type='virtio'/>
 </interface>

Ofcourse it should, but like I've said, it didn't work, so I temporarily put realtek there
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Aug 26, 2019 9:38 pm    Post subject: Reply with quote

PF4Public,

br0 on the host?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
PF4Public
n00b
n00b


Joined: 28 Jan 2019
Posts: 60

PostPosted: Tue Aug 27, 2019 9:05 am    Post subject: Reply with quote

Host has eth0 and eth1, which are bonded and then bridged with tap0:

Code:
auto bond0
iface bond0 inet manual
    bond_mode 802.3ad
    bond_miimon 100
    bond_downdelay 200
    bond_updelay 200
    slaves eth0 eth1

auto br0
iface br0 inet static
   address 192.168.100.252
   broadcast 192.168.100.255
   netmask 255.255.255.0
   gateway 192.168.100.253
   dns-search *my-local-domain*
   dns-nameservers 192.168.100.253 192.168.100.254
   pre-up ip tuntap add dev tap0 mode tap user root
   pre-up ip link set tap0 up
   bridge_ports bond0 tap0
   bridge_stp off
   bridge_maxwait 0
   bridge_fd      0
   post-down ip link set tap0 down
   post-down ip tuntap del dev tap0 mode tap
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Tue Aug 27, 2019 10:45 am    Post subject: Reply with quote

PF4Public,

How do you stop eth0 and eth1 being brought up before they are donated to the bridge?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
PF4Public
n00b
n00b


Joined: 28 Jan 2019
Posts: 60

PostPosted: Tue Aug 27, 2019 11:38 pm    Post subject: Reply with quote

Turns out, virtio net needs CONFIG_PCI_MSI=y for properly functioning

NeddySeagoon wrote:
PF4Public,

How do you stop eth0 and eth1 being brought up before they are donated to the bridge?

Honestly saying I do not remember. I've configured this host many-many years ago and it runs ever since. All I do is keeping it updated.

I can speculate that it is because eth0 and eth1 are not marked with auto; and bond0 is also manual
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum