To configure a static IP address on Alpine Linux, you will need to perform the following steps:
/etc/network/interfaces
, and add the following lines, replacing <interface>
with the name of your network interface and <static IP address>
, <netmask>
, and <default gateway>
with the appropriate values for your network:auto <interface> iface <interface> inet static address <static IP address> netmask <netmask> gateway <default gateway>
Save the changes to the configuration file and exit the text editor.
Restart the network service to apply the changes:
systemctl restart networking
ip
command:ip addr show <interface>
Alternatively, you can use the ifconfig
command to view the network configuration:
ifconfig <interface>