How to configure static IP address on Alpine Linux

www.l‮ua‬tturi.com
How to configure static IP address on Alpine Linux

To configure a static IP address on Alpine Linux, you will need to perform the following steps:

  1. Edit the network configuration file, /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>
  1. Save the changes to the configuration file and exit the text editor.

  2. Restart the network service to apply the changes:

systemctl restart networking
  1. Verify that the static IP address has been correctly configured by using the ip command:
ip addr show <interface>

Alternatively, you can use the ifconfig command to view the network configuration:

ifconfig <interface>
Created Time:2017-10-28 21:39:00  Author:lautturi