Commit a0068021 authored by Konstantin A. Lepikhov's avatar Konstantin A. Lepikhov Committed by Anton Midyukov

use/net-eth: add dhcp ipv4 only support for networkd

parent 7d631a48
......@@ -25,4 +25,7 @@ use/net-eth/dhcp/timeout/%: use/net-eth/dhcp
use/net-eth/networkd-dhcp: use/net-eth/networkd
@$(call add,NET_ETH,eth0:dhcp)
use/net-eth/networkd-dhcp4: use/net-eth/networkd
@$(call add,NET_ETH,eth0:dhcp4)
# use e.g. eth0:static:10.0.0.2/24:10.0.0.1 for predefined static configuration
......@@ -22,7 +22,7 @@ SYSTEMD_IFDIR="/etc/systemd/network"
write_iface() {
case "$proto" in
dhcp)
dhcp*)
;;
static)
[ -n "$ipv4addr" ] || fatal "ipv4addr missing"
......@@ -41,7 +41,7 @@ write_etcnet_iface() {
mkdir -p "$dir"
append=
case "$proto" in
dhcp)
dhcp*)
append="DHCP_TIMEOUT=$GLOBAL_NET_ETH_TIMEOUT"
;;
static)
......@@ -62,6 +62,21 @@ write_etcnet_iface() {
write_systemd_iface() {
case "$proto" in
dhcp4)
echo "[Match]"
echo "Name=$iface"
echo
echo "[Network]"
echo "DHCP=ipv4"
echo "IPv6AcceptRA=no"
echo "LinkLocalAddressing=ipv4"
echo
echo "[DHCP]"
echo "UseMTU=yes"
echo "UseDomains=yes"
echo "UseNTP=yes"
echo
;;
dhcp)
echo "[Match]"
echo "Name=$iface"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment