How to enable or disable IPv6 in Linux

Source: Internet
Author: User

In Linux, the method of enabling and disabling IPv6 is now supported by IPv6 by default. However, for some application servers that do not support IPv6 well, enabling IPv6 affects the server's network performance. After all, the current network switching device is not IPv6. In Linux, first check whether IPv6 has been enabled. You can determine from three aspects. 1. Use ifconfig to check whether your IP address contains an IPv6 address. [Root @ localhost ~] # Ifconfigeth0 Link encap: Ethernet HWaddr 00: EA: 01: 09: 73: AB inet addr: 113.107.xx.xx Bcast: Illegal Mask: 255.255.255.0 inet6 addr: fe80: 2ea: 1ff: fe09: 73ab/64 Scopeink up broadcast running multicast mtu: 1500 Metric: 1 RX packets: 75967 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 43331 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 7847346 (7.4 MiB) TX bytes: 159 737697 (152.3 MiB) Interrupt: 169 2. Check whether the IP address of the Service Listening has an IPv6 Address [root @ localhost ~] # Netstat-lnptActive Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 127.0.0.1: 199 0.0.0.0: * LISTEN 2165/snmpdtcp 0 0 0.0.0.0: 3306 0.0.0.0: * LISTEN 2372/mysqldtcp 0 113.107.xx.xx: 53 0.0.0.0: * LISTEN 2397/namedtcp 0 0 127.0.0.1: 53 0.0.0.0: * LISTEN 2397/namedtcp 0 0 127.0.0.1: 953 0.0.0.0: * LISTEN 2397/namedtcp 0 0 ::: 22 ::* LISTEN 2182/sshdtcp 0: 80: * LISTEN 2517/(squid) 3. Use lsmod to check whether the ipv6 module is loaded [root @ localhost ~] # Lsmod | grep ipv6ipv6 435105 274 cnicxfrm_nalgo 43333 1 ipv6 when IPv6 is enabled, you can disable it as follows. use the vi editor to open/etc/modprobe. conf 2. add the following two in the document: the alias net-pf-10 offalias ipv6 off save and exit, and restart the system. After restarting, you can use the preceding three methods to verify whether IPv6 support has been disabled. IPv6 is supported by default, so when you want to restart IPv6 support, comment out the two commands in/etc/modprobe. conf.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.