AmnesiaOS automatically configures network interfaces at boot usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/damianiglesias/amnesiaOS/llms.txt
Use this file to discover all available pages before exploring further.
udhcpc — BusyBox’s built-in DHCP client. No manual configuration is needed on networks with a DHCP server. The entire process runs inside /init before the interactive shell is launched, so the network is ready the moment you reach a prompt.
How network boot works
/init brings up loopback
The init script runs
ip link set lo up to enable the loopback interface. This must happen first so that local inter-process communication works correctly before any external interfaces are brought up.Interface discovery
The init script iterates
/sys/class/net/* to enumerate all network interfaces present on the system. The loopback interface (lo) is filtered out — only physical and virtual non-loopback interfaces are processed.Interface up
For each discovered interface, the init script runs
ip link set <iface> up to bring the link layer up and make it ready to send and receive frames.DHCP request
The init script runs
udhcpc for each interface:| Flag | Meaning |
|---|---|
-i <iface> | Bind the DHCP client to this specific interface |
-n | Exit with a non-zero code if no lease is obtained |
-q | Quit after obtaining the first lease |
-s | Specify the hook script to call on lease events |
The udhcpc hook script
The file/usr/share/udhcpc/default.script is created during initramfs build time by build-initramfs.sh and is packed into the CPIO archive:
udhcpc exports DHCP lease information as shell environment variables ($interface, $ip, $mask, $subnet, $router, $dns) before invoking the script, so the script can apply them directly with standard ip commands.
/etc/resolv.conf is created as an empty file at initramfs build time (touch /etc/resolv.conf) and populated at boot by the DHCP hook script. This ensures the file always exists, even before a lease is obtained.Hook script actions
| Event | Action |
|---|---|
deconfig | Flush all addresses from the interface — called before a new DHCP exchange begins |
bound | Set IP address and prefix length, add the default gateway route, write DNS servers to /etc/resolv.conf |
renew | Same as bound — refreshes the lease with updated IP, gateway, and DNS values |
Manual network configuration
For environments without a DHCP server, configure the network manually after reaching the BusyBox shell:192.168.1.100, 192.168.1.1, and eth0 with values appropriate for your network. Multiple nameservers can be added by appending additional nameserver lines to /etc/resolv.conf.
Network configuration is stored in RAM (tmpfs). If you reboot, all network config — including any manual static configuration — is lost and re-applied automatically via DHCP on the next boot.