Update InstallNET.sh

This commit is contained in:
Molly Lau 2023-07-28 06:32:06 +09:00 committed by GitHub
parent 5a8edbac08
commit 39194e4bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -510,7 +510,7 @@ function transferIPv4AddressFormat() {
# Common ranges of IPv4 intranet:
# Reference: https://hczhang.cn/network/reserved-ip-addresses.html
[[ "$ip4AddrFirst""$ip4AddrSecond" != "$ip4GateFirst""$ip4GateSecond" ]] && {
[[ "$ip4GateFirst" == "169" && "$ip4GateSecond" == "254" ]] || [[ "$ip4GateFirst" == "172" && "$ip4GateSecond" -ge "16" && "$ip4GateSecond" -le "31" ]] || [[ "$ip4GateFirst" == "10" && "$ip4GateSecond" -ge "0" && "$ip4GateSecond" -le "255" ]] || [[ "$ip4GateFirst" == "192" && "$ip4GateSecond" == "168" ]] || [[ "$ip4GateFirst" == "127" && "$ip4GateSecond" -ge "0" && "$ip4GateSecond" -le "255" ]] || [[ "$ip4GateFirst" == "198" && "$ip4GateSecond" -ge "18" && "$ip4GateSecond" -le "19" ]] || [[ "$ip4GateFirst" == "100" && "$ip4GateSecond" -ge "64" && "$ip4GateSecond" -le "127" ]] && {
[[ "$ip4AddrFirst" != "$ip4GateFirst" ]] || [[ "$ip4GateFirst" == "169" && "$ip4GateSecond" == "254" ]] || [[ "$ip4GateFirst" == "172" && "$ip4GateSecond" -ge "16" && "$ip4GateSecond" -le "31" ]] || [[ "$ip4GateFirst" == "10" && "$ip4GateSecond" -ge "0" && "$ip4GateSecond" -le "255" ]] || [[ "$ip4GateFirst" == "192" && "$ip4GateSecond" == "168" ]] || [[ "$ip4GateFirst" == "127" && "$ip4GateSecond" -ge "0" && "$ip4GateSecond" -le "255" ]] || [[ "$ip4GateFirst" == "198" && "$ip4GateSecond" -ge "18" && "$ip4GateSecond" -le "19" ]] || [[ "$ip4GateFirst" == "100" && "$ip4GateSecond" -ge "64" && "$ip4GateSecond" -le "127" ]] && {
# [[ -z "$ip4RouteScopeLink" ]] && ipGate=`ipv4Calc "$1" "$ipPrefix" | grep "FirstIP:" | awk '{print$2}'` || ipGate=`ipv4Calc "$ip4RouteScopeLink" "$ipPrefix" | grep "FirstIP:" | awk '{print$2}'`
# Temporary installation of Debian is "BusyBox", it can't handle IPv4 public address and IPv4 private gateway well, so we prefer to use IPv6 to configure network and write static configs for IPv4 in later of installation.
[[ "$IPStackType" == "BiStack" ]] && { ipPrefix="$actualIp4Prefix"; ipMask="$actualIp4Subnet"; BiStackPreferIpv6='1'; Network4Config="isStatic"; }