LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Raspberry Pi static wireless address (https://www.linuxquestions.org/questions/linux-networking-3/raspberry-pi-static-wireless-address-4175461212/)

timl 05-08-2013 07:38 PM

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 :scratch:

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

evo2 05-08-2013 11:37 PM

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.

timl 05-09-2013 12:32 AM

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

evo2 05-09-2013 01:14 AM

Hi,
Quote:

Originally Posted by timl (Post 4947626)
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.


All times are GMT -5. The time now is 06:30 AM.