Surely port-forwarding UDP and TCP packets to a #Minecraft (Debian) server using #relayd on #OpenBSD should be straightforward?

Spent quite a bit of time on this yesterday and didn't manage it. I'm a relative newb when it comes to networking, #pf, etc but even #AI couldn't get me through it.

Has anyone done this? Grateful for any tips.

@haircode if you only need port forwarding, you don't need relayd. Just use pf translation rules (rdr etc.)
@canacar thanks - tried using just pf too. Will look again.

@haircode Nothing in networking is straightforward. While not having tried this using the #relayd , it is likely to be a standard firewalling destination NAT (see DNAT) capability, suitable for running a server inside a firewall protected LAN. . So I've configured firewalls to do this many times, including using IPTABLE rules on Linux.

Some useful notes linked, but note that in this example:

==========================
Packets destined for IP 10.1.1.7 will be forwaded to 192.168.1.2 UDP,TCP

Does NOT work with ping (ICMP) correctly, does not handle ICMP protocol WLAN IP reply on a ping without

iptables -t nat -A PREROUTING -p tcp -i wlan0 -d 10.1.1.7 -j DNAT --to-destination 192.168.1.2
iptables -t nat -A PREROUTING -p udp -i wlan0 -d 10.1.1.7 -j DNAT --to-destination 192.168.1.2

==========================
traffic on all ports are forwarded, while it's more likely you will want to forward traffic on specific ports for the Minecraft server port requirements, as that is more secure.

https://gist.github.com/tomasinouk/eec152019311b09905cd

examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these com...

Gist