Ok, so the static IP is the way to go. Can I choose x and y arbitrarily ? How do I know what value of x will match my subnet ? As for the value of y, I guess any value high enough (say, 50) in a small home network will do, right?
Thank you all for your help!
Cheers,
Pierre.
2012/9/10 Andy Farnell padawan12@obiwannabe.co.uk
The simplest and most direct way is to go into
/etc/network/interfaces
and change the first entry for the interface you want to use (presumably wired ethernet eth0) to
iface eth0 inet static 192.168.x.y netmask 255.255.255.0 broadcast 192.168.x.255 gateway 192.168.x.z
Your choice of x and y shoud match your subnet and a free IP address. The value for z will be the router. BTW don't end your address with 255 as you suggested :) that is reserved for broadcast address, see the third line.
The router should see this via gratuitous ARP quite quickly, no need for any other fancy announcements unless you are in a big and complicated network.
Check it after reboot using
ifconfig eth0
best Andy
On Mon, Sep 10, 2012 at 04:41:33PM +0200, Pierre Massat wrote:
Dear Pd-Listers,
Sorry this obviously OT question.
I'm trying to use my Raspberry Pi (yes I know, i'm also beginning to get fed up with its apparent ubiquity...) as by portable webserver. By
portable
I mean that i could carry it with me and plug it into any home router and make it accessible to every machine in the local network.
The obvious problem i'm currently faced with is that of the IP given by
the
router to the RPi. I think it's possible to configure the RPi to have a static IP, but I have no idea how "portable" this solution is. Say, if I configured my RPi to alsways show up as 192.168.0.255, would this address work with every home router? Another option, perhaps : use the unique MAC address of my RPi ? I have
no
clue whether it is possible at all to connect to a local webserver using the MAC of its host.
Any clue is more than welcome, i know practically nothing about networks.
Cheers,
Pierre.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->