USE UPS NEXT DAY AIR FOR ANY USA ORDER BEFORE 11AM ET *TODAY* 12/19/2014 TO GET YOUR PACKAGE IN TIME FOR XMAS - PLEASE SEE OUR SHIPPING DEADLINE NOTICE FOR MORE DETAILS!

Static IP address in Occidental
Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Static IP address in Occidental

by bayesp on Tue Jan 15, 2013 8:24 am

Hi

does anyone know how to set a static IP address in Occidental. I plan to use web IDE without connection to a router (Ad-Hoc) so no DHCP server involved.

Thanks

Paul.
bayesp
 
Posts: 2
Joined: Tue Jan 15, 2013 8:22 am

Re: Static IP address in Occidental

by adafruit on Tue Jan 15, 2013 6:00 pm

it would be the same as any linux computer - but we're not sure how to do that. any debian linux static IP tutorial should work :)
User avatar
adafruit
 
Posts: 11778
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Static IP address in Occidental

by jimmayhugh on Thu Jan 24, 2013 10:14 am

Modify the file /etc/network/interfaces and add the static IP, mask and gateway addresses. Pretty simple actually.
User avatar
jimmayhugh
 
Posts: 51
Joined: Thu May 17, 2012 8:33 pm

Re: Static IP address in Occidental

by adafruit_support_rick on Wed Sep 04, 2013 11:40 am

jimmayhugh is correct. The default etc/network/interfaces file looks like this:
Code: Select all | TOGGLE FULL SIZE
auto lo

iface lo inet loopback
iface eth0 inet dhcp


auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid "myssid"
        wpa-psk "mypassword"



You want to comment our the line "iface eth0 inet dhcp", and add the static iface "stanza". Substitute your address, netmask, and gateway for the ones I show here:
Code: Select all | TOGGLE FULL SIZE
auto lo

iface lo inet loopback
#dhcp configuration of eth0
#iface eth0 inet dhcp

#static configuration of eth0
iface      eth0 inet static
    address   192.168.1.127
    netmask   255.255.255.0
    gateway     192.168.1.1

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid "fios63"
        wpa-psk "fepulatorfepu"



After you edit the file, you don't actually have to reboot (if you don't want to). You can apply the new settings by issuing the following 2 commands:
Code: Select all | TOGGLE FULL SIZE
sudo ifdown -v "eth0"
sudo ifup -v "eth0"

(NOTE: don't do this if you're logged in via ssh or vnc - your network connection will go away!)

adafruit_support_rick
 
Posts: 14479
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY