All of lore.kernel.org
 help / color / mirror / Atom feed
* nftables port forward on DHCP interface to static IP
@ 2021-04-18 15:59 Pekka Järvinen
  2021-04-18 19:23 ` Frank Myhr
  0 siblings, 1 reply; 6+ messages in thread
From: Pekka Järvinen @ 2021-04-18 15:59 UTC (permalink / raw)
  To: netfilter

Hi,

I'm trying to setup port forward for interface which uses DHCP. I
don't want to reference the interface's public IP in a rule. Is it
possible? My attempt:

iifname $wanif tcp dport {12345} dnat ip to 192.168.1.11

Error: Could not process rule: No such file or directory

Kernel 5.11.2.

define wanif = wan0
define lanif = lan0
define home_net = 192.168.1.0/24
define home_net_gw = 192.168.1.1

table inet filter {
  # ...

  chain prerouting {
    type nat hook prerouting priority dstnat; policy accept;
    ct state invalid drop
  }

  chain postrouting {
    type nat hook postrouting priority srcnat; policy accept;
    ct state invalid drop
    oifname $wanif masquerade persistent comment "MasqNAT"
    drop
  }
}

-- 
Pekka Järvinen

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-20  1:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-18 15:59 nftables port forward on DHCP interface to static IP Pekka Järvinen
2021-04-18 19:23 ` Frank Myhr
2021-04-19 17:22   ` Pekka Järvinen
2021-04-19 21:20     ` Frank Myhr
2021-04-19 21:51       ` Florian Westphal
2021-04-20  1:21         ` Frank Myhr

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.