Skip to content

Commit

Permalink
el: 修复 dhcpv6 + ifcfg 下没有获取网关
Browse files Browse the repository at this point in the history
  • Loading branch information
bin456789 committed Dec 6, 2024
1 parent 5dee9da commit b96f72e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions trans.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3376,11 +3376,13 @@ install_qcow_by_copy() {
rm -rf /os/etc/NetworkManager/system-connections/*.nmconnection
rm -rf /os/etc/sysconfig/network-scripts/ifcfg-*

# 修复 cloud-init 添加了 IPV*_FAILURE_FATAL
# 甲骨文 dhcp6 获取不到 IP 将视为 fatal,原有的 ipv4 地址也会被删除
# 1. 修复 cloud-init 添加了 IPV*_FAILURE_FATAL
# 甲骨文 dhcp6 获取不到 IP 将视为 fatal,原有的 ipv4 地址也会被删除
# 2. 修复 dhcpv6 下,ifcfg 添加了 IPV6_AUTOCONF=no 导致无法获取网关
insert_into_file $ci_file after '^runcmd:' <<EOF
- sed -i '/IPV4_FAILURE_FATAL/d' /etc/sysconfig/network-scripts/ifcfg-* || true
- sed -i '/IPV6_FAILURE_FATAL/d' /etc/sysconfig/network-scripts/ifcfg-* || true
- for f in /etc/sysconfig/network-scripts/ifcfg-*; do grep -q '^DHCPV6C=yes' "\$f" && sed -i '/IPV6_AUTOCONF=no/d' "\$f"; done
- systemctl restart NetworkManager
EOF

Expand Down

0 comments on commit b96f72e

Please sign in to comment.