Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A command line application set up a rule to forward local port 8080 traffic to a VM's port 80. Something went wrong and left this definition. How can I find and remove this port forwarding rule?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Memory

If it only modify the in memory rules, the laziest way is to reboot. If you want to remove the rule(s) without reboot, do following (assuming the program did not modify rule file)

pfctl -f /etc/pf.conf

That will reset+reload the default system rules. Thus removing the port forwarding rule(s).

File

If the program modified the rule files, check following

/etc/pf.conf
/etc/pf.anchors/*
File/Directory referred in /etc/pf.anchors/com.apple

After modifying, do following

  1. Check pf.conf for error first

    pfctl -nf /etc/pf.conf

  2. If no error, deploy new rules without reboot

    pfctl -f /etc/pf.conf

share|improve this answer
    
Reboot seemed to do the trick. =] –  Andrew Jan 22 '13 at 1:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.