rdr pass on $ext_if inet proto tcp from $somehost to $someserver port 22 -> $someserver port 22332
or you can try the rdr statement on the $int_if if it doesn't work. You may also need additional pass rules depending on what and how you are already filtering. Make sure you check your pflog0 with tcpdump.
While that's doable, wouldn't it be simpler/cleaner to just add a host entry into your ~/.ssh/config file to set the port in there? Then you can just SSH to it via $ ssh someserver.org and OpenSSH will handle setting the port correctly.
I'm guessing the impetus for this thread is the OP doesn't like adding -P 12345 everytime they connect.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.