Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
unclefu
Jul 1, 2004
mr .shuffles

feld posted:

I challenge you BSDers to a duel. Well, not really, but nobody in #openbsd, #pf, or #freebsd could give me an answer to this question.

Scenario:

Server. Needs the firewall on said server to rewrite packets originating (OUTGOING) from the server. Not passing packets through interfaces. I need packets from the server itself to be rewritten.


rdr inet proto tcp from self to IP -> OTHER_IP

doesnt work.

In Linux:
iptables -A OUTPUT -t nat -d IP -j DNAT --to OTHER_IP

Reason: Internal dev webserver. Going to have developers connect through a SOCKS proxy on the firewall so their traffic to our real webservers gets diverted/rewritten to our internal webserver for mucking about with webserver settings and not messing with production. This is the only way. Hosts file changes, changing DNS servers that points to internal addresses is not viable. Webservers MUST use the hostname/virtualhost or they dont function (heavy Oracle PL/SQL sites, custom site software, requires this to function).

This is the only reasonable way to do it. I currently have it rigged up through a Linux box right now but I'm dying to get this answer for pf.

pf has binat, would that work?

Adbot
ADBOT LOVES YOU

  • Locked thread