nftables/nginx가 있는 Debian 11에서 IPv6가 작동하지 않습니다.

nftables/nginx가 있는 Debian 11에서 IPv6가 작동하지 않습니다.

저는 nftables 0.9.8이 설치된 Debian 11 시스템에서 웹 서버(nginx 1.21.6)를 실행하고 있습니다. 내 nftables 구성은 다음과 같습니다.

table inet filter {
chain input {
  type filter hook input priority filter; policy drop;
            ip saddr @spamhaus4 counter packets 0 bytes 0 drop
            ip6 saddr @spamhaus6 counter packets 0 bytes 0 drop
            meta l4proto tcp meta nfproto ipv4 ip saddr @abused counter packets 0 bytes 0 drop
            ip daddr 46.38.148.0-46.38.151.255 drop
            iif "lo" log group 2 accept
            iif != "lo" ip daddr 127.0.0.0/8 counter packets 0 bytes 0 drop comment "drop connections to loopback not coming from loopback"
            iif != "lo" ip6 daddr ::1 counter packets 0 bytes 0 drop comment "drop connections to loopback not coming from loopback"
            ct state established,related log group 2 accept
            ct state invalid counter packets 47 bytes 2572 drop
            tcp dport { 25, 80, 143, 443, 587, 2772, 9980, 45907 } log group 2 accept
            ip protocol icmp icmp type { echo-reply, destination-unreachable, echo-request, router-advertisement, router-solicitation, time-exceeded, parameter-problem } log group 2 accept
            ip6 nexthdr ipv6-icmp icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, echo-request, echo-reply, nd-router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert } log group 2 accept
            ip6 nexthdr ipv6-icmp log group 2 accept
            counter packets 2686 bytes 421604 drop
    }

    chain IPSinput {
            type filter hook input priority filter + 10; policy drop;
            counter packets 88448 bytes 15799025 queue num 0-3 bypass,fanout
    }

    chain forward {
            type filter hook forward priority filter; policy drop;
    }

    chain output {
            type filter hook output priority filter; policy accept;
    }

    chain IPSoutput {
            type filter hook output priority filter + 10; policy drop;
            counter packets 76196 bytes 201278628 queue num 0-3 bypass,fanout
    }
   }

nftables 방화벽이 제대로 작동합니다.

그러나 내 nginx 서버는 IPv6를 통해 연결할 수 없습니다. 나는 다양한 IPv6 검사 도구를 사용했습니다(예:https://ipv6-test.com/validate.php) 그리고 또한Qualys SSL테스트IPv6를 통해 서버에 액세스할 수 없지만 IPv4는 제대로 작동합니다. 나는 각 nginx 서버에 listen [::]:80;(resp. 지시어를 포함시켰습니다 . 그리고 제공합니다.listen [::]:443;netstat -anlp |grep nginx

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      48846/nginx: master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      48846/nginx: master
tcp        0      0 192.168.42.98:443       93.104.163.178:39001    VERBUNDEN   48847/nginx: worker
tcp        0      0 192.168.42.98:443       93.104.163.178:39368    VERBUNDEN   48847/nginx: worker
tcp        0      0 192.168.42.98:443       93.104.163.178:43086    VERBUNDEN   48847/nginx: worker
tcp6       0      0 :::80                   :::*                    LISTEN      48846/nginx: master
tcp6       0      0 :::443                  :::*                    LISTEN      48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160451   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160453   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160450   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160448   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160452   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160446   48846/nginx: master
unix  3      [ ]         STREAM     VERBUNDEN     160449   48846/nginx: master

내 라우터에서도 IPv6을 활성화했습니다.

문제가 발생할 수 있는 아이디어가 있는 사람이 있습니까?

답변1

내 질문에 대한 @Zoredache의 의견 덕분에 호스트의 IPv6 주소에 대해 ping을 시도했습니다. 내 홈 네트워크 내에서만 작동했습니다. 내가 그것을 통해 핑하려고했을 때서브넷온라인또는 다른 사이트에서는 작동하지 않습니다.

그런 다음 unix.stackoverflow.com에서 이 답변을 찾았습니다.https://unix.stackexchange.com/a/443380/520989. 파일 을 편집 /etc/dhcpcd.conf하고 slaac private. slaac hwaddr이전 구성을 잊어버리고 내 라우터(Fritzbox 7583)를 만들고 서버를 재부팅하면 실제로 내 문제가 해결되었습니다! 이제 IPv6(nginx)를 통해 내 서버에 완전히 연결할 수 있습니다!

관련 정보