nftables port forward on DHCP interface to static IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux