S
S
slun2017-02-06 20:20:30
FreeBSD
slun, 2017-02-06 20:20:30

How to reverse nat with pf?

FreeBSD and PF are used as a gateway. At some point, the server under win began to behave strangely and drop packets (not all and not always) from the outside (all possible firewalls are disabled, although the behavior is very similar), but inside the network everything is fine. The desired service is forwarded by the usual rdr rule, which does not change the source address. Goal for the current moment: to make a reverse nat using pf. Please advise how this can be implemented.
PS: I understand that the problem can be solved by raising vpn, but at the moment this, unfortunately, is not possible. The system was also scanned for all kinds of malware, nothing interesting was found.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
athacker, 2017-02-07
@athacker

man pf.conf And your hair will become soft and silky. Especially in the part of the team called (surprise surprise!) rdr ;-) I quote
:

Various types of translation are possible with pf:
binat blah-blah-blah
nat blah-blah-blah
rdr The packet is redirected to another destination and possibly a
different port. rdr rules can optionally specify port ranges
instead of single ports. rdr ... port 2000:2999 -> ... port 4000
redirects ports 2000 to 2999 (inclusive) to port 4000. rdr ...
port 2000:2999 -> ... port 4000:* redirects port 2000 to 4000, 2001
to 4001, ..., 2999 to 4999.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question