Networking a virtual machine
The virtual network card modes (NAT, NAT network, bridged, host-only, internal, not attached), the virtual switch, the address received, port forwarding and a clone's MAC addresses.
- 24 cards
- 5 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- Scenarios
- Understand
A few cards from the deck
Virtual network adapter: what is it?
Show the answer
A simulated device that the hypervisor presents to the guest as a network card, with its own MAC address, and plugs into a virtual switch according to the chosen mode.
The mode is set on the card, not in the guest: changing mode is like unplugging a cable from one network and plugging it into another.
In VirtualBox, the host has the address 192.168.1.20 on the home router's network. Which address can a bridged VM receive?
- 192.168.1.37, given by the home router's DHCP server
- 10.0.2.15, given by VirtualBox's DHCP server
- 192.168.56.101, given by VirtualBox's private network
- 192.168.1.20, shared with the host through the bridge
Show the answer
192.168.1.37, given by the home router's DHCP server
The bridge puts the VM straight on the local network, with its own MAC address: the router treats it as one more device and gives it a free address from its range. 10.0.2.15 is the NAT mode address, 192.168.56.x the default host-only network's.
In NAT mode, the VM can … the Internet, but cannot be … from the local network without port forwarding.
Show the answer
In NAT mode, the VM can reach the Internet, but cannot be reached from the local network without port forwarding.
It is the same asymmetry as a home router: devices go out freely, nothing comes in without an explicit rule.
Virtual switch: what is it?
Show the answer
A device simulated by the hypervisor that connects virtual network cards to one another and, depending on its configuration, to the host's network.
It behaves like a physical switch: it forwards frames based on MAC addresses, which explains the problem of two VMs sharing the same one.
Two cloned VMs get the same IP address and cut each other off. What should you do?
- Change the hostname of each of the two cloned machines
- Extend the DHCP lease so the address no longer changes
- Move both machines to host-only mode to isolate them
- Regenerate the MAC addresses of one of the clones' cards
Show the answer
Regenerate the MAC addresses of one of the clones' cards
The clone kept the original's MAC address: the DHCP server and the switch think they are talking to a single machine. The hostname plays no part in identifying a card on the network. Hypervisors offer to regenerate MACs when cloning.