aboutsummaryrefslogtreecommitdiffstats
path: root/chapter9/network.sh
diff options
context:
space:
mode:
Diffstat (limited to 'chapter9/network.sh')
-rw-r--r--chapter9/network.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/chapter9/network.sh b/chapter9/network.sh
new file mode 100644
index 0000000..e1386a4
--- /dev/null
+++ b/chapter9/network.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+pushd /etc/sysconfig/ >/dev/null || exit 1
+cat > ifconfig.eth0 << "EOF"
+ONBOOT=yes
+IFACE=eth0
+SERVICE=ipv4-static
+IP=192.168.1.196
+GATEWAY=192.168.1.1
+PREFIX=24
+BROADCAST=192.168.1.255
+EOF
+popd >/dev/null || exit 1
+
+cat > /etc/resolv.conf << "EOF"
+# Begin /etc/resolv.conf
+
+nameserver 192.168.1.10
+domain berzerkula.org
+search berzerkula.org
+
+# End /etc/resolv.conf
+EOF
+
+echo "lfs" > /etc/hostname
+
+cat > /etc/hosts << "EOF"
+# Begin /etc/hosts
+
+127.0.0.1 localhost.localdomain localhost
+127.0.1.1 lfs.berzerkula.org lfs
+192.168.1.196 lfs.berzerkula.org lfs
+::1 localhost ip6-localhost ip6-loopback
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+
+# End /etc/hosts
+EOF