Skip to content

Commit 207289e

Browse files
committed
chore: ubuntu 24.04 has moved to use networkd and netplan by default,
... rather than the traditional dhclient.conf approach.
1 parent e8b0ad5 commit 207289e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ebssurrogate/scripts/chroot-bootstrap-nix.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,19 @@ function disable_fsck {
157157

158158
# Don't request hostname during boot but set hostname
159159
function setup_hostname {
160-
sed -i 's/gethostname()/ubuntu /g' /etc/dhcp/dhclient.conf
161-
sed -i 's/host-name,//g' /etc/dhcp/dhclient.conf
160+
# Set the static hostname
162161
echo "ubuntu" > /etc/hostname
163162
chmod 644 /etc/hostname
163+
# Update netplan configuration to not send hostname
164+
cat << EOF > /etc/netplan/01-hostname.yaml
165+
network:
166+
version: 2
167+
ethernets:
168+
eth0:
169+
dhcp4: true
170+
dhcp4-overrides:
171+
send-hostname: false
172+
EOF
164173
}
165174

166175
# Set options for the default interface

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy