大网数据广告活动
服务器运维问答

Firewalld blocks IPv6, ignores config

· 52CE 我爱测

I'm trying to setup an IPv6 web-server on CentOS 7.2 with NGINX. I have tested my IPv6 connectivity outgoing and incoming - everything works. My IP, AAAA records, etc as fine as well. Essentially everything is OK until I enable F…

问题原文

原帖链接 · kgizdov · CC BY-SA 3.0

I'm trying to setup an IPv6 web-server on CentOS 7.2 with NGINX. I have tested my IPv6 connectivity outgoing and incoming - everything works. My IP, AAAA records, etc as fine as well. Essentially everything is OK until I enable FirewallD.

I have it set up to default to the drop zone with eth0 interface. I have enabled dhcpv6-client, http, https and ssh (ssh is on a custom port). When the firewall is enabled no IPv6 traffic can leave or enter the machine. Traceroute6 to anything (even the gateway) only goes to localhost. If I disable the firewall, it's all good.

I have no idea why this is happening. I couldn't find anything online in order to make FirewallD apply the same IPv4 config to the IPv6 traffic. I personally thought, it would do that automatically, as all of its commands are IP protocol agnostic.

Any help is much appreciated.

已采纳解答

原帖链接 · Mark · CC BY-SA 3.0

I ran into the same issue. After following the logic through the rules that firewalld puts in I found that the drop zone was blocking ipv6 icmp that is needed to find the ipv6 neighbors. There is a rule to allow all ipv6 icmp but firewalld puts it after the input zones which is where the drop rules go.

If you want to see this for yourself just look at the output from 'ip6tables -L -n -v'

So, a quick and dirty fix is to do this:

firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 0 -p icmpv6 -j ACCEPT

Firewalld puts the direct rules before the other input rules so that will happen before the drop rules. If you want to block things like ping you would also use a direct rule but you would need it before the rule above.

You would do something like:

firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 0 -p icmpv6 --icmpv6-type 128 -j DROP
firewall-cmd --permanent --direct --add-rule ipv6 filter INPUT 1 -p icmpv6 -j ACCEPT

The priorities will keep them in order.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。