2021-11-14 14:32:08 +08:00

33 lines
688 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Ipv6 笔记"
date: 2019-10-29T21:07:06+08:00
lastmod: 2019-10-29T21:07:06+08:00
keywords: []
tags: ["ipv6", "centos"]
categories: ["network"]
---
# CentOS7 禁用 ipv6
## 方法1
- 编辑 /etc/sysctl.conf增加如下内容
```
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1
```
- 如果你想要为特定的网卡禁止IPv6比如对于enp0s3添加下面的行
```
net.ipv6.conf.enp0s3.disable_ipv6 =1
```
- 生效
```bash
sysctl -p
```
## 方法2
- 执行下面命令
```bash
echo 1>/proc/sys/net/ipv6/conf/all/disable_ipv6
echo 1>/proc/sys/net/ipv6/conf/default/disable_ipv6
```