Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I am in Mac OS X, I have a raspberry( connected to en0 ( I've my en1 with the network I reach internet via this interface.

All the goes to

So, I would like to redirect all my packets from en0 to en1.

I have enable ip forwarding :

sudo sysctl -w net.inet.ip.forwarding=1

And i tried to redirect the en0 trafic to en1 via :

1) "system preference/internet sharing" -> it's not working


ipfw add 1040 allow ip from any to any via en0
ipfw add divert natd all from any to any via en1
ipfw add pass all from any to any
natd -interface en1

Well, it's not working. And i'm lost.

So What i need to do ?


share|improve this question

closed as off topic by Michael Hampton, larsks, mulaz, dunxd, mdpc Mar 15 '13 at 7:18

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

It sounds like you would like your raspberry pi to be able to access the Internet using your wireless connection.

Using OS X, you should be able to open your Sharing preferences, select "Internet sharing", and then set "Share your connection from:" to "Wi-Fi" and set "To computers using:" to "Ethernet". This will allow devices -- such as your raspberry pi -- connected to your ethernet port to access the internet via your wireless connection.

This will NAT devices attached to your ethernet port. That is, connections from your raspberry pi will appear to come from your Mac's wireless ip address.

share|improve this answer
I tried but it doesn't work, it doesn't even ping en1 ip ( – Maxdiv Mar 7 '13 at 21:21
Is your raspberry pi configured to acquire an ip address using dhcp? Is it able to acquire an address via dhcp? Also, have you rebooted since making the sysctl and firewall changes? Those are unnecessary and I don't know how they will interact with the internet sharing feature. – larsks Mar 7 '13 at 21:23
Yes raspberry has an ip (, it pings en0 ( when the firewall is off (when the mac firewall is on it doesn't ping). No i didn't reboot after launch the commands. – Maxdiv Mar 7 '13 at 21:28
In order to use the Internet Sharing feature, let it set everything up for you: do not manually configure packet forwarding, ipfw, or the raspberry's IP address. Internet Sharing will configure forwarding, ipfw, natd, named (DNS service for the private network), a new IP address on the private interface (generally, and dhcp service on the private interface. – Gordon Davisson Mar 8 '13 at 4:01
Maxdiv: From you comment it's not clear if you're letting your pi acquire it's address from your Mac using DHCP. As Gordon says, you need to let the Mac take care of ip address distribution. You should probably reboot your system for the same reason to clear out any of the firewall changes you made by hand. – larsks Mar 8 '13 at 4:15

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