Trick for sharing Mac ethernet to Ethernet Shield?

I have a Leopard machine.

It's wireless IP is 192.168.2.3 (en1) en0 is 192.168.2.1 (When nothing is connected, then it turns into a 169 address...)

I set up my sketch like this :

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEB }; byte ip[] = { 192,168,2,4 }; byte gateway[] = { 192, 168, 2, 1 }; byte subnet[] = { 255, 255, 255, 0 };

Turned on Wireless to Ethernet sharing in the Sharing Preference Pane.

Can't get it to ping.

Works fine connected to the router.

Is there some trick I need to do in the Network Pref Pane?

This is not a crossover cable.

The connection between the shield and the Mac is considered be on a different network to the connection from the Mac to the internet. So, they need to have different IP number ranges.

--Phil.

Turn on internet connection sharing before you check the IP on en0. It will get a new IP (on a different subnet) with sharing enabled.

Then run through the rest of your process as stated, and it should work.

-j

Oh yeah, and the gateway on the arduino will be the mac's en0 address. The mac will then gateway to your router, if you're going out on the big bad internet from the arduino.

-j

Turn on internet connection sharing before you check the IP on en0. It will get a new IP (on a different subnet) with sharing enabled.

en0 is 192.168.2.1 after I turn on Sharing. My router just happens to use the .2 subnet too.

After I connect Arduino en0 says inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 inet6 fe80::21f:f3ff:fe55:505a%en0 prefixlen 64 scopeid 0x4 inet 169.254.66.13 netmask 0xffff0000 broadcast 169.254.255.255

en0 is 192.168.2.1 after I turn on Sharing. My router just happens to use the .2 subnet too.

Weird, I thought connection sharing was smart enough not to try to use a subnet that's already in use? Maybe I'm wrong on this and it is hard-coded to use the 192.168.2/24 subnet.

I seriously doubt this will work, as the computer can't send the packets to both interfaces (at the very least the route table will be hosed). something must give up the 192.168.2 subnet.

Short term, you can turn off the airport (thereby disabling one of the interfaces trying to use the 192.168.2 subnet) and see if you can talk between the arduino and the mac.

-j

Heh, If I try to turn on sharing with airport off, it asks me if I want to turn it on...

I can share firewire to ethernet, and it works! (with airport off)

But if I turn airport back on, it kills it.

Anyone know how to make sharing use a different subnet?

What I've read and tried so far says the subnet is hardcoded.

Anyone know how to make sharing use a different subnet?

I haven't been able to find it. It may be easier to change your router to use a subnet other than 2.

-j