Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Virtualization: libvirt vs ethernet link state
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
therealjrd
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2006
Posts: 100

PostPosted: Mon Sep 03, 2018 10:44 pm    Post subject: Virtualization: libvirt vs ethernet link state Reply with quote

Hi all. Unclear this is the right place for this question; please redirect me as needed.

I'm running a VM which I intended to use as a router to a not-always-up link. Turns out the VM's ethernet interface always sees link up, regardless of the actual state.

The host side sees the correct link state on that ethernet device.

I've tried with VM ethernet type e1000, realtek, and virtio, all behave the same way.

Anybody tried this? Hints on things to try? Any more info I can provide?

TIA . . .
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 13030

PostPosted: Tue Sep 04, 2018 1:56 am    Post subject: Reply with quote

Which VM are you using: Qemu, VirtualBox, ...? What are the kernel versions on the host and guest? How did you pass the NIC to the guest?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Sep 04, 2018 9:28 am    Post subject: Reply with quote

therealjrd,

Are you doing hardware pass through or is the VM connected to a bridge?

A VM connected to a bridge will always see the link as up because it is.
A bridge is an ethernet hub in software, so the next hop is always up.
_________________
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
therealjrd
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2006
Posts: 100

PostPosted: Tue Sep 04, 2018 11:09 am    Post subject: Reply with quote

NeddySeagoon wrote:
Are you doing hardware pass through or is the VM connected to a bridge?

A VM connected to a bridge will always see the link as up because it is.
A bridge is an ethernet hub in software, so the next hop is always up.


Ah. That makes sense.

[in response to earlier]
I'm running kvm on the host box. Kernels host and guest are 4.9.95. Host has a 4-NIC e-net card, and is configured with a TAP bridge connecting them and the motherboard NIC.

So it sounds like the core of my problem is that bridge. I should be working out how to do hardware-level passthrough, remove a port from the bridge, and let this VM control it directly.

Any pointers on paths to proceed? I'll start googling, but I'm happy to hot-wire my search with any info from the experts here.

Thanks!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Sep 04, 2018 11:29 am    Post subject: Reply with quote

therealjrd,

I did try PCI pass through for my router in a KVM but my 4 port NIC has a hardware bug, so it won't work.
Code:
04:00.0 Ethernet controller [0200]: Intel Corporation 82575GB Gigabit Network Connection [8086:10d6] (rev 02)
04:00.1 Ethernet controller [0200]: Intel Corporation 82575GB Gigabit Network Connection [8086:10d6] (rev 02)
05:00.0 Ethernet controller [0200]: Intel Corporation 82575GB Gigabit Network Connection [8086:10d6] (rev 02)
05:00.1 Ethernet controller [0200]: Intel Corporation 82575GB Gigabit Network Connection [8086:10d6] (rev 02)

I have to use bridges.

Its only my ppp0 interface to the outside world thats up and down but PPP in designed for that so it just works anyway.

PCI pass through is the way to go if you can.

If the host can detect that the link is down, you could make it take the bridge down too.
The guest might notice that.
I'm not sure that bringing the bridge back up in the host is enough to make the guest notice though.
_________________
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
therealjrd
Tux's lil' helper
Tux's lil' helper


Joined: 18 May 2006
Posts: 100

PostPosted: Tue Sep 04, 2018 11:55 am    Post subject: Reply with quote

Thanks Neddy, I'll do a bit of digging.

It's not the end of the world if I can't get passthrough to work, but it would simplify. We'll see where I end up.

Thanks again for the pointer.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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