LPI BSD Specialist study materials
LPI BSD Specialist study resources

LPI BSD Specialist: Basic BSD Network Administration

LPI BSD Specialist · Work through your exam, one topic at a time.

All guide sections

Basic BSD Network Administration

Basic BSD Network Administration checks that you can configure interfaces, addressing, DNS, routing, wireless and a host firewall with BSD-native tools, and make the configuration survive a reboot.

Interfaces and addressing

ifconfig em0 inet 192.168.1.10 netmask 255.255.255.0 up applies a live address, but only rc.conf persists: ifconfig_em0="inet 192.168.1.10 netmask 255.255.255.0" in /etc/rc.conf, written with sysrc so the variable name is validated. Additional addresses go in ifconfig_em0_alias0. OpenBSD keeps per-interface files under /etc/hostname.if; NetBSD uses /etc/ifconfig.if or rc.conf.

Routing and name resolution

defaultrouter="192.168.1.1" sets the default gateway; static_routes plus route_ adds others. Inspect the table with netstat -rn. /etc/resolv.conf holds nameservers, but a DHCP client rewrites it on every lease, so hand-editing only makes sense on statically addressed hosts; /etc/hosts is consulted first per the hosts line in /etc/nsswitch.conf.

Wireless, forwarding and firewalls

wpa_supplicant.conf holds SSID and PSK; rc.conf gets wlans_ath0="wlan0" and ifconfig_wlan0="WPA DHCP". Forwarding is a sysctl: sysctl net.inet.ip.forwarding=1 is immediate, while net.inet.ip.forwarding=1 in /etc/sysctl.conf persists. FreeBSD ships ipfw in base and pf as a loadable kernel module; OpenBSD's pf is in base, enabled with rcctl enable pf and loaded with pfctl -f /etc/pf.conf.

Worked example

Make a static address permanent: sysrc ifconfig_em0="inet 192.168.1.10 netmask 255.255.255.0"; sysrc defaultrouter=192.168.1.1; service netif restart; service routing restart; netstat -rn. Reasoning: sysrc validates before writing, restarting netif alone leaves the old default route in place, and netstat -rn proves the route without a reboot.

Traps

rc.conf values containing spaces must be quoted or the shell splits them into separate tokens. Overwriting resolv.conf on a DHCP host is undone at the next lease renewal. Enabling pf while pointing at a bad ruleset can lock you out of the host. ifconfig changes are not persistent and vanish at reboot.