Feb 6, 2016

Setting a Static IP

I wanted to set the IP to be static.
I found this info on how to achieve that simply and it works great:

(*** Please Read Below for Correction***)

Edit the "/etc/wpa_supplicant/wpa_cli-actions.sh" file:

if [ "$CMD" = "CONNECTED" ]; then

    kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid

#   udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S

    ifconfig $IFNAME 192.168.200.200 netmask 255.255.255.0

fi

Add the "#" to comment out the DHCP Config, and then add the line below with the Static Config that you'd like for your Edison setup.

Editing this file is why I installed nano on the Edison instead of using Vi.

PS.... I did discover that I can not ping outside of my local network currently.
Will investigate this but believe the issue is related to some firewall config on the Edison.
till then....

AHA! Nothing to do with any firewall.
As it turns out I needed to add one additional line to the config file above in order to set a default gateway.
Here is the complete section from that file now ("/etc/wpa_supplicant/wpa_cli-actions.sh"):

if [ "$CMD" = "CONNECTED" ]; then

    kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid

#   udhcpc -i $IFNAME -p /var/run/udhcpc-$IFNAME.pid -S

    ifconfig $IFNAME 192.168.200.200 netmask 255.255.255.0
    route add default gw 192.168.1.1 $IFNAME

fi
Next....

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Did you change anything on wifi router, like set a static ip?

      Delete