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/
Locked
User avatar
bayesp
 
Posts: 7
Joined: Tue Jan 15, 2013 8:22 am

Static IP address in Occidental

Post by bayesp »

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.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Static IP address in Occidental

Post by adafruit »

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
jimmayhugh
 
Posts: 58
Joined: Thu May 17, 2012 8:33 pm

Re: Static IP address in Occidental

Post by jimmayhugh »

Modify the file /etc/network/interfaces and add the static IP, mask and gateway addresses. Pretty simple actually.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Static IP address in Occidental

Post by adafruit_support_rick »

jimmayhugh is correct. The default etc/network/interfaces file looks like this:

Code: Select all

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

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

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!)

Locked
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/

Return to “Adafruit Raspberry Pi® accessories”