summaryrefslogtreecommitdiff
path: root/alpine/networking.sh
diff options
context:
space:
mode:
authorMaria Lisina <sekoohaka.sarisan@gmail.com>2026-08-20 21:01:58 +0500
committerMaria Lisina <sekoohaka.sarisan@gmail.com>2026-08-20 21:01:58 +0500
commit396b18a36a8ee72d347de9af5383f2a8a91c8e67 (patch)
tree8c29d6d2e758b08528143543ac12a027b0ba6ef7 /alpine/networking.sh
parent8a1b3be58997c81ac808fbe672f222791aae8ece (diff)
Add old scripts
Signed-off-by: Maria Lisina <sekoohaka.sarisan@gmail.com>
Diffstat (limited to 'alpine/networking.sh')
-rwxr-xr-xalpine/networking.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/alpine/networking.sh b/alpine/networking.sh
new file mode 100755
index 0000000..8c5eff0
--- /dev/null
+++ b/alpine/networking.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+# Copyright (C) 2025-2026 Maria Lisina
+# SPDX-License-Identifier: Apache-2.0
+#
+# networking configuration
+
+set -e
+
+if [ -n "${1}" ]
+then
+ __hostname="${1}"
+ shift
+else
+ __hostname="localhost"
+fi
+
+echo ${__hostname} > /etc/hostname
+
+cat << EOF > /etc/network/interfaces
+auto lo
+iface lo inet loopback
+
+auto eth0
+iface eth0 inet dhcp
+
+auto eth1
+iface eth1 inet static
+ address 172.16.0.1
+ netmask 255.240.0.0
+iface eth1 inet6 auto
+EOF
+
+cat << EOF > /etc/resolv.conf
+nameserver 8.8.8.8
+nameserver 8.8.4.4
+nameserver 2001:4860:4860::8888
+nameserver 2001:4860:4860::8844
+EOF
+
+cat << EOF > /etc/hosts
+127.0.0.1 localhost ${__hostname}
+::1 localhost ipv6-localhost ipv6-loopback ${__hostname}
+fe00::0 ipv6-localnet
+ff00::0 ipv6-mcastprefix
+ff02::1 ipv6-allnodes
+ff02::2 ipv6-allrouters
+ff02::3 ipv6-allhosts
+EOF