0

I'm currently struggling about the fact that I could create (almost) unlimited virtual network interfaces with only one physical NIC. How does that can be possible ?

To give you more context about my thoughts, I'm trying to learn a bit about virtual networking and especially about cloud infrastructures. I know that almost everything is virtualized in order to uniform the hardware. Everything is only server and it allows you to get rid of physical routers and switches or other any dedicated hardware component. But how can a simple server with only few ethernet ports (let's say something between 1 and 3) can be used as a router or even a switch ?

Have a good day

3
  • Could you be more specific? Currently, there are different questions and many ways to answer them - VLANs, virtual interfaces, virtual switches, how switching and routing work, how the respective layers work, ....
    – Zac67
    Apr 10 '20 at 10:05
  • Sorry, maybe this way it's clearer: How is it possible that, with only one eth cable, one eth port on each of my 10 physical servers, I can use one of them as a virtual switch/router and connect all of them through multiple virtual interfaces ?
    – LeBovin
    Apr 10 '20 at 10:09
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can post and accept your own answer.
    – Ron Maupin
    Dec 17 '20 at 16:55
1

Since you seem to refer to a network inside a virtual host:

The physical topology is strictly point-to-point (nowadays), but the topoplogy on the data link layer is point-to-multipoint: each node can send a frame addressed to any other node out of (one of) its interface(s), and the network takes care of that frame reaching its destination.

Usually, a switch forwards the frame to the correct destination indicated by its destination MAC address. At the same time, the switch learns by the frame's source address on which port the source host is located and updates its internal MAC table.

You can also simply connect multiple switches to each other, forming a larger network. The only difference is that a switch now might learn multiple MAC addresses on each port.

A virtual host connected to a physical switch acts just like a switch itself: it makes the physical switch learn each MAC address from any of its virtual machines and the physical switch forwards frames in the correct way.

The host's NIC responds to many MAC addresses and the host's virtual switch then forwards them logically to their respective vNIC connected to one of its VMs.

A VM in turn can be an end node - consuming the frame - or a switch/bridge itself, forwarding the frame out of another one of its vNICs, thus bridging different port groups.

A router (on the network layer) is also an end node from the perspective of the data link layer - it consumes the frame. However, it does not consume the contained IP packet but de-encapsulates it and then forwards it, according to its routing table, out of one of its interfaces (re-encapsulated in a new frame).

(I have simplified somewhat - the data link layer doesn't necessarily use MAC frames and the network layer not necessarily IP packets.)

0

Using dot1q you can achieve multiple logical interfaces on one single physical interface that is very beneficial when you have a limited physical interface on your box.

eg.

Cisco7200(config)# interface port-channel 1.20 Cisco7200(config-subif)# encapsulation dot1Q 20 Cisco7200(config-subif)# ip address 10.10.11.1 255.255.255.0 Cisco7200(config-subif)# exit

but before that, you have to configure the required VLAN in this eg. vlan20 and tag that interface with vlan20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.