使用云主机时要注意的情况

使用云主机时,会发现端口被tcp6占用的情况,这时需要编辑 /etc/sysctl文件 ,在文件尾部添加配置如下:

[root@10-7-80-221 ~]# 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 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0
##add my code
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipb6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
##end my code

重启云主机和服务后,使用netstat -tunlp来确认更改是否效,同时检查云主机安全设置,是否放通相应端口

你可能感兴趣的:(linux,服务器,运维)