Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAT服务器开启并获取独立公网IPv6地址 #17

Open
dalaolala opened this issue Jul 14, 2020 · 0 comments
Open

NAT服务器开启并获取独立公网IPv6地址 #17

dalaolala opened this issue Jul 14, 2020 · 0 comments

Comments

@dalaolala
Copy link
Owner

CentOS7系统开启IPv6功能
有些镜像是禁用了IPv6功能的,因此需要开启。首先查看一下是否被禁用了

sysctl -a | grep ipv6.*disable

sysctl: reading key "net.ipv6.conf.all.stable_secret"

net.ipv6.conf.all.disable_ipv6 = 1

sysctl: net.ipv6.conf.default.disable_ipv6 = 1

reading key "net.ipv6.conf.default.stable_secret"

sysctl: reading key "net.ipv6.conf.eth0.stable_secret"

net.ipv6.conf.eth0.disable_ipv6 = 1

sysctl: reading key "net.ipv6.conf.lo.stable_secret"

net.ipv6.conf.lo.disable_ipv6 = 1

disable=1说明被禁用了,因此需要去修改,配置文件为/etc/sysctl.conf

vi /etc/sysctl.conf

把ipv6 disable的参数都改为0,然后保存,重载服务后生效
执行 sysctl -p

vm.swappiness = 0

net.ipv4.neigh.default.gc_stale_time = 120

net.ipv4.conf.all.rp_filter = 0

net.ipv4.conf.default.rp_filter = 0

net.ipv4.conf.default.arp_announce = 2

net.ipv4.conf.lo.arp_announce = 2

net.ipv4.conf.all.arp_announce = 2

net.ipv4.tcp_max_tw_buckets = 5000

net.ipv4.tcp_syncookies = 1

net.ipv4.tcp_max_syn_backlog = 1024

net.ipv4.tcp_synack_retries = 2

net.ipv6.conf.all.disable_ipv6 = 0

net.ipv6.conf.default.disable_ipv6 = 0

net.ipv6.conf.lo.disable_ipv6 = 0

设置网卡,启用DHCP
修改网卡配置文件:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

在原有配置后面增加输入以下信息:

Networking_IPV6=yes
DHCPV6C=yes
IPV6INIT=yes

然后重启网络:

service network restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant