How to Disable IPv6 on linux

[root@server ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.31.1.100 netmask 255.255.255.0 broadcast 172.31.1.255
inet6 2a01:4f8:c0c:1537::2 prefixlen 64 scopeid 0x0
inet6 fe80::5054:a2ff:fe01:df66 prefixlen 64 scopeid 0x20 ether 52:54:a2:01:df:66 txqueuelen 1000 (Ethernet)
RX packets 4807270 bytes 944177390 (900.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4882177 bytes 1220152635 (1.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
~
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1 (Local Loopback)
RX packets 52217 bytes 5548077 (5.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 52217 bytes 5548077 (5.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@server ~]# vi /etc/modprobe.conf
# add to the end
alias ipv6 off
options ipv6 disable=1
#save and exit
[root@server ~]#reboot
[root@server ~]#ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.31.1.100 netmask 255.255.255.0 broadcast 172.31.1.255
52:54:a2:01:df:66 txqueuelen 1000 (Ethernet)
RX packets 4807270 bytes 944177390 (900.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4882177 bytes 1220152635 (1.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
~
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 52217 bytes 5548077 (5.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 52217 bytes 5548077 (5.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Leave a Reply

avatar
  Subscribe  
Notify of