##// END OF EJS Templates
Merge branch 'vknecht-net-static'
Jan Wagner -
r38:8c841853ea81 Fusion
parent child
Show More
@@ -37,7 +37,6 Set system `root` password. The same password is used for the created user `pi`.
37 37 ##### `DEFLOCAL`="en_US.UTF-8"
38 38 Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. The script variant `minbase` (ENABLE_MINBASE=true) doesn't install `locales`.
39 39
40
41 40 ##### `TIMEZONE`="Europe/Berlin"
42 41 Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command.
43 42
@@ -48,6 +47,33 These options are used to configure keyboard layout in `/etc/default/keyboard` f
48 47 ##### `XKBVARIANT`=""
49 48 ##### `XKBOPTIONS`=""
50 49
50 #### Networking settings
51 These settings are used to set up networking configuration in `/etc/systemd/network/eth.network`.
52
53 #####`ENABLE_DHCP`=true
54 Set the system to use DHCP. When set to "true", the following `NET_*` settings (used for static configuration) are ignored.
55
56 #####`NET_ADDRESS`=""
57 Set a static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24".
58
59 #####`NET_GATEWAY`=""
60 Set the IP address for the default gateway.
61
62 #####`NET_DNS_1`=""
63 Set the IP address for the first DNS server.
64
65 #####`NET_DNS_2`=""
66 Set the IP address for the second DNS server.
67
68 #####`NET_DNS_DOMAINS`=""
69 Set the default DNS search domains to use for non fully qualified host names.
70
71 #####`NET_NTP_1`=""
72 Set the IP address for the first NTP server.
73
74 #####`NET_NTP_2`=""
75 Set the IP address for the second NTP server.
76
51 77 #### Basic system features:
52 78 ##### `ENABLE_CONSOLE`=true
53 79 Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system.
@@ -50,6 +50,18 XKBLAYOUT=${XKBLAYOUT:=""}
50 50 XKBVARIANT=${XKBVARIANT:=""}
51 51 XKBOPTIONS=${XKBOPTIONS:=""}
52 52
53 # Network settings
54 ENABLE_DHCP=${ENABLE_DHCP:=true}
55 # NET_* settings are ignored when ENABLE_DHCP=true
56 # NET_ADDRESS is an IPv4 or IPv6 address and its prefix, separated by "/"
57 NET_ADDRESS=${NET_ADDRESS:=""}
58 NET_GATEWAY=${NET_GATEWAY:=""}
59 NET_DNS_1=${NET_DNS_1:=""}
60 NET_DNS_2=${NET_DNS_2:=""}
61 NET_DNS_DOMAINS=${NET_DNS_DOMAINS:=""}
62 NET_NTP_1=${NET_NTP_1:=""}
63 NET_NTP_2=${NET_NTP_2:=""}
64
53 65 # APT settings
54 66 APT_PROXY=${APT_PROXY:=""}
55 67 APT_SERVER=${APT_SERVER:="ftp.debian.org"}
@@ -308,6 +320,10 cat <<EOM >$R/etc/hosts
308 320 127.0.0.1 localhost
309 321 127.0.1.1 ${HOSTNAME}
310 322 EOM
323 if [ "$NET_ADDRESS" != "" ] ; then
324 NET_IP=$(echo ${NET_ADDRESS} | cut -f 1 -d'/')
325 sed -i "s/^127.0.1.1/${NET_IP}/" $R/etc/hosts
326 fi
311 327
312 328 # Set up IPv6 hosts
313 329 if [ "$ENABLE_IPV6" = true ] ; then
@@ -325,6 +341,7 cat <<EOM >$R/etc/network/interfaces
325 341 # please configure your networks in '/etc/systemd/network/'
326 342 EOM
327 343
344 if [ "$ENABLE_DHCP" = true ] ; then
328 345 # Enable systemd-networkd DHCP configuration for interface eth0
329 346 cat <<EOM >$R/etc/systemd/network/eth.network
330 347 [Match]
@@ -336,7 +353,23 EOM
336 353
337 354 # Set DHCP configuration to IPv4 only
338 355 if [ "$ENABLE_IPV6" = false ] ; then
339 sed -i "s/=yes/=v4/" $R/etc/systemd/network/eth.network
356 sed -i "s/^DHCP=yes/DHCP=v4/" $R/etc/systemd/network/eth.network
357 fi
358 else # ENABLE_DHCP=false
359 cat <<EOM >$R/etc/systemd/network/eth.network
360 [Match]
361 Name=eth0
362
363 [Network]
364 DHCP=no
365 Address=${NET_ADDRESS}
366 Gateway=${NET_GATEWAY}
367 DNS=${NET_DNS_1}
368 DNS=${NET_DNS_2}
369 Domains=${NET_DNS_DOMAINS}
370 NTP=${NET_NTP_1}
371 NTP=${NET_NTP_2}
372 EOM
340 373 fi
341 374
342 375 # Enable systemd-networkd service
General Comments 0
Vous devez vous connecter pour laisser un commentaire. Se connecter maintenant