Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just wondering how I would accomplish the following IPtables rules under Mac OSX:

iptables -A PREROUTING -t mangle -p udp --sport 7078 -J TOS --set-tos Maximize-Reliability
iptables -A PREROUTING -t mangle -p udp --sport 7078 -J TOS --set-tos Maximize-Throughput
iptables -A PREROUTING -t mangle -p udp --sport 7078 -J TOS --set-tos Mimimize-Delay

Also, with the source-port (sport), is that freely interchangeable with the destination port (dport)?

Many Thanks in advance.


share|improve this question

You want the 'ipfw' command.

share|improve this answer
ipfw is now deprecated and replaced with pfctl, but otherwise correct. – Jenny D Feb 20 '13 at 15:00
well, it seems none of them have ability to update TOS byte – gelraen Feb 20 '13 at 15:09

This is what I have to redirect some UDP traffic to external IP addresses. Running Mac OSX 10.9 (Mavericks) with PF. ipfw was deprecated. But anyway, PF is running on the old syntax pre 4.7 I guess. You might want to tweak ips and interfaces.

rdr pass on {$ext_if, $int_if} inet proto udp from any to $old_ip -> $new_ip 
share|improve this answer

Your Answer


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.