|
|
发表于 2018-4-9 08:16:49
|
显示全部楼层
安利一波 Nftables
[ol] flush rulesettable ip nat { map x_po { type inet_service : inet_service elements = { 10000 : 3389 } }, map x_ip { type inet_service : ipv4_addr elements = { 10000 : x.x.x.x } }, chain prerouting { type nat hook prerouting priority 100; policy accept; dnat to udp dport map @x_ip:udp dport map @x_po dnat to tcp dport map @x_ip:tcp dport map @x_po } chain postrouting { type nat hook postrouting priority 100; policy accept; oif "eth0" masquerade }} [/ol]复制代码
保存为 nft.conf, 修改 `x_po` 跟 `x_ip` 想转发什么就转发什么. nft -f nft.conf 加载 |
|