The first tiny lab network I built had two green link lights and zero useful connectivity. I had treated the switch like a home router and waited for it to hand out addresses. It never would: an ordinary unmanaged switch moves Ethernet frames; DHCP, routing, DNS, and Internet access must come from somewhere else—or be deliberately omitted.
What each box is responsible for
Internet-connected LAN
Internet ── router (DHCP + gateway) ── unmanaged switch ── Ubuntu hosts
Isolated lab LAN
Ubuntu A (10.77.0.11/24) ── unmanaged switch ── Ubuntu B (10.77.0.12/24)
│
Ubuntu C (10.77.0.13/24)Two valid topologies with very different address and routing requirements.
What the diagram tells you
The switch learns MAC-address locations and forwards local Ethernet traffic; an unmanaged switch normally needs no host-side configuration.
A router connects different IP networks and usually supplies a default gateway, DHCP, DNS forwarding, and Internet NAT in a home or small office.
Hosts in one
/24subnet can communicate directly through the switch without a default gateway.The sample
10.77.0.0/24network is only a planning example; verify it does not overlap Wi-Fi, VPN, containers, virtual machines, or another routed network.
Cable the network before editing Ubuntu
Power the switch and connect each Ubuntu system with a known-good Ethernet cable.
For DHCP and Internet access, connect one switch port to a LAN port on the router—not its WAN port.
Check link/activity LEDs on the host and switch, remembering that an LED proves physical link, not IP connectivity.
If the switch supports VLANs or management, confirm all selected access ports belong to the same intended VLAN.
Write down each cable, switch port, hostname, interface name, and planned IP address before configuring several machines.
Identify the actual Ethernet interface
ip -brief link
ip -brief address
ip routeHow to recognize the correct interface
Ubuntu predictable Ethernet names often begin with
en, such aseno1orenp0s31f6; never assume the interface iseth0.UPmeans administratively enabled, whileLOWER_UPindicates a working lower-layer link.NO-CARRIERusually points to cable, port, switch power, negotiation, or driver state before IP configuration.Existing routes reveal subnets you must not reuse for the isolated LAN.
Path A: use the router’s DHCP service
On Ubuntu Desktop, the Ethernet connection normally uses NetworkManager and automatic IPv4 configuration already. Plugging into a router-connected switch may be enough. On a server using Netplan with networkd, DHCP can be declared explicitly.
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
dhcp4: trueExample DHCP configuration for an Ubuntu Server interface; replace the interface name.
What this Netplan file delegates
version: 2selects the current Netplan schema generation.renderer: networkdhands generated runtime configuration to systemd-networkd; Ubuntu Desktop commonly usesNetworkManagerinstead.The key beneath
ethernetsmust exactly match the real interface.dhcp4: truerequests IPv4 settings from a DHCP server; the switch itself does not answer that request.
Path B: plan an isolated static subnet
Choose an unused RFC 1918 subnet after checking every host’s routes—for example,
10.77.0.0/24only if it is genuinely unused.Reserve unique host addresses such as
.11,.12, and.13; never assign the network address.0or broadcast address.255in this/24example.Use the same prefix length on every host that should communicate directly.
Do not invent a gateway address. An isolated switch has no router, so adding a fake default route only breaks route selection.
Use IP addresses or
/etc/hostsfor names unless you operate a DNS server on the lab network.
network:
version: 2
renderer: networkd
ethernets:
enp0s31f6:
dhcp4: false
addresses:
- 10.77.0.11/24Static configuration for Ubuntu A on an isolated LAN; Ubuntu B would use a different address such as 10.77.0.12/24.
Why gateway and DNS are absent
dhcp4: falseprevents this interface from waiting for a DHCP lease.addressesuses CIDR notation;/24places10.77.0.1through10.77.0.254in the same local IPv4 subnet.No
routesentry is needed for hosts on the directly connected subnet.No
nameserversentry is needed for tests by address; add DNS only when a reachable resolver is part of the design.
Inspect existing Netplan ownership before adding a file
ls -l /etc/netplan
sudo netplan get
systemctl is-active NetworkManager systemd-networkdWhat prevents configuration fights
Netplan merges YAML files lexicographically; a new file can override or combine with installer and cloud-init configuration.
netplan getshows the merged model rather than only one file.Desktop NetworkManager profiles and server
networkdconfiguration should not compete for the same interface.Back up the relevant YAML and retain console access before changing a remote host.
Validate and apply with rollback
sudo netplan generate
sudo netplan try --timeout 120Risk level: caution. Review the command before running it.
What the safety sequence covers
netplan generatecatches schema and YAML problems without applying the generated network state.netplan tryapplies temporarily and asks for confirmation; lack of confirmation triggers rollback after the timeout.Rollback is valuable but not infallible for every virtual-device or remote-network scenario, so preserve console access.
Confirm only after address, route, peer, and required remote-session tests succeed.
Test from the bottom of the stack upward
ip -brief link show dev enp0s31f6
ip -brief address show dev enp0s31f6
ip route get 10.77.0.12
ping -c 4 10.77.0.12
ip neighbour show dev enp0s31f6How each result narrows the fault
LOWER_UPestablishes link; without it, stop and inspect cable, port, driver, and switch configuration.The address must be unique and in the planned subnet with the intended prefix.
ip route getshould select the Ethernet interface and local source address, not Wi-Fi or a VPN.Successful ping proves two-way IP and ICMP for that peer; failure does not automatically prove the link is down because firewalls can block ICMP.
Neighbour states such as
REACHABLEorSTALEshow an IP-to-MAC mapping;INCOMPLETEorFAILEDpoints toward Layer-2, VLAN, or peer-address trouble.
Separate network reachability from service reachability
ss -lnt
sudo ufw status verbose
ping -c 4 10.77.0.12Why ping is not the final application test
ss -lntshows local listening TCP ports; the intended server must bind to the LAN address or all appropriate addresses.ufw status verbosereports firewall policy but does not modify it.A successful ping can coexist with a blocked or absent SSH, HTTP, database, or file-sharing service.
Open only the required service and source subnet instead of disabling the firewall for convenience.
Measure throughput only after correctness
For an actual performance test, run an iperf3 server on one host and a client on another. File-copy speed mixes disk, filesystem, protocol, encryption, and cache behavior with the network. First prove stable addressing and routes; then use a dedicated network benchmark and compare link rate, TCP throughput, retransmissions, and CPU load.
Symptoms that point to the real layer
No carrier: cable, switch port, power, NIC driver, or negotiation problem.
169.254.x.x address: DHCP failed and link-local fallback occurred; verify a router/DHCP server exists.
Duplicate-address warning or intermittent traffic: two hosts share an address; disconnect one and correct the plan.
Peer works but Internet does not: isolated LAN has no router, or the default gateway and forwarding/NAT design is incomplete.
Internet works but peer uses Wi-Fi: route overlap or metrics selected another interface; inspect
ip route get PEER.Ping works but SSH does not: service is not listening, binds to another address, or a firewall blocks its port.
Some switch ports cannot talk: managed-switch VLAN or port-isolation configuration differs.
Related Ubuntu networking work
Configure a static IP address on Ubuntu for a routed production network.
Measure network throughput with iperf after connectivity is correct.
Inspect Linux interface and IP details when inventorying a more complex host.
Comments and corrections