[SOLVED] USB NIC - passthrough vs bridge

Discussions related to using VirtualBox on Linux hosts.
Post Reply
harisund
Posts: 33
Joined: 30. Oct 2008, 23:53
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu-10.04

[SOLVED] USB NIC - passthrough vs bridge

Post by harisund »

Hardware - Linux host running CentOS 7 (latest) with the following
1- motherboard NIC connected to corporate network, 10.20.12.54 IP address.
2- USB NIC , connected to a "testing" router. Not configured on the host. Here's the ifconfig output -

Code: Select all

enp0s20u2: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 48:f8:b3:2b:26:a8  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lan: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.20.12.54  netmask 255.255.255.0  broadcast 10.20.12.255
        inet6 fe80::ba97:5aff:fe64:9c1b  prefixlen 64  scopeid 0x20<link>
        ether b8:97:5a:64:9c:1b  txqueuelen 1000  (Ethernet)
        RX packets 66903  bytes 4378657 (4.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 68884  bytes 45411799 (43.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 4  bytes 240 (240.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 4  bytes 240 (240.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The testing router has an address of 192.168.76.1 , handing out IPs between 192.168.76.100 through 192.168.76.200.

The VM host DOES NOT HAVE AN IP on this network of the test router

Scenario 1 - USB pass through of the NIC to the VM
The VM correctly gets an IP address of 192.168.76.101 as assigned by the test router

Scenario 2 - Bridged interface with enp0s20u2
The VM does *not* get an IP address from the test router, even though enp0s20u2 is physically wired to the LAN port on the "test router"

Scenario 1 obviously limits me to just one VM being able to connect to my "test router", which is not preferable. I want multiple VMs to be able to connect to the "test router" network, but I *do not* want the host itself to be on the VM network. I want to leave the host interface enp0s20u2 unconfigured, but the VMs should get their IPs from the test router.

Is this even doable with Virtual Box, or does Virtual Box require that the interface be configured?

Any idea what's going wrong?
Last edited by harisund on 9. Jan 2017, 16:44, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: USB NIC - passthrough vs bridge

Post by Perryg »

Really depends on the USB device. Some wireless adapters don't play well. It also depends if the guest has the proper hardware drivers for what it is you have. I do know that the device should work if everything plays well together as I have done it myself. Just remember once you connect the device VBox is no longer in the mix as far as the network is concerned.
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: USB NIC - passthrough vs bridge

Post by michaln »

Re scenario 1, the adapter need not have an IP address on the host (and be involved in the host's TCP/IP stack), but it does need to be 'UP'. Otherwise it can't send or receive packets and obviously can't do much.
harisund
Posts: 33
Joined: 30. Oct 2008, 23:53
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Windows XP, Ubuntu-10.04

Re: USB NIC - passthrough vs bridge

Post by harisund »

michaln wrote:Re scenario 1, the adapter need not have an IP address on the host (and be involved in the host's TCP/IP stack), but it does need to be 'UP'. Otherwise it can't send or receive packets and obviously can't do much.
Well duh !!! Can't believe I was this dumb.

Yep, that fixed it. Thank you very much !
Post Reply