What is the correct way to enable IP-forwarding in MacOS X?
More specifically, what is the MacOS X command line quivalent of the following two Linux commands:
echo 1 > /proc/sys/net/ipv4/ip_forward iptables -A FORWARD -j ACCEPT
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
You're doing two things there.
Enabling IP forwarding. The OS X equivalent might be:
sysctl -w net.inet.ip.forwarding=1
...but since I don't know exactly what you're trying to do, this might be technically correct but unhelpful.
Adding a largely unnecessary firewall rule. If you haven't changed the default policy for your FORWARD chain (
iptables -P FORWARD ...), then this rule does nothing.
OS X uses the
pf firewall tools. Try here