mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
Fixed pikvm/pikvm#882: Ethernet settings in pikvm.txt
This commit is contained in:
parent
248d9cf33f
commit
52fdc94eb8
@ -118,6 +118,45 @@ if [ -n "$SSH_PORT" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# ========== Ethernet ==========
|
||||||
|
|
||||||
|
# If the ETH_DHCP is defined, configure eth0 for DHCP
|
||||||
|
if [ -n "$ETH_DHCP" ]; then
|
||||||
|
ETH_IFACE="${ETH_IFACE:-eth0}"
|
||||||
|
cat <<end_of_file > "/etc/systemd/network/$ETH_IFACE.network"
|
||||||
|
[Match]
|
||||||
|
Name=$ETH_IFACE
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
DHCP=yes
|
||||||
|
DNSSEC=no
|
||||||
|
|
||||||
|
[DHCP]
|
||||||
|
# Use same IP by forcing to use MAC address for clientID
|
||||||
|
ClientIdentifier=mac
|
||||||
|
# https://github.com/pikvm/pikvm/issues/583
|
||||||
|
RouteMetric=10
|
||||||
|
end_of_file
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the ETH_ADDR is defined, configure a static address on eth0
|
||||||
|
if [ -n "$ETH_ADDR" ]; then
|
||||||
|
ETH_IFACE="${ETH_IFACE:-eth0}"
|
||||||
|
cat <<end_of_file > "/etc/systemd/network/$ETH_IFACE.network"
|
||||||
|
[Match]
|
||||||
|
Name=$ETH_IFACE
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
Address=$ETH_ADDR
|
||||||
|
DNS=$ETH_DNS
|
||||||
|
DNSSEC=no
|
||||||
|
|
||||||
|
[Route]
|
||||||
|
Gateway=$ETH_GW
|
||||||
|
end_of_file
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ========== Wi-Fi ==========
|
# ========== Wi-Fi ==========
|
||||||
|
|
||||||
# Set the regulatory domain for wifi, if defined.
|
# Set the regulatory domain for wifi, if defined.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user