linux禁止服务自启动 sysctl,sysctl.conf禁用ipv6导致nfs无法启动的问题解决

背景

虚拟机模板禁用了ipv6,创建了虚拟机

1

2

3

4

5

6

7[root@centos7 ~]# cat /etc/sysctl.conf

# System default settings live in /usr/lib/sysctl.d/00-system.conf.

# To override those settings, enter new settings here, or in an /etc/sysctl.d/.conf file

#

# For more information, see sysctl.conf(5) and sysctl.d(5).

net.ipv6.conf.all.disable_ipv6 =1

net.ipv6.conf.default.disable_ipv6 =1

启动nfs报错,报错如下

Error:

rpcbind service fails to start with below error message in /var/log/messages

1

2rpcbind.socket failed to listen on sockets: Address family not support

ed by protocol

I got this error the other day while working on Red Hat Enterprise Linux 7.3 and after digging for a while I got to know there is a sort of a BUG in RHEL 7.3.

Analysis:

I found a BUG reported for this issue and I was facing the exact one.

As explained by one of the engineers on the above page

1"The problem is that if you disable ipv6 n sysctl.conf, it is not disabled from the beginning of the boot, but actually quite late in the boot process. Meanwhile systemd found out that ipv6 is enabled and scheduled a start of a socket, that would listen on ipv6."

Just to summarise if you have disabled ipv6 using your sysctl configurations then it is disabled only on kernel level but not via GRUB so it is not disabled completely hence systemd will attempt to make a connection on port 111 on any ipv6 address, [::]:111 during the boot up.

To know more on how to disable ipv6 follow below link

How to disable or enable ipv6 in Linux

解决办法:

/etc/sysctl.conf

1net.ipv6.conf.all.disable_ipv6 = 1

grub级别禁用ipv6

1

2#dracut -v -f

#systemctl start rpcbind

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值