<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hinman</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hinman"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Hinman"/>
	<updated>2026-04-26T12:04:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4545</id>
		<title>Configure Networking</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4545"/>
		<updated>2010-10-25T17:13:51Z</updated>

		<summary type="html">&lt;p&gt;Hinman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will assist you in setting up networking on Alpine Linux.&lt;br /&gt;
{{Note|You must be logged in as root in order to perform the actions on this page.}}&lt;br /&gt;
&lt;br /&gt;
= Setting System Hostname =&lt;br /&gt;
To set the system hostname, do something like the following:&lt;br /&gt;
{{Cmd|echo &amp;quot;hostname.domain.com&amp;quot; &amp;gt; /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
Then, to activate the change, do the following:&lt;br /&gt;
{{Cmd|hostname -F /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using IPv6, you should also add the following special IPv6 addresses to your &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;
fe00::0         ipv6-localnet&lt;br /&gt;
ff00::0         ipv6-mcastprefix&lt;br /&gt;
ff02::1         ipv6-allnodes&lt;br /&gt;
ff02::2         ipv6-allrouters&lt;br /&gt;
ff02::3         ipv6-allhosts&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you are going to use automatic IP configuration, such as IPv4 DHCP or IPv6 Stateless Autoconfiguration, you can skip ahead to [[#Configuring_DNS|Configuring DNS]].  Otherwise, if you are going to use a static IPv4 or IPv6 address, continue below.}}&lt;br /&gt;
&lt;br /&gt;
For a static IP configuration, it&#039;s common to also add the machine&#039;s hostname you just set (above) to the &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an IPv4 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.150   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s an IPv6 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;2001:470:ffff:ff::2   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configuring DNS =&lt;br /&gt;
{{Warning|&#039;&#039;&#039;For users of IPv4 DHCP:&#039;&#039;&#039; Please note that &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will be completely overwritten with any nameservers provided by DHCP. Also, if DHCP does not provide any nameservers, then &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will still be overwritten, but will not contain any nameservers! &#039;&#039;&#039;&#039;&#039;Note to self: This behavior should probably be reported to upstream.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
{{Note|&#039;&#039;&#039;For users of IPv6 Stateless Autoconfiguration:&#039;&#039;&#039; The above warning doesn&#039;t seem to be an issue here, however, I would advise caution.}}&lt;br /&gt;
&lt;br /&gt;
For using a static IP and static nameservers, use one of the following examples.&lt;br /&gt;
&lt;br /&gt;
For IPv4 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://en.wikipedia.org/wiki/Google_Public_DNS Google&#039;s Public DNS servers].&lt;br /&gt;
{{Cmd|nameserver 8.8.8.8&lt;br /&gt;
nameserver 8.8.4.4}}&lt;br /&gt;
&lt;br /&gt;
For IPv6 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://www.he.net/ Hurricane Electric&#039;s] public DNS server.&lt;br /&gt;
{{Cmd|nameserver 2001:470:20::2}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you decide to use Hurricane Electric&#039;s nameserver, be aware that it is &#039;Google-whitelisted&#039;. What does this mean?  It allows you access to many of Google&#039;s services via IPv6. (Just don&#039;t add other, non-whitelisted, nameservers to &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — ironically, such as Google&#039;s Public IPv4 DNS Servers in the first example.) Read [http://www.google.com/intl/en/ipv6/ here] for more information.}}&lt;br /&gt;
&lt;br /&gt;
= Enabling IPv6 (Optional) =&lt;br /&gt;
&lt;br /&gt;
If you use IPv6, do the following to enable IPv6 for now and at each boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;modprobe ipv6&lt;br /&gt;
echo &amp;quot;ipv6&amp;quot; &amp;gt;&amp;gt; /etc/modules&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Interface Configuration =&lt;br /&gt;
&lt;br /&gt;
== Loopback Configuration (Required) ==&lt;br /&gt;
To configure loopback, add the following to a new file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above works to setup the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address (&amp;lt;code&amp;gt;::1&amp;lt;/code&amp;gt;) — if you enabled IPv6.&lt;br /&gt;
&lt;br /&gt;
== Ethernet Configuration ==&lt;br /&gt;
For the following Ethernet configuration examples, we will assume that you are using Ethernet device &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Initial Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, above any IP configuration for &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto eth0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 DHCP Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Stateless Autoconfiguration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 manual&lt;br /&gt;
        pre-up echo 1 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;&#039;&#039;The inet6 &amp;quot;manual&amp;quot; method is not yet available in busybox.  A patch has been submitted for review.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Dual-Stack Configuration ==&lt;br /&gt;
This example shows a dual-stack configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firewalling with iptables and ip6tables =&lt;br /&gt;
== Install iptables ==&lt;br /&gt;
{{ Cmd|apk add iptables }}&lt;br /&gt;
&lt;br /&gt;
== Configure iptables/ip6tables ==&lt;br /&gt;
{{ Tip| Good examples of how to write iptables rules can be found at the Linux Home Networking Wiki http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables }}&lt;br /&gt;
&lt;br /&gt;
== Save Firewall Rules ==&lt;br /&gt;
# Set iptables to start on reboot&lt;br /&gt;
#* {{ Cmd| rc-update add iptables }}&lt;br /&gt;
#Write the firewall rules to disk&lt;br /&gt;
#* {{ Cmd| /etc/init.d/iptables save}}&lt;br /&gt;
# Add the firewall rules to Alpine local backup&lt;br /&gt;
#*{{ Cmd| lbu add /var/lib/iptables/rules-save }}&lt;br /&gt;
# Save the configuration&lt;br /&gt;
#*{{ Cmd| lbu ci }}&lt;br /&gt;
&lt;br /&gt;
= Activating Changes and Testing Connectivity =&lt;br /&gt;
Changes made to &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; can be activated by running:&lt;br /&gt;
{{Cmd|/etc/init.d/networking restart}}&lt;br /&gt;
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:&lt;br /&gt;
{{Cmd|ping www.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;PING www.l.google.com (74.125.47.103) 56(84) bytes of data.&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=1 ttl=48 time=58.5 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=2 ttl=48 time=56.4 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=3 ttl=48 time=57.0 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=4 ttl=48 time=60.2 ms&lt;br /&gt;
^C&lt;br /&gt;
--- www.l.google.com ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 received, 0% packet loss, time 3007ms&lt;br /&gt;
rtt min/avg/max/mdev = 56.411/58.069/60.256/1.501 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an IPv6 traceroute (&amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;), you will first need to install the &amp;lt;code&amp;gt;iputils&amp;lt;/code&amp;gt; package:&lt;br /&gt;
{{Cmd|apk add iputils}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{Cmd|traceroute6 ipv6.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;traceroute to ipv6.l.google.com (2001:4860:8009::67) from 2001:470:ffff:ff::2, 30 hops max, 16 byte packets&lt;br /&gt;
 1  2001:470:ffff:ff::1 (2001:470:ffff:ff::1)  3.49 ms  0.62 ms  0.607 ms&lt;br /&gt;
 2  *  *  *&lt;br /&gt;
 3  *  *  *&lt;br /&gt;
 4  pr61.iad07.net.google.com (2001:504:0:2:0:1:5169:1)  134.313 ms  95.342 ms  88.425 ms&lt;br /&gt;
 5  2001:4860::1:0:9ff (2001:4860::1:0:9ff)  100.759 ms  100.537 ms  89.907 ms&lt;br /&gt;
 6  2001:4860::1:0:5db (2001:4860::1:0:5db)  115.563 ms  102.946 ms  106.191 ms&lt;br /&gt;
 7  2001:4860::2:0:a7 (2001:4860::2:0:a7)  101.754 ms  100.475 ms  100.512 ms&lt;br /&gt;
 8  2001:4860:0:1::c3 (2001:4860:0:1::c3)  99.272 ms  111.989 ms  99.835 ms&lt;br /&gt;
 9  yw-in-x67.1e100.net (2001:4860:8009::67)  101.545 ms  109.675 ms  99.431 ms&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hinman</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4544</id>
		<title>Configure Networking</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4544"/>
		<updated>2010-10-25T17:09:31Z</updated>

		<summary type="html">&lt;p&gt;Hinman: /* Configure iptables/ip6tables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will assist you in setting up networking on Alpine Linux.&lt;br /&gt;
{{Note|You must be logged in as root in order to perform the actions on this page.}}&lt;br /&gt;
&lt;br /&gt;
= Setting System Hostname =&lt;br /&gt;
To set the system hostname, do something like the following:&lt;br /&gt;
{{Cmd|echo &amp;quot;hostname.domain.com&amp;quot; &amp;gt; /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
Then, to activate the change, do the following:&lt;br /&gt;
{{Cmd|hostname -F /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using IPv6, you should also add the following special IPv6 addresses to your &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;
fe00::0         ipv6-localnet&lt;br /&gt;
ff00::0         ipv6-mcastprefix&lt;br /&gt;
ff02::1         ipv6-allnodes&lt;br /&gt;
ff02::2         ipv6-allrouters&lt;br /&gt;
ff02::3         ipv6-allhosts&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you are going to use automatic IP configuration, such as IPv4 DHCP or IPv6 Stateless Autoconfiguration, you can skip ahead to [[#Configuring_DNS|Configuring DNS]].  Otherwise, if you are going to use a static IPv4 or IPv6 address, continue below.}}&lt;br /&gt;
&lt;br /&gt;
For a static IP configuration, it&#039;s common to also add the machine&#039;s hostname you just set (above) to the &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an IPv4 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.150   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s an IPv6 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;2001:470:ffff:ff::2   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configuring DNS =&lt;br /&gt;
{{Warning|&#039;&#039;&#039;For users of IPv4 DHCP:&#039;&#039;&#039; Please note that &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will be completely overwritten with any nameservers provided by DHCP. Also, if DHCP does not provide any nameservers, then &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will still be overwritten, but will not contain any nameservers! &#039;&#039;&#039;&#039;&#039;Note to self: This behavior should probably be reported to upstream.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
{{Note|&#039;&#039;&#039;For users of IPv6 Stateless Autoconfiguration:&#039;&#039;&#039; The above warning doesn&#039;t seem to be an issue here, however, I would advise caution.}}&lt;br /&gt;
&lt;br /&gt;
For using a static IP and static nameservers, use one of the following examples.&lt;br /&gt;
&lt;br /&gt;
For IPv4 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://en.wikipedia.org/wiki/Google_Public_DNS Google&#039;s Public DNS servers].&lt;br /&gt;
{{Cmd|nameserver 8.8.8.8&lt;br /&gt;
nameserver 8.8.4.4}}&lt;br /&gt;
&lt;br /&gt;
For IPv6 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://www.he.net/ Hurricane Electric&#039;s] public DNS server.&lt;br /&gt;
{{Cmd|nameserver 2001:470:20::2}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you decide to use Hurricane Electric&#039;s nameserver, be aware that it is &#039;Google-whitelisted&#039;. What does this mean?  It allows you access to many of Google&#039;s services via IPv6. (Just don&#039;t add other, non-whitelisted, nameservers to &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — ironically, such as Google&#039;s Public IPv4 DNS Servers in the first example.) Read [http://www.google.com/intl/en/ipv6/ here] for more information.}}&lt;br /&gt;
&lt;br /&gt;
= Enabling IPv6 (Optional) =&lt;br /&gt;
&lt;br /&gt;
If you use IPv6, do the following to enable IPv6 for now and at each boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;modprobe ipv6&lt;br /&gt;
echo &amp;quot;ipv6&amp;quot; &amp;gt;&amp;gt; /etc/modules&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Interface Configuration =&lt;br /&gt;
&lt;br /&gt;
== Loopback Configuration (Required) ==&lt;br /&gt;
To configure loopback, add the following to a new file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above works to setup the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address (&amp;lt;code&amp;gt;::1&amp;lt;/code&amp;gt;) — if you enabled IPv6.&lt;br /&gt;
&lt;br /&gt;
== Ethernet Configuration ==&lt;br /&gt;
For the following Ethernet configuration examples, we will assume that you are using Ethernet device &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Initial Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, above any IP configuration for &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto eth0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 DHCP Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Stateless Autoconfiguration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 manual&lt;br /&gt;
        pre-up echo 1 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;&#039;&#039;The inet6 &amp;quot;manual&amp;quot; method is not yet available in busybox.  A patch has been submitted for review.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Dual-Stack Configuration ==&lt;br /&gt;
This example shows a dual-stack configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firewalling with iptables and ip6tables =&lt;br /&gt;
== Install iptables ==&lt;br /&gt;
{{ Cmd|apk add iptables }}&lt;br /&gt;
&lt;br /&gt;
== Configure iptables/ip6tables ==&lt;br /&gt;
{{ Tip| Good examples of how to write iptables rules can be found at the Linux Home Networking Wiki http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables }}&lt;br /&gt;
&lt;br /&gt;
== Save Firewall Rules ==&lt;br /&gt;
# Set iptables to start on reboot&lt;br /&gt;
#* {{ Cmd| rc-update add iptables }}&lt;br /&gt;
#Write the firewall rules to disk&lt;br /&gt;
#* {{ Cmd| /etc/init.d/iptables save}}&lt;br /&gt;
# Add the firewall rules to lbu&lt;br /&gt;
#*{{ Cmd| lbu add /var/lib/iptables/rules-save }}&lt;br /&gt;
# Save the configuration&lt;br /&gt;
#*{{ Cmd| lbu ci }}&lt;br /&gt;
&lt;br /&gt;
= Activating Changes and Testing Connectivity =&lt;br /&gt;
Changes made to &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; can be activated by running:&lt;br /&gt;
{{Cmd|/etc/init.d/networking restart}}&lt;br /&gt;
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:&lt;br /&gt;
{{Cmd|ping www.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;PING www.l.google.com (74.125.47.103) 56(84) bytes of data.&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=1 ttl=48 time=58.5 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=2 ttl=48 time=56.4 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=3 ttl=48 time=57.0 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=4 ttl=48 time=60.2 ms&lt;br /&gt;
^C&lt;br /&gt;
--- www.l.google.com ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 received, 0% packet loss, time 3007ms&lt;br /&gt;
rtt min/avg/max/mdev = 56.411/58.069/60.256/1.501 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an IPv6 traceroute (&amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;), you will first need to install the &amp;lt;code&amp;gt;iputils&amp;lt;/code&amp;gt; package:&lt;br /&gt;
{{Cmd|apk add iputils}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{Cmd|traceroute6 ipv6.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;traceroute to ipv6.l.google.com (2001:4860:8009::67) from 2001:470:ffff:ff::2, 30 hops max, 16 byte packets&lt;br /&gt;
 1  2001:470:ffff:ff::1 (2001:470:ffff:ff::1)  3.49 ms  0.62 ms  0.607 ms&lt;br /&gt;
 2  *  *  *&lt;br /&gt;
 3  *  *  *&lt;br /&gt;
 4  pr61.iad07.net.google.com (2001:504:0:2:0:1:5169:1)  134.313 ms  95.342 ms  88.425 ms&lt;br /&gt;
 5  2001:4860::1:0:9ff (2001:4860::1:0:9ff)  100.759 ms  100.537 ms  89.907 ms&lt;br /&gt;
 6  2001:4860::1:0:5db (2001:4860::1:0:5db)  115.563 ms  102.946 ms  106.191 ms&lt;br /&gt;
 7  2001:4860::2:0:a7 (2001:4860::2:0:a7)  101.754 ms  100.475 ms  100.512 ms&lt;br /&gt;
 8  2001:4860:0:1::c3 (2001:4860:0:1::c3)  99.272 ms  111.989 ms  99.835 ms&lt;br /&gt;
 9  yw-in-x67.1e100.net (2001:4860:8009::67)  101.545 ms  109.675 ms  99.431 ms&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hinman</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4543</id>
		<title>Configure Networking</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4543"/>
		<updated>2010-10-25T16:08:02Z</updated>

		<summary type="html">&lt;p&gt;Hinman: /* Save Firewall Rules */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will assist you in setting up networking on Alpine Linux.&lt;br /&gt;
{{Note|You must be logged in as root in order to perform the actions on this page.}}&lt;br /&gt;
&lt;br /&gt;
= Setting System Hostname =&lt;br /&gt;
To set the system hostname, do something like the following:&lt;br /&gt;
{{Cmd|echo &amp;quot;hostname.domain.com&amp;quot; &amp;gt; /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
Then, to activate the change, do the following:&lt;br /&gt;
{{Cmd|hostname -F /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using IPv6, you should also add the following special IPv6 addresses to your &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;
fe00::0         ipv6-localnet&lt;br /&gt;
ff00::0         ipv6-mcastprefix&lt;br /&gt;
ff02::1         ipv6-allnodes&lt;br /&gt;
ff02::2         ipv6-allrouters&lt;br /&gt;
ff02::3         ipv6-allhosts&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you are going to use automatic IP configuration, such as IPv4 DHCP or IPv6 Stateless Autoconfiguration, you can skip ahead to [[#Configuring_DNS|Configuring DNS]].  Otherwise, if you are going to use a static IPv4 or IPv6 address, continue below.}}&lt;br /&gt;
&lt;br /&gt;
For a static IP configuration, it&#039;s common to also add the machine&#039;s hostname you just set (above) to the &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an IPv4 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.150   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s an IPv6 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;2001:470:ffff:ff::2   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configuring DNS =&lt;br /&gt;
{{Warning|&#039;&#039;&#039;For users of IPv4 DHCP:&#039;&#039;&#039; Please note that &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will be completely overwritten with any nameservers provided by DHCP. Also, if DHCP does not provide any nameservers, then &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will still be overwritten, but will not contain any nameservers! &#039;&#039;&#039;&#039;&#039;Note to self: This behavior should probably be reported to upstream.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
{{Note|&#039;&#039;&#039;For users of IPv6 Stateless Autoconfiguration:&#039;&#039;&#039; The above warning doesn&#039;t seem to be an issue here, however, I would advise caution.}}&lt;br /&gt;
&lt;br /&gt;
For using a static IP and static nameservers, use one of the following examples.&lt;br /&gt;
&lt;br /&gt;
For IPv4 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://en.wikipedia.org/wiki/Google_Public_DNS Google&#039;s Public DNS servers].&lt;br /&gt;
{{Cmd|nameserver 8.8.8.8&lt;br /&gt;
nameserver 8.8.4.4}}&lt;br /&gt;
&lt;br /&gt;
For IPv6 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://www.he.net/ Hurricane Electric&#039;s] public DNS server.&lt;br /&gt;
{{Cmd|nameserver 2001:470:20::2}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you decide to use Hurricane Electric&#039;s nameserver, be aware that it is &#039;Google-whitelisted&#039;. What does this mean?  It allows you access to many of Google&#039;s services via IPv6. (Just don&#039;t add other, non-whitelisted, nameservers to &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — ironically, such as Google&#039;s Public IPv4 DNS Servers in the first example.) Read [http://www.google.com/intl/en/ipv6/ here] for more information.}}&lt;br /&gt;
&lt;br /&gt;
= Enabling IPv6 (Optional) =&lt;br /&gt;
&lt;br /&gt;
If you use IPv6, do the following to enable IPv6 for now and at each boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;modprobe ipv6&lt;br /&gt;
echo &amp;quot;ipv6&amp;quot; &amp;gt;&amp;gt; /etc/modules&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Interface Configuration =&lt;br /&gt;
&lt;br /&gt;
== Loopback Configuration (Required) ==&lt;br /&gt;
To configure loopback, add the following to a new file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above works to setup the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address (&amp;lt;code&amp;gt;::1&amp;lt;/code&amp;gt;) — if you enabled IPv6.&lt;br /&gt;
&lt;br /&gt;
== Ethernet Configuration ==&lt;br /&gt;
For the following Ethernet configuration examples, we will assume that you are using Ethernet device &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Initial Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, above any IP configuration for &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto eth0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 DHCP Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Stateless Autoconfiguration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 manual&lt;br /&gt;
        pre-up echo 1 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;&#039;&#039;The inet6 &amp;quot;manual&amp;quot; method is not yet available in busybox.  A patch has been submitted for review.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Dual-Stack Configuration ==&lt;br /&gt;
This example shows a dual-stack configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firewalling with iptables and ip6tables =&lt;br /&gt;
== Install iptables ==&lt;br /&gt;
{{ Cmd|apk add iptables }}&lt;br /&gt;
&lt;br /&gt;
== Configure iptables/ip6tables ==&lt;br /&gt;
== Save Firewall Rules ==&lt;br /&gt;
# Set iptables to start on reboot&lt;br /&gt;
#* {{ Cmd| rc-update add iptables }}&lt;br /&gt;
#Write the firewall rules to disk&lt;br /&gt;
#* {{ Cmd| /etc/init.d/iptables save}}&lt;br /&gt;
# Add the firewall rules to lbu&lt;br /&gt;
#*{{ Cmd| lbu add /var/lib/iptables/rules-save }}&lt;br /&gt;
# Save the configuration&lt;br /&gt;
#*{{ Cmd| lbu ci }}&lt;br /&gt;
&lt;br /&gt;
= Activating Changes and Testing Connectivity =&lt;br /&gt;
Changes made to &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; can be activated by running:&lt;br /&gt;
{{Cmd|/etc/init.d/networking restart}}&lt;br /&gt;
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:&lt;br /&gt;
{{Cmd|ping www.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;PING www.l.google.com (74.125.47.103) 56(84) bytes of data.&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=1 ttl=48 time=58.5 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=2 ttl=48 time=56.4 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=3 ttl=48 time=57.0 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=4 ttl=48 time=60.2 ms&lt;br /&gt;
^C&lt;br /&gt;
--- www.l.google.com ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 received, 0% packet loss, time 3007ms&lt;br /&gt;
rtt min/avg/max/mdev = 56.411/58.069/60.256/1.501 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an IPv6 traceroute (&amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;), you will first need to install the &amp;lt;code&amp;gt;iputils&amp;lt;/code&amp;gt; package:&lt;br /&gt;
{{Cmd|apk add iputils}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{Cmd|traceroute6 ipv6.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;traceroute to ipv6.l.google.com (2001:4860:8009::67) from 2001:470:ffff:ff::2, 30 hops max, 16 byte packets&lt;br /&gt;
 1  2001:470:ffff:ff::1 (2001:470:ffff:ff::1)  3.49 ms  0.62 ms  0.607 ms&lt;br /&gt;
 2  *  *  *&lt;br /&gt;
 3  *  *  *&lt;br /&gt;
 4  pr61.iad07.net.google.com (2001:504:0:2:0:1:5169:1)  134.313 ms  95.342 ms  88.425 ms&lt;br /&gt;
 5  2001:4860::1:0:9ff (2001:4860::1:0:9ff)  100.759 ms  100.537 ms  89.907 ms&lt;br /&gt;
 6  2001:4860::1:0:5db (2001:4860::1:0:5db)  115.563 ms  102.946 ms  106.191 ms&lt;br /&gt;
 7  2001:4860::2:0:a7 (2001:4860::2:0:a7)  101.754 ms  100.475 ms  100.512 ms&lt;br /&gt;
 8  2001:4860:0:1::c3 (2001:4860:0:1::c3)  99.272 ms  111.989 ms  99.835 ms&lt;br /&gt;
 9  yw-in-x67.1e100.net (2001:4860:8009::67)  101.545 ms  109.675 ms  99.431 ms&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hinman</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4542</id>
		<title>Configure Networking</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Configure_Networking&amp;diff=4542"/>
		<updated>2010-10-25T15:13:08Z</updated>

		<summary type="html">&lt;p&gt;Hinman: /* Install iptables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page will assist you in setting up networking on Alpine Linux.&lt;br /&gt;
{{Note|You must be logged in as root in order to perform the actions on this page.}}&lt;br /&gt;
&lt;br /&gt;
= Setting System Hostname =&lt;br /&gt;
To set the system hostname, do something like the following:&lt;br /&gt;
{{Cmd|echo &amp;quot;hostname.domain.com&amp;quot; &amp;gt; /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
Then, to activate the change, do the following:&lt;br /&gt;
{{Cmd|hostname -F /etc/hostname}}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re using IPv6, you should also add the following special IPv6 addresses to your &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file:&lt;br /&gt;
&amp;lt;pre&amp;gt;::1             localhost ipv6-localhost ipv6-loopback&lt;br /&gt;
fe00::0         ipv6-localnet&lt;br /&gt;
ff00::0         ipv6-mcastprefix&lt;br /&gt;
ff02::1         ipv6-allnodes&lt;br /&gt;
ff02::2         ipv6-allrouters&lt;br /&gt;
ff02::3         ipv6-allhosts&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you are going to use automatic IP configuration, such as IPv4 DHCP or IPv6 Stateless Autoconfiguration, you can skip ahead to [[#Configuring_DNS|Configuring DNS]].  Otherwise, if you are going to use a static IPv4 or IPv6 address, continue below.}}&lt;br /&gt;
&lt;br /&gt;
For a static IP configuration, it&#039;s common to also add the machine&#039;s hostname you just set (above) to the &amp;lt;code&amp;gt;/etc/hosts&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an IPv4 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;192.168.1.150   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s an IPv6 example:&lt;br /&gt;
&amp;lt;pre&amp;gt;2001:470:ffff:ff::2   hostname.domain.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Configuring DNS =&lt;br /&gt;
{{Warning|&#039;&#039;&#039;For users of IPv4 DHCP:&#039;&#039;&#039; Please note that &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will be completely overwritten with any nameservers provided by DHCP. Also, if DHCP does not provide any nameservers, then &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; will still be overwritten, but will not contain any nameservers! &#039;&#039;&#039;&#039;&#039;Note to self: This behavior should probably be reported to upstream.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
{{Note|&#039;&#039;&#039;For users of IPv6 Stateless Autoconfiguration:&#039;&#039;&#039; The above warning doesn&#039;t seem to be an issue here, however, I would advise caution.}}&lt;br /&gt;
&lt;br /&gt;
For using a static IP and static nameservers, use one of the following examples.&lt;br /&gt;
&lt;br /&gt;
For IPv4 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://en.wikipedia.org/wiki/Google_Public_DNS Google&#039;s Public DNS servers].&lt;br /&gt;
{{Cmd|nameserver 8.8.8.8&lt;br /&gt;
nameserver 8.8.4.4}}&lt;br /&gt;
&lt;br /&gt;
For IPv6 nameservers, edit your &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; file to look like this:&amp;lt;br /&amp;gt;&lt;br /&gt;
This example uses [http://www.he.net/ Hurricane Electric&#039;s] public DNS server.&lt;br /&gt;
{{Cmd|nameserver 2001:470:20::2}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|If you decide to use Hurricane Electric&#039;s nameserver, be aware that it is &#039;Google-whitelisted&#039;. What does this mean?  It allows you access to many of Google&#039;s services via IPv6. (Just don&#039;t add other, non-whitelisted, nameservers to &amp;lt;code&amp;gt;/etc/resolv.conf&amp;lt;/code&amp;gt; — ironically, such as Google&#039;s Public IPv4 DNS Servers in the first example.) Read [http://www.google.com/intl/en/ipv6/ here] for more information.}}&lt;br /&gt;
&lt;br /&gt;
= Enabling IPv6 (Optional) =&lt;br /&gt;
&lt;br /&gt;
If you use IPv6, do the following to enable IPv6 for now and at each boot:&lt;br /&gt;
&amp;lt;pre&amp;gt;modprobe ipv6&lt;br /&gt;
echo &amp;quot;ipv6&amp;quot; &amp;gt;&amp;gt; /etc/modules&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Interface Configuration =&lt;br /&gt;
&lt;br /&gt;
== Loopback Configuration (Required) ==&lt;br /&gt;
To configure loopback, add the following to a new file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above works to setup the IPv4 loopback address (127.0.0.1), and the IPv6 loopback address (&amp;lt;code&amp;gt;::1&amp;lt;/code&amp;gt;) — if you enabled IPv6.&lt;br /&gt;
&lt;br /&gt;
== Ethernet Configuration ==&lt;br /&gt;
For the following Ethernet configuration examples, we will assume that you are using Ethernet device &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Initial Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, above any IP configuration for &amp;lt;code&amp;gt;eth0&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;auto eth0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 DHCP Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet dhcp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv4 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Stateless Autoconfiguration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 manual&lt;br /&gt;
        pre-up echo 1 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|&#039;&#039;&#039;&#039;&#039;The inet6 &amp;quot;manual&amp;quot; method is not yet available in busybox.  A patch has been submitted for review.&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
=== IPv6 Static Address Configuration ===&lt;br /&gt;
Add the following to the file &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt;, below the &amp;lt;code&amp;gt;auto eth0&amp;lt;/code&amp;gt; definition:&lt;br /&gt;
&amp;lt;pre&amp;gt;iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example: Dual-Stack Configuration ==&lt;br /&gt;
This example shows a dual-stack configuration.&lt;br /&gt;
&amp;lt;pre&amp;gt;auto lo&lt;br /&gt;
iface lo inet loopback&lt;br /&gt;
&lt;br /&gt;
auto eth0&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet static&lt;br /&gt;
        address 192.168.1.150&lt;br /&gt;
        netmask 255.255.255.0&lt;br /&gt;
        gateway 192.168.1.1&lt;br /&gt;
&lt;br /&gt;
iface eth0 inet6 static&lt;br /&gt;
        address 2001:470:ffff:ff::2&lt;br /&gt;
        netmask 64&lt;br /&gt;
        gateway 2001:470:ffff:ff::1&lt;br /&gt;
        pre-up echo 0 &amp;gt; /proc/sys/net/ipv6/conf/eth0/accept_ra&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Firewalling with iptables and ip6tables =&lt;br /&gt;
== Install iptables ==&lt;br /&gt;
{{ Cmd|apk add iptables }}&lt;br /&gt;
&lt;br /&gt;
== Configure iptables/ip6tables ==&lt;br /&gt;
== Save Firewall Rules ==&lt;br /&gt;
&lt;br /&gt;
= Activating Changes and Testing Connectivity =&lt;br /&gt;
Changes made to &amp;lt;code&amp;gt;/etc/network/interfaces&amp;lt;/code&amp;gt; can be activated by running:&lt;br /&gt;
{{Cmd|/etc/init.d/networking restart}}&lt;br /&gt;
If you did not get any errors, you can now test that networking is configured properly by attempting to ping out:&lt;br /&gt;
{{Cmd|ping www.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;PING www.l.google.com (74.125.47.103) 56(84) bytes of data.&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=1 ttl=48 time=58.5 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=2 ttl=48 time=56.4 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=3 ttl=48 time=57.0 ms&lt;br /&gt;
64 bytes from yw-in-f103.1e100.net (74.125.47.103): icmp_seq=4 ttl=48 time=60.2 ms&lt;br /&gt;
^C&lt;br /&gt;
--- www.l.google.com ping statistics ---&lt;br /&gt;
4 packets transmitted, 4 received, 0% packet loss, time 3007ms&lt;br /&gt;
rtt min/avg/max/mdev = 56.411/58.069/60.256/1.501 ms&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For an IPv6 traceroute (&amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;), you will first need to install the &amp;lt;code&amp;gt;iputils&amp;lt;/code&amp;gt; package:&lt;br /&gt;
{{Cmd|apk add iputils}}&lt;br /&gt;
&lt;br /&gt;
Then run &amp;lt;code&amp;gt;traceroute6&amp;lt;/code&amp;gt;:&lt;br /&gt;
{{Cmd|traceroute6 ipv6.google.com}}&lt;br /&gt;
&amp;lt;pre&amp;gt;traceroute to ipv6.l.google.com (2001:4860:8009::67) from 2001:470:ffff:ff::2, 30 hops max, 16 byte packets&lt;br /&gt;
 1  2001:470:ffff:ff::1 (2001:470:ffff:ff::1)  3.49 ms  0.62 ms  0.607 ms&lt;br /&gt;
 2  *  *  *&lt;br /&gt;
 3  *  *  *&lt;br /&gt;
 4  pr61.iad07.net.google.com (2001:504:0:2:0:1:5169:1)  134.313 ms  95.342 ms  88.425 ms&lt;br /&gt;
 5  2001:4860::1:0:9ff (2001:4860::1:0:9ff)  100.759 ms  100.537 ms  89.907 ms&lt;br /&gt;
 6  2001:4860::1:0:5db (2001:4860::1:0:5db)  115.563 ms  102.946 ms  106.191 ms&lt;br /&gt;
 7  2001:4860::2:0:a7 (2001:4860::2:0:a7)  101.754 ms  100.475 ms  100.512 ms&lt;br /&gt;
 8  2001:4860:0:1::c3 (2001:4860:0:1::c3)  99.272 ms  111.989 ms  99.835 ms&lt;br /&gt;
 9  yw-in-x67.1e100.net (2001:4860:8009::67)  101.545 ms  109.675 ms  99.431 ms&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hinman</name></author>
	</entry>
</feed>