Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

All the goes to 192.168.200.1

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

2)

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 ?

Thanks

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 professional 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.

1 Answer 1

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 (192.168.1.17)... –  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 (192.168.200.2), it pings en0 (192.168.200.1) 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 192.168.2.1/24), 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.