I have a 192.168.1.0/24 network with a printer on it with with a static IP of 192.168.1.124. I also have a 192.168.3.0/24 VLAN with a linux Mint19.1 computer on it.
I am wanting to use NAT with nftables to NAT all port 631 packets leaving the Mint19.1 computer to 192.168.1.124:631.
The goal is for the Mint19.1 computer to be able to access the printer on the 192.168.1.0/24 network, avoiding the need to have a separate printer.
This is my NAT table:
Code:
table ip nat {
chain pre {
type nat hook prerouting priority 0; policy accept;
}
chain post {
type nat hook postrouting priority 0; policy accept;
oif "enp3s0" snat to 192.168.1.124
}
}
I can NAT all packets leaving the Mint19.1 computer to 192.168.1.124 but I have not been able to figure out how to act specifically on the port 631 packets. Does anyone know the nftables NAT rule to do this?