aboutsummaryrefslogtreecommitdiffstats
path: root/chapter9/network.sh
diff options
context:
space:
mode:
Diffstat (limited to 'chapter9/network.sh')
-rw-r--r--chapter9/network.sh29
1 files changed, 11 insertions, 18 deletions
diff --git a/chapter9/network.sh b/chapter9/network.sh
index 4b778cf..d75c5b8 100644
--- a/chapter9/network.sh
+++ b/chapter9/network.sh
@@ -1,27 +1,20 @@
#!/bin/bash
set -e
-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
+pushd /etc/systemd/network >/dev/null || exit 1
+cat > 10-eth-dhcp.network << "EOF"
+[Match]
+Name=eth0
-nameserver 192.168.1.10
-domain berzerkula.org
-search berzerkula.org
+[Network]
+DHCP=ipv4
-# End /etc/resolv.conf
+[DHCP]
+UseDomains=true
EOF
+popd >/dev/null || exit 1
+
+ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf
echo "lfs" > /etc/hostname