Page 1 of 1

Static IP

Posted: Wed Jan 23, 2013 3:35 pm
by pocster
Hi all,

I will soon have a number of Raspie's and as my DHCP router assigns IP addresses it becomes a bit of a pain.
So my question is....

Is it best (how do I) assign a static IP per Raspie that it maintains after a boot or is there a way to 'name" each raspie (I guess like DNS) so I can access it via a name rather than IP (or have some lookup procedure to convert name to IP).

I wish to have the raspie's communicate with each other and exchange data so a constant method i.e. fixed ip or fixed name would make it simpler.

Any help/suggestions appreciated

Re: Static IP

Posted: Wed Jan 23, 2013 3:53 pm
by BobStrogg
Most recent routers let you assign an IP address based on the device MAC address. I have a couple of Pi's set up that way (just give them an IP outside the DHCP range you normally use).

Re: Static IP

Posted: Wed Jan 23, 2013 4:04 pm
by rickseiden
How you assign a static IP is dependent on the OS you're running. Are you running Raspbian, Arch, Fedora, RISC OS, or FreeBSD?

One way around it might be to configure your router to always assign the same dhcp ip address by MAC address. My son likes to run a minecraft server on his laptop. I can't give him a static IP on his laptop, as he will take it out of the house, and it won't work. So I tell the router to always give his laptop a certain IP address. Whenever his laptop reque4sts a new IP, it always gets the same one, and I can setup the router rules for his server in my router.

Edit: BobStrog and I are saying the same thing. When I started my reply, he hadn't posted his yet. I wasn't being redundant on purpose. :D

Re: Static IP

Posted: Wed Jan 23, 2013 4:21 pm
by pocster
Thanks all,

So you are saying my router should intheory allow giving out a static ip address based on the devices MAC?
I currently got it working manually by editing /etc/network/interfaces ; but this method sounds better!

Thanks guys! :P

Re: Static IP

Posted: Wed Jan 23, 2013 4:27 pm
by pocster
Yep!; with router works a treat :-)))