LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2013, 07:38 PM   #1
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Rep: Reputation: 156Reputation: 156
Raspberry Pi static wireless address


Hi, I have been tinkering with the Pi I just received and I would like to configure a static IP address on the wifi connection - DHCP works fine but I like my PCs to be identifiable. I should point out that I tend to use Fedora/Centos so the world of raspbian has a few challenges for me

The first suggestions I read regarded the /etc/network/interface file which I modified thus (I renamed it when I could not get it to work):

Quote:
pi@raspberrypi ~ $ cat /etc/network/interfaces.man
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual

address 10.1.1.91
netmask 255.255.255.0
gateway 10.1.1.1
#wpa-ssid TP-LINK_CF9006

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
#iface default inet dhcp
I experimented with the ssid or the wpa_supplicant.conf file (which referenced that ssid) but ifup had problems with both.

Then I read about wicd which I installed. I went to the properties for my router, ticked "Use static IPs", set the static address to 10.1.1.91 as above, defined netmask, gateway, DNS domain and DNS server, used wicd to disconnect/connect and all was good - I had the address set up how I wanted it. I ticked the box to "automatically connect" and rebooted.

After the reboot the wireless connection was active but it had lapsed back to the DHCP address allocated before - 10.1.1.101 (on my router, DHCP kicks in above 10.1.1.100).

Now, when I go to Preferences->External Programs there is a section for "DHCP Client" and "automatic" is selected. I assume this is the setting when you are using DHCP rather than a static IP address is that correct?

Or, any suggestions on boxes that need ticking in wicd to ensure the static address is recognised. In case this is relevant, the interfaces file currently reads:

Quote:
pi@raspberrypi ~ $ cat /etc/network/interfaces
auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Thanks

Last edited by timl; 05-08-2013 at 09:35 PM.
 
Old 05-08-2013, 11:37 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

using dhcp and setting your router to hand out a specific ip for your pis mac address is probably the way to go (I do my home network like that). You say you did this but:
Code:
After the reboot the wireless connection was active but it had lapsed back to the DHCP address allocated before - 10.1.1.101 (on my router, DHCP kicks in above 10.1.1.100).
This looks to me like you didn't save the setting on your router. Can you confirm this?

Evo2.
 
1 members found this post helpful.
Old 05-09-2013, 12:32 AM   #3
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 750

Original Poster
Rep: Reputation: 156Reputation: 156
Quote:
This looks to me like you didn't save the setting on your router. Can you confirm this?
correct. I didn't even know this facility existed. So simple when you know how. I added the address, rebooted the router, rebooted the Pi and there it is. I'll mark this as solved then!

I am still scratching my head on one issue though: I have 3 other PCs (Fedora/Centos) with static IP addresses and these are not configured in the router - configured using the distros tools. Does raspbian not maintain static addresses?

Cheers
 
Old 05-09-2013, 01:14 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,
Quote:
Originally Posted by timl View Post
Does raspbian not maintain static addresses?
You should be abel to configure a static ip for the pi in /etc/netowrk/interfaces. Soemthing like:
Code:
iface wlan0 inet static
      wireless_key foo
      wireless_essid bar
      address 10.1.1.91
      netmask 255.255.255.0
      gateway 10.1.1.1
If this doesn't work have a dig for some Debian networking howto.


Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Networking Problems on Headless Raspberry Pi dmchess Linux - Networking 1 02-28-2013 06:38 PM
LXer: Enter the element14 Pi Day ??Raspberry RoadTest? Challenge for a chance to win a Raspberry Pi c LXer Syndicated Linux News 0 03-08-2012 06:20 AM
setting static IP on linux PCs with no static IP address from internet provider? solvetek Linux - Networking 1 10-22-2011 08:04 AM
Set IP address to static from DHCP assigned address jborn Linux - Networking 4 02-02-2007 08:38 PM
[SOLVED] Converting static IP-address to dynamic IP-address Blue_Ice Linux - Networking 3 07-20-2006 03:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration