OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
digimoon
V2EX  ›  OpenWrt

如何在 prerouting 链增加自定义规则?

  •  
  •   digimoon · Dec 20, 2024 · 1272 views
    This topic created in 527 days ago, the information mentioned may be changed or developed.

    参考官方教程修改了一下 https://openwrt.org/docs/guide-user/firewall/firewall_configuration

    # /etc/config/firewall
    config include
    	option	type		'nftables'
    	option	path		'/etc/my_custom_firewall_rule.nft'
    	option	position	'chain-post'
    	option	chain		'prerouting'
     
    # /etc/my_custom_firewall_rule.nft
    tcp dport 0-1023 log prefix "Inbound WAN connection attempt to low TCP port: "
    

    想在 prerouting 链中再增加一些自定义的规则,但是完全没有生效,加到 mangle_prerouting 链倒是没有问题

    系统版本是 23.05.5

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   959 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 18:48 · PVG 02:48 · LAX 11:48 · JFK 14:48
    ♥ Do have faith in what you're doing.