FreeBSD Fundamentals · Module 05 of 14

Networking, routing and name resolution

Configure interfaces and routes, distinguish runtime from persistent settings, and troubleshoot connectivity methodically.

Learning objectives

By the end of this module, you should be able to:

  • Inspect interfaces and routes.
  • Persist network settings with rc.conf/sysrc.
  • Separate link, IP, route and DNS failure domains.

Runtime versus persistent network state

ifconfig changes runtime interface state. Persistent interface configuration belongs in rc.conf, often written with sysrc. Default routing and DNS are separate configuration concerns.

Troubleshooting by layer

Start with interface/link state, then local addressing, route selection, reachability and DNS. Avoid changing all layers at once.

Worked examples

See the idea in practice.

Inspect the network

ifconfig
netstat -rn
route -n get default
cat /etc/resolv.conf
  • ifconfig shows interface state and addresses.
  • netstat -rn and route expose routing decisions.
Hands-on lab

Lab — Diagnose the active network path

Goal: Identify the active interface, default route, DNS servers and listening sockets without changing configuration.

Before you start

  • Network-connected FreeBSD host.
STEP 1

Inventory interfaces

ifconfig -a
STEP 2

Inspect routing

netstat -rn
route -n get default
STEP 3

Test IP and DNS

ping -c 2 1.1.1.1 || true
host freebsd.org || drill freebsd.org || true
STEP 4

Inspect sockets

sockstat -4 -6 | head -30

Verify

  • You can name the default interface/gateway and determine whether DNS works independently of IP reachability.

Expected outcome

  • The lab produces evidence without making configuration changes.

If it fails

  • If IP works but names fail, inspect /etc/resolv.conf before changing routes.
Real-world connection

Layered network diagnosis reduces accidental outages.

Avoid these traps

Common mistakes

  • Changing rc.conf before confirming the runtime problem.
  • Treating DNS failure as proof the interface is down.
Knowledge check

Can you explain it without looking back?

Open each answer only after you have tried to answer the question yourself.

1Which command shows FreeBSD network interfaces?

ifconfig.

2Where is a persistent default router commonly configured?

/etc/rc.conf, commonly via sysrc defaultrouter.

3Why test an IP address and a hostname separately?

It distinguishes basic reachability/routing from name-resolution failure.

My Learning

Record your progress for this module.

Progress is saved in this browser immediately. When you sign in to My Learning, it can also sync across devices.

Not started

Attempt the core lab and knowledge checks before marking the module complete.