Linux 系統(tǒng)如何禁用 IPV6, 使用的操縱系統(tǒng)是 RHEL7.3

更改/etc/sysctl.conf配置文件

[root@Jaking vsftpd]# vim /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
net.ipv6.conf.default.disable_ipv6 = 1
                                              
[root@Jaking vsftpd]# ifconfig
# IPV6 字段 inet6 fe80::250:56ff:fe22:db62
ens33: flags=4163mtu 1500
        inet 192.168.10.11  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::250:56ff:fe22:db62  prefixlen 64  scopeid 0x20
        ether 00:50:56:22:db:62  txqueuelen 1000  (Ethernet)
        RX packets 11717  bytes 4355183 (4.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6943  bytes 2011730 (1.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10loop  txqueuelen 1  (Local Loopback)
        RX packets 112  bytes 9492 (9.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 9492 (9.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@Jaking vsftpd]# sysctl -p  #讓配置文件立即生效
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
[root@Jaking vsftpd]# ifconfig 
# IPV6 字段已經(jīng)消失
ens33: flags=4163mtu 1500
        inet 192.168.10.11  netmask 255.255.255.0  broadcast 192.168.10.255
        ether 00:50:56:22:db:62  txqueuelen 1000  (Ethernet)
        RX packets 11747  bytes 4357703 (4.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6961  bytes 2014592 (1.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lo: flags=73mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 112  bytes 9492 (9.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 112  bytes 9492 (9.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

總結(jié)

以上就是 Linux 系統(tǒng)如何禁用 IPV6 的方法,希望能給大家?guī)韼椭?/p>

原文地址:
https://www.linuxprobe.com/linux-forbidden-ipv6.html

更多關(guān)于云服務(wù)器,域名注冊(cè),虛擬主機(jī)的問題,請(qǐng)?jiān)L問三五互聯(lián)官網(wǎng):m.shinetop.cn

贊(0)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享網(wǎng)絡(luò)內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。郵箱:3140448839@qq.com。本站原創(chuàng)內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明出處:三五互聯(lián)知識(shí)庫 » 實(shí)戰(zhàn):Linux 系統(tǒng)如何禁用 IPV6

登錄

找回密碼

注冊(cè)