在新创建的rhel9 VM中,环回接口不包括IPv6地址,但/etc/hosts包含用于本地主机的::1条目
[vagrant@el9-test-fd5843e6 ~]$ ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:02:41:69 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute eth0
valid_lft 85325sec preferred_lft 85325sec
inet6 fe80::a00:27ff:fe02:4169/64 scope link noprefixroute
valid_lft forever preferred_lft forever[vagrant@el9-test-fd5843e6 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 rhel9.localdomain如何配置环回接口的IPv6地址?为便于参考,我使用下面的迷航框https://app.vagrantup.com/generic/boxes/rhel9对此进行测试
发布于 2022-09-15 02:39:49
这与RHEL 9无关。您使用的是显式禁用的IPv6;查看一下/etc/sysctl.conf:
[root@node1 sysctl.d]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv6.conf.all.disable_ipv6 = 1删除或注释掉该行并重新启动(或只运行sysctl -w net.ipv6.conf.all.disable_ipv6=0),您就应该都设置好了。只要更改sysctl,就会产生以下结果:
[root@node1 sysctl.d]# ip -6 addr
1: lo: mtu 65536 state UNKNOWN qlen 1000
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 state UP qlen 1000
inet6 fe80::5054:ff:fe62:ca84/64 scope link
valid_lft forever preferred_lft foreverhttps://serverfault.com/questions/1110754
复制相似问题