How simulate crossover Ethernet cable?

Discussions about using Linux guests in VirtualBox.
Post Reply
Sagypt
Posts: 51
Joined: 16. Apr 2012, 15:46

How simulate crossover Ethernet cable?

Post by Sagypt »

Hi all,

it's possible to simulate a crossover Ethernet cable to connect two VM as in this (no other) scenario? I tried with "Internal network" without success.

I would like to configure br0 and eth2 in DHCP. br0 gets a correct network configuration, eth2 no. eth2 seems not connected.

Thanks.

Code: Select all

                      Physical world <---|---> Virtual world

                                         |- VM -|
                                         |      |
                                         |  br0 |                                    |- VM -|
Router + Switch <--- Ethernet Cable ---> | eth0 |                                    |      |
                                         | eth1 | <--- Crossover Ethernet cable ---> | eth2 |

1) eth0 is a virtual NIC bridged to the physical NIC of the host
2) eth1 is a virtual NIC connected to Internal Network of Virtualbox
3) br0 is a bridge built over eth0 and eth1
4) eth2 is a virtual NIC connected to Internal Network of Virtualbox
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How simulate crossover Ethernet cable?

Post by socratis »

Sagypt wrote:I tried with "Internal network" without success.
Why not? That's your best option. See User Manual, ch. 6.2. Introduction to networking modes including the Overview table, which shows quickly what kind of connection is required to achieve what you want. And remember, you can always have more than one network card in your guest to cover multiple scenarios, like you do. Maybe you didn't create a DHCP server and your VMs relied on DHCP?


PS. Cross-over cables are as common these days as the dodo™. They became almost extinct around 2000's. No, I'm not talking about the dodo... ;)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: How simulate crossover Ethernet cable?

Post by Martin »

Make sure that your bridge VM is configured correctly not to filter / firewall and to forward all frames between the bridge interfaces.
Sagypt
Posts: 51
Joined: 16. Apr 2012, 15:46

Re: How simulate crossover Ethernet cable?

Post by Sagypt »

socratis wrote: Maybe you didn't create a DHCP server and your VMs relied on DHCP?
The DHCP server is built-in into router, a domestic (physical) xDSL router. The bridge br0 and the NIC eth2 are configured in DHCP.
socratis wrote: PS. Cross-over cables are as common these days as the dodo™. They became almost extinct around 2000's. No, I'm not talking about the dodo... ;)
It's just a simulation of a physical scenario (that's works), nothing else.

Martin wrote: Make sure that your bridge VM is configured correctly not to filter / firewall and to forward all frames between the bridge interfaces.
No firewall is active in both VMs
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How simulate crossover Ethernet cable?

Post by socratis »

Sagypt wrote:The DHCP server is built-in into router, a domestic (physical) xDSL router. The bridge br0 and the NIC eth2 are configured in DHCP.
The Internal network exists only in the VM world. It has absolutely no connection outside of VirtualBox. That's the idea. When I mentioned DHCP server, I meant that you have to create a DHCP server in VirtualBox, to serve your Internal network. Please read ch. 6.2. Introduction to networking modes.

Then continue with ch. 6.6 Internal networking for the gory details.
Sagypt wrote:It's just a simulation of a physical scenario (that's works), nothing else.
And in a physical scenario you do not need a cross-over cable. For many years now...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Sagypt
Posts: 51
Joined: 16. Apr 2012, 15:46

Re: How simulate crossover Ethernet cable?

Post by Sagypt »

socratis wrote: And in a physical scenario you do not need a cross-over cable. For many years now...
I repeat: it's just a simulation. In the real world I have no need for a crossover cable. I try to replicate the physical scenario with a partial, virtual scenario.

I found where the simulation breaks. The DHCP offer packet, coming from the DHCP server, doesn't cross from the NIC of the host to the NIC eth0 (bridge br0) into the VM. I'm working for a solution ...

Thanks.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How simulate crossover Ethernet cable?

Post by socratis »

Sagypt wrote:I repeat: it's just a simulation.
I think I get it now, maybe I needed it to be repeated thrice, that it's a simulation. I think it's the lack of caffeine sometimes...

Now, please repeat after me:
  • There is no cross-over cable in a virtual environment.
Sagypt wrote:The DHCP offer packet, coming from the DHCP server, doesn't cross from the NIC of the host to the NIC eth0 (bridge br0) into the VM.
Most probably because it's internal, a.k.a. isolated? You seriously need to read the manual and your networking mode options, it's all explained in there...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: How simulate crossover Ethernet cable?

Post by Martin »

Sagypt wrote:
Martin wrote: Make sure that your bridge VM is configured correctly not to filter / firewall and to forward all frames between the bridge interfaces.
No firewall is active in both VMs
Are you sure that the IP stack in your first VM is forwarding the frames between the interfaces connected to the bridge? Not all systems have ip forwarding active by default.
Also I'm not sure if the DHCP request frames will be forwarded.
Post Reply