1Z0-105 · Question #27
Which statement describes the default network set up by an Oracle template script?
The correct answer is B. A veth device is added to libvirt's virbr0 bridge. By default, the lxc-oracle template script sets up networking by setting up a veth bridge. In this mode, a container obtains its IP address from the dnsmasq server that libvirtd runs on the private virtual bridge network (virbr0) between the container and the host. The host…
Question
Options
- AThe container is isolated from the network.
- BA veth device is added to libvirt's virbr0 bridge.
- CA macvlan device enables DHCP from the host's network.
- DA private interface is routed to Open vSwitch.
How the community answered
(41 responses)- A5% (2)
- B83% (34)
- C10% (4)
- D2% (1)
Explanation
By default, the lxc-oracle template script sets up networking by setting up a veth bridge. In this mode, a container obtains its IP address from the dnsmasq server that libvirtd runs on the private virtual bridge network (virbr0) between the container and the host. The host allows a container to connect to the rest of the network by using NAT rules in iptables, but these rules do not allow incoming connections to the container. Both the host and other containers on the veth bridge have network access to the container via the bridge.
Topics
Community Discussion
6The answer is B. When you run an Oracle LXC template script, it wires up the container networking by creating a veth pair and attaching one end to libvirt's virbr0 bridge, which is that default NAT bridge libvirt sets up automatically. The container gets an address on a private subnet and traffic goes out through the host via NAT, so the container has internet access but is not directly exposed on the physical network. The macvlan option (C) would put the container right on the host's network segment which is not the default, and Open vSwitch (D) is a whole separate SDN stack you would have to configure yourself. A lot of people second-guess B because they associate virbr0 with KVM virtual machines, but Oracle's container templates hook into that same bridge infrastructure, so once you understand that connection the question is pretty straightforward.
Right, B. Oracle's lxc-oracle template wires the container NIC to virbr0 via veth pair by default.
So when Oracle's template script runs, it wires your container into libvirt's default bridge (virbr0) using a veth pair, which is why containers get NAT'd connectivity out of the box without you touching anything. Quick question for you though: have you spun up an lxc-create with that template yet and actually run "brctl show" or "ip link" afterward to see the veth show up on virbr0 yourself, or are you just trusting the exam material on this one?
Yeah I actually ran it on a test VM before the exam and you can see the veth pair pop right up with ip link show, though worth noting brctl is deprecated on newer distros so bridge link is what you want to use instead if you are on anything recent.
The Oracle lxc template script wires up a veth pair by default, drops one end into the container namespace, and bridges the other end onto virbr0, which libvirt manages as a NAT bridge sitting on top of whatever physical interface the host is using. That NAT behavior is why your container gets outbound connectivity without you touching firewall rules or routing tables, same idea as the old Solaris zone shared-IP model but plumbed differently under the hood. The macvlan option in C would hand the container a device that talks directly on the physical segment and pulls a DHCP lease from your upstream network, which is a totally different story and definitely not what the template script gives you out of the box. Now here is what I want to make sure people actually understand and not just memorize for the test: do you know what virbr0 is actually doing at the kernel level to provide that outbound connectivity, and why a container attached to it cannot receive unsolicited inbound connections from outside the host without extra configuration?
The macvlan option (C) trips people up because macvlan sounds like something a template script would hand you out of the box, but that is a manual config, not the Oracle LXC template default. The template wires a veth pair into libvirt's virbr0 bridge, so B is your answer.