Centos/redhat中關閉IPV6

來源:互聯網
上載者:User

1 檢測IPV6是否啟用
1.1 使用ifconfig查看自己的IP地址是否含有IPv6地址
          inet addr:192.168.198.128  Bcast:192.168.198.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fee4:1d8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1080 errors:0 dropped:0 overruns:0 frame:0
          TX packets:890 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:89517 (87.4 KiB)  TX bytes:122147 (119.2 KiB)
          Interrupt:185 Base address:0x1400
    紅色標識部分即為IPV6地址。
1.2 查看服務監聽的IP中是否有IPv6格式的地址
[root@centos ~]# netstat -tulnActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address               Foreign Address             Statetcp        0      0 0.0.0.0:613                 0.0.0.0:*                   LISTENtcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTENtcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTENtcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTENtcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTENtcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTENtcp        0      0 :::80                       :::*                        LISTENtcp        0      0 :::22                       :::*                        LISTENudp        0      0 0.0.0.0:68                  0.0.0.0:*udp        0      0 0.0.0.0:607                 0.0.0.0:*udp        0      0 0.0.0.0:610                 0.0.0.0:*udp        0      0 0.0.0.0:111                 0.0.0.0:*udp        0      0 0.0.0.0:631                 0.0.0.0:*
1.3 使用lsmod|grep ipv6查看ipv6的模組是否被載入
[root@centos ~]# lsmod|grep ipv6ipv6                  243425  19
2 關閉/開啟IPV6
2.1 關閉IPV6
#vi /etc/modprobe.conf
添加下面兩行內容
alias net-pf-10 off
alias ipv6 off
儲存退出,並且重新啟動系統。
重啟之後可以使用上面的三種方法去驗證IPv6支援是否已經被關閉。
2.2 開啟IPV6
IPv6是預設支援的,所以當你要重新開起IPv6支援時,將/etc/modprobe.conf中的兩條指令注釋掉就可以了。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.