assigning static IP with command line

I plugged my raspberry pi to my OSX 10.10 and I want to give the pi some static IP. When I run

networksetup -setmanual "Built-in Ethernet" 192.168.1.40 255.255.255.0 192.168.1.1

I get :

Built-in Ethernet is not a valid IP address.
** Error: The parameters were not valid.

I followed the man doc. Someone could help ?

here's the output of ifconfig

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=3<RXCSUM,TXCSUM>
    inet6 ::1 prefixlen 128 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether a4:5e:60:d9:e4:51 
    inet6 fe80::a65e:60ff:fed9:e451%en0 prefixlen 64 scopeid 0x4 
    inet 192.168.1.32 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active
en1: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    options=60<TSO4,TSO6>
    ether 6a:00:00:1f:0c:50 
    media: autoselect <full-duplex>
    status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
    options=60<TSO4,TSO6>
    ether 6a:00:00:1f:0c:51 
    media: autoselect <full-duplex>
    status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether a6:5e:60:9d:1f:00 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    nd6 options=1<PERFORMNUD>
    media: <unknown type>
    status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 06:5e:60:d9:e4:51 
    media: autoselect
    status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1452
    ether d6:8c:e1:bd:55:69 
    inet6 fe80::d48c:e1ff:febd:5569%awdl0 prefixlen 64 scopeid 0x9 
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=4<VLAN_MTU>
    ether 20:c9:d0:2a:ee:68 
    inet6 fe80::22c9:d0ff:fe2a:ee68%en5 prefixlen 64 scopeid 0xa 
    inet 192.168.1.40 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=1<PERFORMNUD>
    media: autoselect (100baseTX <full-duplex,flow-control>)
    status: active

I'm going to side step things to get you something that will probably work just fine.

Open System Preferences and delete your WiFi and Ethernet configurations once you have saved all the work you need from the internet.

  • Add a WiFi connection and connect that to a WiFi Router with Internet Connection.
  • Then add an ethernet connection and make that a static IP

I would make two networks initially so you don't have issues with which interface gets the default route:

If your WiFi is something other than 192.168.1.1 - then you can use 192.168.1.1 for the Mac ethernet and the Mac default gateway. If the WiFi is on 192.168.1.1 then put the Mac and PI on 192.168.2.1 and 192.168.2.40 for example.

enter image description here

I don't have an ethernet port on their mac, so forgive the WiFi 2 name - you show have ethernet in that image.

At that point, your internet should work through WiFi and the Mac and the PI should be able to ping each other. The Pi won't see the internet through the Mac. If you want that, open Sharing preference pane and share the internet from the WiFi to the Ethernet port and turn off any firewalls to test things.

At that point, the Pi should use the Mac as it's router and everything should have access to the internet and each other.