View previous topic :: View next topic |
Author |
Message |
therealjrd Tux's lil' helper

Joined: 18 May 2006 Posts: 103
|
Posted: Mon Sep 03, 2018 10:44 pm Post subject: Virtualization: libvirt vs ethernet link state |
|
|
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 |
|
 |
Hu Moderator

Joined: 06 Mar 2007 Posts: 13281
|
Posted: Tue Sep 04, 2018 1:56 am Post subject: |
|
|
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 |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 42116 Location: 56N 3W
|
Posted: Tue Sep 04, 2018 9:28 am Post subject: |
|
|
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 |
|
 |
therealjrd Tux's lil' helper

Joined: 18 May 2006 Posts: 103
|
Posted: Tue Sep 04, 2018 11:09 am Post subject: |
|
|
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 |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 42116 Location: 56N 3W
|
Posted: Tue Sep 04, 2018 11:29 am Post subject: |
|
|
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 |
|
 |
therealjrd Tux's lil' helper

Joined: 18 May 2006 Posts: 103
|
Posted: Tue Sep 04, 2018 11:55 am Post subject: |
|
|
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 |
|
 |
|