{"id":1883,"date":"2025-11-30T19:39:57","date_gmt":"2025-11-30T11:39:57","guid":{"rendered":"https:\/\/1212967.xyz\/blog\/?p=1883"},"modified":"2025-12-01T11:52:20","modified_gmt":"2025-12-01T03:52:20","slug":"%e5%ae%b6%e9%87%8c%e4%ba%91%e8%ae%a1%e5%88%92%ef%bc%9a%e4%b8%8d%e8%a6%81%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85firewalld","status":"publish","type":"post","link":"https:\/\/1212967.xyz\/blog\/2025\/11\/30\/%e5%ae%b6%e9%87%8c%e4%ba%91%e8%ae%a1%e5%88%92%ef%bc%9a%e4%b8%8d%e8%a6%81%e5%9c%a8ubuntu%e4%b8%8a%e5%ae%89%e8%a3%85firewalld\/","title":{"rendered":"\u5bb6\u91cc\u4e91\u8ba1\u5212\uff1a\u4e0d\u8981\u5728ubuntu\u4e0a\u5b89\u88c5firewalld"},"content":{"rendered":"\n<p>\u4f1a\u53d8\u5f97\u4e0d\u5e78;(<\/p>\n\n\n\n<p>\u4ee5\u53ca\uff0c\u8bb0\u5f55\u4e0b\u5b89\u88c5\u5b8cfirewalld\u540e\u600e\u4e48\u6362\u56deufw<\/p>\n\n\n\n<p>\u9996\u5148\u5f53\u7136\u662f\u7981\u7528firewalld\uff0c\u6700\u597d\u4f7f\u7528apt purge\u6765\u5b8c\u5168\u5378\u8f7d<\/p>\n\n\n\n<p>\u6b64\u65f6\u6267\u884cufw enable\u5e94\u8be5\u4f1a\u770b\u5230\u4e00\u5806\u62a5\u9519\uff0c<strong>\u800c\u4e14ssh\u4f1a\u88ab\u65ad\u5f00\uff0c\u56e0\u4e3a\u673a\u5668\u65ad\u7f51\u4e86\uff0c\u8bf7\u786e\u4fdd\u662f\u5728\u672c\u5730\/vnc\u64cd\u4f5c<\/strong>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(base) root@quq233:~# ufw enable\nCommand may disrupt existing ssh connections. Proceed with operation (y|n)? y\nERROR: problem running ufw-initWarning: Extension limit revision 0 not supported, missing kernel module?iptables-restore v1.8.10 (nf_tables):line 63: RULE_APPEND failed (No such file or directory): rule in chain ufw-not-localWarning: Extension LOG revision 0 not supported, missing kernel module?Warning: Extension limit revision 0 not supported, missing kernel module?iptables-restore v1.8.10 (nf_tables):line 179: RULE_APPEND failed (No such file or directory): rule in chain ufw-after-logging-inputline 180: RULE_APPEND failed (No such file or directory): rule in chain ufw-after-logging-forwardline 181: RULE_INSERT failed (No such file or directory): rule in chain ufw-logging-denyline 182: RULE_APPEND failed (No such file or directory): rule in chain ufw-logging-denyline 183: RULE_APPEND failed (No such file or directory): rule in chain ufw-logging-allowWarning: Extension rt revision 0 not supported, missing kernel module?Warning: Extension hl revision 0 not supported, missing kernel module?ip6tables-restore v1.8.10 (nf_tables):line 24: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 25: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-forwardline 26: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-outputline 50: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 51: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 52: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 53: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 55: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 57: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 67: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 69: RULE_APPEND failed (No such file or directory): rule in chain ufw6-before-inputline 111: RULE_APPEND failed (No such fiWarning: Extension LOG revision 0 not supported, missing kernel module?Warning: Extension limit revision 0 not supported, missing kernel module?ip6tables-restore v1.8.10 (nf_tables):line 163: RULE_APPEND failed (No such file or directory): rule in chain ufw6-after-logging-inputline 164: RULE_APPEND failed (No such file or directory): rule in chain ufw6-after-logging-forwardline 165: RULE_INSERT failed (No such file or directory): rule in chain ufw6-logging-denyline 166: RULE_APPEND failed (No such file or directory): rule in chain ufw6-logging-denyline 167: RULE_APPEND failed (No such file or directory): rule in chain ufw6-logging-allowProblem running '\/etc\/ufw\/before.rules'Problem running '\/etc\/ufw\/user.rules'Problem running '\/etc\/ufw\/before6.rules'Problem running '\/etc\/ufw\/user6.rules'<\/code><\/pre>\n\n\n\n<p>\u8fd9\u8fb9\u53ef\u4ee5\u770b\u5230\u7f3a\u5c11\u4e86\u4e00\u5806\u5185\u6838\u6a21\u5757\uff0c\u5e94\u8be5\u662f\u5b89\u88c5firewalld\u5bfc\u81f4\u7cfb\u7edf\u6ca1\u80fd\u81ea\u52a8\u52a0\u8f7d\uff0c\u6267\u884c\/usr\/share\/ufw\/check-requirements&nbsp;\u6765\u67e5\u770b\u5177\u4f53\u7f3a\u4e86\u54ea\u4e9b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(base) root@quq233:~# \/usr\/share\/ufw\/check-requirements&nbsp;Has python: pass (binary: python3, version: 3.13.9, py3)Has iptables: passHas ip6tables: passHas \/proc\/net\/dev: passHas \/proc\/net\/if_inet6: passThis script will now attempt to create various rules using the iptablesand ip6tables commands. This may result in module autoloading (eg, forIPv6).Proceed with checks (Y\/n)?&nbsp;== IPv4 ==Creating 'ufw-check-requirements'... doneInserting RETURN at top of 'ufw-check-requirements'... doneTCP: passUDP: passdestination port: passsource port: passACCEPT: passDROP: passREJECT: passLOG: FAILerror was: Warning: Extension LOG revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementshashlimit: FAILerror was: Warning: Extension hashlimit revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementslimit: FAILerror was: Warning: Extension limit revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementsctstate (NEW): passctstate (RELATED): passctstate (ESTABLISHED): passctstate (INVALID): passctstate (new, recent set): FAIL (no runtime support)error was: Warning: Extension recent revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementsctstate (new, recent update): FAIL (no runtime support)error was: Warning: Extension recent revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementsctstate (new, limit): FAILerror was: Warning: Extension limit revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementsinterface (input): passinterface (output): passmultiport: passcomment: FAILerror was: Warning: Extension comment revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirementsaddrtype (LOCAL): passaddrtype (MULTICAST): passaddrtype (BROADCAST): passicmp (destination-unreachable): passicmp (source-quench): passicmp (time-exceeded): passicmp (parameter-problem): passicmp (echo-request): pass== IPv6 ==Creating 'ufw-check-requirements6'... doneInserting RETURN at top of 'ufw-check-requirements6'... doneTCP: passUDP: passdestination port: passsource port: passACCEPT: passDROP: passREJECT: FAILerror was: Warning: Extension REJECT revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6LOG: FAILerror was: Warning: Extension LOG revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6hashlimit: FAILerror was: Warning: Extension hashlimit revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6limit: FAILerror was: Warning: Extension limit revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6ctstate (NEW): passctstate (RELATED): passctstate (ESTABLISHED): passctstate (INVALID): passctstate (new, recent set): FAIL (no runtime support)error was: Warning: Extension recent revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6ctstate (new, recent update): FAIL (no runtime support)error was: Warning: Extension recent revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6ctstate (new, limit): FAILerror was: Warning: Extension limit revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6interface (input): passinterface (output): passmultiport: passcomment: FAILerror was: Warning: Extension comment revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6icmpv6 (destination-unreachable): passicmpv6 (packet-too-big): passicmpv6 (time-exceeded): passicmpv6 (parameter-problem): passicmpv6 (echo-request): passicmpv6 with hl (neighbor-solicitation): FAILerror was: Warning: Extension hl revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6icmpv6 with hl (neighbor-advertisement): FAILerror was: Warning: Extension hl revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6icmpv6 with hl (router-solicitation): FAILerror was: Warning: Extension hl revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6icmpv6 with hl (router-advertisement): FAILerror was: Warning: Extension hl revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6ipv6 rt: FAILerror was: Warning: Extension rt revision 0 not supported, missing kernel module?ip6tables v1.8.10 (nf_tables):&nbsp; RULE_APPEND failed (No such file or directory): rule in chain ufw-check-requirements6== System ==Other firewall applications: firewalld (if enabled, may interfere with ufw)FAIL: check your kernel and that you have iptables &gt;= 1.4.0FAIL: check your kernel and iptables for additional runtime support<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\uff0c\u628a\u62a5\u9519\u4fe1\u606f\u53d1\u7ed9chatgpt\/claude\uff0c\u95ee\u5b83\u5374\u4ec0\u4e48\u6a21\u5757;) \u8fd9\u4e48\u591a\u9b3c\u77e5\u9053\u90fd\u662f\u4ec0\u4e48\u554a\uff1b\u5bf9\u4e8e\u6211\u4e0a\u9762\u7684\u62a5\u9519\uff0cclaude\u7ed9\u7684\u7ed3\u679c\u662f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>modprobe nf_tables\nmodprobe nft_limit\nmodprobe nft_log\nmodprobe nft_reject\nmodprobe nft_reject_ipv6\nmodprobe nft_counter\nmodprobe nft_compat\n<\/code><\/pre>\n\n\n\n<p>\u52a0\u8f7d\u5b8c\u540e\u518d\u6b21\u6267\u884cufw enable\uff0c\u5982\u679c\u80fd\u6b63\u5e38\u542f\u52a8\u7684\u8bdd\uff0c\u5199\u5165\/etc\/modules-load.d\/nf_tables.conf\uff0c\u786e\u4fdd\u4e0b\u6b21\u5f00\u673a\u65f6\u81ea\u52a8\u52a0\u8f7d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Add modules to load at boot\ncat &gt;&gt; \/etc\/modules-load.d\/nf_tables.conf &lt;&lt; EOF\nnf_tables\nnft_limit\nnft_log\nnft_reject\nnft_reject_ipv6\nnft_counter\nnft_compat\nEOF<\/code><\/pre>\n\n\n\n<p>\u5e94\u8be5\u5c31\u80fd\u6062\u590d\u4e86;)<\/p>\n\n\n\n<p>\u4ee5\u53ca\uff0c\u66f4\u6539\u914d\u4e4b\u524d\u6700\u597d\u521b\u5efa\u5feb\u7167\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u8f7b\u677e\u6062\u590d\u4e86<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f1a\u53d8\u5f97\u4e0d\u5e78;( \u4ee5\u53ca\uff0c\u8bb0\u5f55\u4e0b\u5b89\u88c5\u5b8cfirewalld\u540e\u600e\u4e48\u6362\u56deufw \u9996\u5148\u5f53\u7136\u662f\u7981\u7528firewalld\uff0c\u6700\u597d\u4f7f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1883","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/posts\/1883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/comments?post=1883"}],"version-history":[{"count":3,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/posts\/1883\/revisions"}],"predecessor-version":[{"id":1886,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/posts\/1883\/revisions\/1886"}],"wp:attachment":[{"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/media?parent=1883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/categories?post=1883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1212967.xyz\/blog\/wp-json\/wp\/v2\/tags?post=1883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}