mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
centos 7: 避免 yum 在没 ipv6 的情况下使用 ipv6
This commit is contained in:
parent
c87b2dd58d
commit
f822eea94e
@ -202,3 +202,5 @@ echo "$ipv4_addr" >/dev/ipv4_addr
|
||||
echo "$ipv4_gateway" >/dev/ipv4_gateway
|
||||
echo "$ipv6_addr" >/dev/ipv6_addr
|
||||
echo "$ipv6_gateway" >/dev/ipv6_gateway
|
||||
$ipv4_has_internet && echo 1 >/dev/ipv4_has_internet || echo 0 >/dev/ipv4_has_internet
|
||||
$ipv6_has_internet && echo 1 >/dev/ipv6_has_internet || echo 0 >/dev/ipv6_has_internet
|
||||
|
7
trans.sh
7
trans.sh
@ -2059,6 +2059,13 @@ install_qcow_el() {
|
||||
# 部分镜像例如 centos7 要手动删除 machine-id
|
||||
truncate_machine_id /os
|
||||
|
||||
# centos 7 yum 可能会使用 ipv6,即使没有 ipv6 网络
|
||||
if grep 'centos:7' /os/etc/system-release-cpe; then
|
||||
if [ "$(cat /dev/ipv6_has_internet)" = "0" ]; then
|
||||
echo 'ip_resolve=4' >>/os/etc/yum.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
# 为 centos 7 ci 安装 NetworkManager
|
||||
# 1. 能够自动配置 onlink 网关
|
||||
# 2. 解决 cloud-init 关闭了 ra,因为 nm 无视内核 ra 设置
|
||||
|
Loading…
x
Reference in New Issue
Block a user