- Configure Networking
- Contents
- Setting System Hostname
- Configuring DNS
- Enabling IPv6 (Optional)
- Interface Configuration
- Loopback Configuration (Required)
- Wireless Configuration
- Ethernet Configuration
- Initial Configuration
- IPv4 DHCP Configuration
- IPv4 Static Address Configuration
- Additional IP addresses
- IPv6 Stateless Autoconfiguration
- IPv6 Static Address Configuration
- Example: Dual-Stack Configuration
- Firewalling with iptables and ip6tables
- Install iptables/ip6tables
- Configure iptables/ip6tables
- Save Firewall Rules
- For iptables
- For ip6tables
- Activating Changes and Testing Connectivity
- Additional Utilities
- iproute2
- drill
- Related articles
- Alpine newbie install manual
- Contents
- Additional Details
- Requirements
- Memory
- Storage
- Ways to install Alpine into machines listed by user cases
- by booting a source downloaded file ISO on USB or CD/DVD/BR
- by using from linux already started to new partition
- by booting through network install media
- by booting from external devices
- Ways to install Alpine listed by architectures
- x86_64 x86_32 x86
- ppc64le
- armhf armv7
- aarch64
- s390x
Configure Networking
This page will assist you in setting up networking on Alpine Linux.
Contents
Setting System Hostname
To set the system hostname:
echo «shortname» > /etc/hostname
Then, to activate the change:
hostname -F /etc/hostname
If you’re using IPv6, you should also add the following special IPv6 addresses to your /etc/hosts file:
For a static IP configuration, it’s common to also add the machine’s hostname you just set (above) to the /etc/hosts file.
Here’s an IPv4 example:
And here’s an IPv6 example:
Configuring DNS
For a static IP address and static nameservers, use one of the following examples.
For IPv4 nameservers, edit your /etc/resolv.conf file to look like this:
The following example uses Google’s Public DNS servers.
For IPv6 nameservers, edit your /etc/resolv.conf file to look like this:
The following example uses Hurricane Electric’s public DNS server.
You can also use Hurricane Electric’s public IPv4 DNS server:
Enabling IPv6 (Optional)
If you use IPv6, do the following to enable IPv6 now and at each boot:
modprobe ipv6 echo «ipv6» >> /etc/modules
Interface Configuration
Loopback Configuration (Required)
To configure loopback, add the following to a new file /etc/network/interfaces :
The above works to set up the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address ( ::1 ) — if you enabled IPv6.
Wireless Configuration
Ethernet Configuration
For the following Ethernet configuration examples, we will assume that you are using Ethernet device eth0 .
Initial Configuration
Add the following to the file /etc/network/interfaces , above any IP configuration for eth0 :
IPv4 DHCP Configuration
Add the following to the file /etc/network/interfaces , below the auto eth0 definition:
By default, the busybox DHCP client (udhcpc) requests a static set of options from the DHCP server. If you need to extend this set, you can do so by setting some additional command line options for the DHCP client, via the udhcpc_opts in your interface configuration. The following example requests domain-search option:
For a complete list of command line options for udhcpc, see this document.
IPv4 Static Address Configuration
Add the following to the file /etc/network/interfaces , below the auto eth0 definition:
Since Alpine 3.13 must be:
Additional IP addresses
Since Alpine 3.13 must be:
IPv6 Stateless Autoconfiguration
Add the following to the file /etc/network/interfaces , below the auto eth0 definition:
IPv6 Static Address Configuration
Add the following to the file /etc/network/interfaces , below the auto eth0 definition:
Since Alpine Linux 3.13 must be as:
Example: Dual-Stack Configuration
This example shows a dual-stack configuration.
Take care since Alpine 3.13 must be as:
Firewalling with iptables and ip6tables
Install iptables/ip6tables
apk add iptables
apk add ip6tables
- To install the man pages for iptables and ip6tables:
apk add iptables-doc
Configure iptables/ip6tables
Save Firewall Rules
For iptables
- Set iptables to start on reboot
rc-update add iptables
For ip6tables
- Set ip6tables to start on reboot
rc-update add ip6tables
Activating Changes and Testing Connectivity
Changes made to /etc/network/interfaces can be activated by running:
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:
For an IPv6 traceroute ( traceroute6 ), you will first need to install the iputils package:
apk add iputils
Then run traceroute6 :
Additional Utilities
iproute2
You may wish to install the ‘iproute2’ package (note that this will also install iptables if not yet installed)
apk add iproute2
This provides the ‘ss’ command which is IMHO a ‘better’ version of netstat.
Show listening tcp ports:
Show listening tcp ports and associated processes:
Show listening and established tcp connections:
Show socket usage summary:
Show more options:
drill
You may also wish to install ‘drill’ (it will also install the ‘ldns’ package) which is a superior (IMHO) replacement for nslookup and dig etc:
Then use it as you would for dig:
drill alpinelinux.org @8.8.8.8
To perform a reverse lookup (get a name from an IP) use the following syntax:
drill -x 8.8.8.8 @208.67.222.222
Related articles
You may also wish to review the following network related articles:
Источник
Alpine newbie install manual
Alpine Linux can be installed via many ways, the most common ones are listed here, for more information see last section of this document.
- Computer device like PC, laptop, or Raspberry, are forms or a name for machines that uses the software named «Operating System» like Alpine Linux, the target of a «install process» to property put the Alpine system.
- Image file means it is a type of file that is downloaded and burned to a CD/DVD or dumped to a USB with popular programs (such as Nero, CloneCD, Brasero), although in the modern era it’s not the only way (Raspberri’s).
- Boot or Booting means «Boot» (started from a media source) a disc recorded on DVD/CD or USB from the disc drive or from a USB port respectively, the computer boots this device and loads the Alpine operating system. Today that means involved with BIOS and UEFI systems.
Alpine Linux is an OS (Operating System) that runs on top of a machine, desktop, laptop, Virtual Machine, or Docker Container. Specifically, Alpine Linux is a [Linux OS Distribution] which provides the Linux kernel and a collection of userland programs and applications such as an internet web browser.
Setup_modes of Alpine operation: Alpine Linux is designed to run from RAM directly, which means the download image is already a fully installed, but a minimally configured system. Review the Setup_modes of Alpine operation for permanent installation options on most devices.
Contents
Additional Details
Requirements
Alpine Linux has low system requirements. Nowadays almost hardware is supported, More requirements documentation can be found on the Requirements wiki page:
Memory
- At least 128 MB of RAM for a server without a GUI.
- At least 1.6 GB for graphical desktop
- At least 4 GB for heavy Firefox or Chromium usage!
More documentation is available on the Memory requirements section wiki page.
Storage
- At least 1 GB storage device for a server without a GUI
- At least 10 GB for graphical desktop, or 80 GB overall
More documentation regarding requirements is available on the Storage requirements section wiki page
The majority of GPUs are supported, but for advanced features, 3D acceleration is managed by the MESA project:
- Intel: mostly any Intel with one exception, intel i810/i815 will lack features because of its 4Mb memory, Mesa and Linux have dropped their support.
- ATI/AMD: Only Radeon series with the exception of the last two years with respect to the Alpine release, Rage r128/match64 series has limited support.
- Nvidia: Limited. Only a few are completly supported. Not all features are enabled.
- Matrox: Not all features are supported. Just because they are shipped on most servers.
- Sis: Limited features are supported. Code not updated on Xorg and Linux kernel.
- Via: Limited features are supported. Openchrome code not updated on Xorg and Linux kernel.
More documentation available on the Peripheral requirements section wiki page.
Ways to install Alpine into machines listed by user cases
We have here many ways listed how you can put Alpine Linux in your computer device, PLEASE CHOOSE A USE CASE MOST CLOSE TO YOUR SETUP:
by booting a source downloaded file ISO on USB or CD/DVD/BR
- Alpine Install: from a disc to a virtualbox machine single only, install Alpine into VirtualBox virtual machine, use if you have a VirtualBox virtual machine and only want to test it out
- Alpine Install: from a disc to a any computer single only boot, install Alpine into a real modern machine by burning a disc that will boot if you have
UEFI or BIOS hardware and will be installing Alpine via a CD/DVD drive.
- Alpine Install: from a usb to a any computer single only boot, install Alpine into real modern machine by creating a USB drive unit that will boot if you have UEFI or BIOS hardware and will be installing Alpine via a USB drive.
- Alpine Install: from a usb to any computer dual boot linux Debian, install Alpine into most machines by creating a USB drive unit that will boot if you have common hardware and want another Linux distro as your main OS via USB boot.
- Alpine Install: from a usb to any computer dual boot linux Alpine, install Alpine into most machines by creating a USB drive unit that will boot if you have common hardware and want Alpine Linux as your main OS via USB boot.
- Alpine Install: from a disc to a old computer single only boot, (special case for very very old PC or laptop hardware) by burning a disc that will boot if you have BIOS only hardware and will be installing Alpine on it via CD/DVD drive.
- Alpine Install: from a disc to PC Engines APU: to install Alpine onto a second generation PC Engines APU system. Tested with an apu2d4 using latest alpine.
by using from linux already started to new partition
- Alpine Install: from alpine mirror to a new computer by chroot, install Alpine on a real (i.e. not virtual) modern machine directly using the Alpine mirror sources if you will be using Alpine inside another Linux installation via chroot.
- Alpine Install: from alpine mirror to an external disc by chroot, install Alpine on a real (i.e. not virtual) modern machine directly using the Alpine mirror sources if you extracted the disc for use with an existing instance of Linux.
- Alpine Install: from a iso to a virtualbox machine with external disc, install Alpine on a VirtualBox external disc machine. Use if you have an older computer that doesn’t boot, but need to extract the disc to prepare it for use.
by booting through network install media
- Alpine Install: from a tarball to a bootable ARM device, install Alpine on an ARM based device. Use if you have a ARM based network capable install device.
by booting from external devices
If the computer does not automatically boot from the desired device, one needs to bring up the boot menu selection for choosing the media to boot from. Depending on the computer the menu may be accessed by quickly pressing pressing a key repeatedly when booting starts. Sometimes you need to press the button before starting the computer and hold it down during bootup. Typical keys are: `F9`-`F12`, sometimes `F7` or `F8`. If these don’t bring up the boot menu, it may be necessary to enter the BIOS configuration and adjust the boot settings. Typical keys are: `Del` `F1` `F2` `F6` or `Esc.`
-
- Alpine Install: from a disc to PC Engines APU: to install Alpine into second generation PC Engines APU systems. Tested with an apu2d4 using latest Alpine.
- Bootstrapping Alpine on PC Engines ALIX.3
- Alpine on ARM fisrt main reference to any ARM device
Ways to install Alpine listed by architectures
x86_64 x86_32 x86
The all popular 32 bit intel (i386 pc 32bit) and x86_64 (i686 pc 64bit and amd64)compatible (both)
-
- Alpine Install: from a disc to a virtualbox machine single only, install Alpine into VirtualBox virtual machine, use if you have a VirtualBox virtual machine and only wants to take a shoot into it.
- Alpine Install: from a disc to a any computer single only boot, install Alpine into a real modern machine by burning a disc that will boot if you have a UEFI or BIOS hardware and will be only Alpine into it through CD/DVD drive.
- Alpine Install: from a usb to a any computer single only boot, install Alpine into real modern machine by creating a USB drive unit that will boot if you have a UEFI or BIOS hardware and will be only Alpine into it through USB drive.
- Alpine Install: from a usb to any computer dual boot linux Debian, install Alpine into most common machine by creating a USB drive unit that will boot if you have common hardware and want another Linux as main OS through USB boot.
- Alpine Install: from a usb to any computer dual boot linux Alpine, install Alpine into most common machine by creating a USB drive unit that will boot if you have common hardware and want Alpine Linux as main OS through USB boot.
- Alpine Install: from a disc to a old computer single only boot, especial case for very very older hardware computers PC or laptops by burning a disc that will boot if you have a BIOS only older hardware and will be only Alpine into it through CD/DVD drive.
- Bootstrapping Alpine on PC Engines ALIX.3
- Alpine Install: from a disc to PC Engines APU: to install Alpine into second generation PC Engines APU systems, it were tested with an apu2d4 using alpine lasted.
ppc64le
For the PowerPC devices with pure little-endian mode, mostly for POWER8 and POWER9
- Alpine Install: from a disc to a any computer single only boot, install Alpine on a real (i.e. ot virtual) modern machine by burning a disc that will boot if you have UEFI or BIOS hardware and will be installing Alpine on it via a CD/DVD drive.
Alpine Install: from a usb to a any computer single only boot, install Alpine on real (i.e. ot virtual) modern machine by creating a USB drive that will boot if you have UEFI or BIOS hardware and will be installing Alpine on it via a USB drive.
armhf armv7
ARM based hardware that does not have CD/DVD/BR boot support, only execution state of the ARMv7 devices machines. Including video game consoles; the newer ARM hard-float for newer, more powerful, 32-bit as well as 64-bit devices.
aarch64
The 64-bit ARM only execution state of the ARMv8 device machines.
- Alpine Install: from a usb to a any computer single only boot, install Alpine on a real (i.e. not virtual) modern machine by creating a USB drive unit that will boot if you have UEFI or BIOS hardware and will be installing Alpine on it via a USB drive.
s390x
For the Super powered IBM mainframes, especially IBM Z and IBM LinuxONE servers
Источник