0

I'm trying to add a rule to my computer which was working on my work computer. strangely enough there's no rdr program on my Yosemite. should I install a particular package to obtain it?

sh-3.2# rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
sh: rdr: command not found
sh-3.2# which rdr
sh-3.2# wtf
sh: wtf: command not found
sh-3.2# uname -a
Darwin sathias-iMac.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
  • rdr is not part of OS X. I see two directions this question could take: "How can I accomplish this with an out-of-the-box installation" or "How can I install rdr", can you edit your question to indicate which way you want to go? – nohillside Nov 9 '14 at 18:36
  • I can assure you that on my work computer rdr was there without installing anything. but that's a new iMac that wasn't updated – sathia Nov 9 '14 at 18:56
  • Shouldn't these rules be part of /etc/pf.conf then (see openbsd.org/faq/pf/index.html)? – nohillside Nov 9 '14 at 19:31
  • yes, that's how I made it on my other comp, adding pf.anchors – sathia Nov 9 '14 at 19:33
  • In the screenshot above, you seem to be running rdr directly in the shell. This will not work. – nohillside Nov 9 '14 at 19:38
1

rdr is part of the packet filter/firewall in OS X and used to configure redirections. You can't run this command directly in the shell but need to edit it into /etc/pf.conf and friends. More details are available via man pf.conf and in the PF FAQ.

  • So, how comes that my command works.on the other pc? – sathia Nov 9 '14 at 19:52
  • OS X as well? Run type rdr in the shell to see how the command is defined there. – nohillside Nov 9 '14 at 20:43
  • 1
    ouch, my brain is not working correctly :) I'm at the office and I can confirm that on this computer there's a pf.anchors and that the rdr command is not working on its own. I shouldn't work on Sunday – sathia Nov 10 '14 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .