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.
Pierre Massat wrote:
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.
Keep dhcp on to satisfy the network topology, and try zeroconf. On Linux it's provided my means of avahi and nsswitch-mdns. On Mac OSX it's called Bonjour. On Windows you can get it by installing some Apple package about printers (search bonjour for windows on duckduckgo).
Having mdns enabled will let people connect to your computer by name, ie "http://raspi.local/test.html" if your Pi is named raspi (you can figure it out by typing "hostname" in a a terminal).
It works by letting computers advertise their IP and hostname on the local network.
Archlinux Wiki is beginner friendly for that matter : https://wiki.archlinux.org/index.php/Avahi
Have fun,
Hi,
let me advocate zeronconf vs. static IP a little more.
Charles Goyard wrote:
Keep dhcp on to satisfy the network topology, and try zeroconf.
Also, it can perfectly be that mdns is enabled by default on Raspian. You can check by issuing a "ping yourpihostname.local" from the raspi.
I find the static IP way a lot more time consuming and error prone. The IP you choose can be free at the moment you set it, but if a new computer pops up in the network, you can have a conflict. Example: on my network my printer has a reserved IP in the DHCP configuration. If you happen to pick this apparently available IP and I turn the printer on, that's a big mess, because you have not respected the network administrator's work :).
Zeroconf has been made for that: you know nothing about the network and still you're reachable by name. Easy, fast, default on Ubuntu and Apples.
Search "avahi" in this page: http://raspberrypi.stackexchange.com/questions/38/prepare-for-ssh-without-a-...
To have zeroconf installed in windows: http://support.apple.com/kb/DL999 (yes, it's supposed to be about printers but it works for the whole system)
Cheers,
zeronconf looks pretty close indeed to what I was looking for... I'll give it a try tonight and will report the results shortly!
Cheers,
Pierre.
2012/9/11 Charles Goyard cg@fsck.fr
Hi,
let me advocate zeronconf vs. static IP a little more.
Charles Goyard wrote:
Keep dhcp on to satisfy the network topology, and try zeroconf.
Also, it can perfectly be that mdns is enabled by default on Raspian. You can check by issuing a "ping yourpihostname.local" from the raspi.
I find the static IP way a lot more time consuming and error prone. The IP you choose can be free at the moment you set it, but if a new computer pops up in the network, you can have a conflict. Example: on my network my printer has a reserved IP in the DHCP configuration. If you happen to pick this apparently available IP and I turn the printer on, that's a big mess, because you have not respected the network administrator's work :).
Zeroconf has been made for that: you know nothing about the network and still you're reachable by name. Easy, fast, default on Ubuntu and Apples.
Search "avahi" in this page:
http://raspberrypi.stackexchange.com/questions/38/prepare-for-ssh-without-a-...
To have zeroconf installed in windows: http://support.apple.com/kb/DL999 (yes, it's supposed to be about printers but it works for the whole system)
Cheers,
-- Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
I did some research on the web and found that some people use samba for the same purpose (reach a computer in the local network by its hostname). What are the differences between avahi and samba ? Do they both require a client on the other end ?
Cheers,
Pierre.
2012/9/11 Pierre Massat pimassat@gmail.com
zeronconf looks pretty close indeed to what I was looking for... I'll give it a try tonight and will report the results shortly!
Cheers,
Pierre.
2012/9/11 Charles Goyard cg@fsck.fr
Hi,
let me advocate zeronconf vs. static IP a little more.
Charles Goyard wrote:
Keep dhcp on to satisfy the network topology, and try zeroconf.
Also, it can perfectly be that mdns is enabled by default on Raspian. You can check by issuing a "ping yourpihostname.local" from the raspi.
I find the static IP way a lot more time consuming and error prone. The IP you choose can be free at the moment you set it, but if a new computer pops up in the network, you can have a conflict. Example: on my network my printer has a reserved IP in the DHCP configuration. If you happen to pick this apparently available IP and I turn the printer on, that's a big mess, because you have not respected the network administrator's work :).
Zeroconf has been made for that: you know nothing about the network and still you're reachable by name. Easy, fast, default on Ubuntu and Apples.
Search "avahi" in this page:
http://raspberrypi.stackexchange.com/questions/38/prepare-for-ssh-without-a-...
To have zeroconf installed in windows: http://support.apple.com/kb/DL999 (yes, it's supposed to be about printers but it works for the whole system)
Cheers,
-- Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 12/09/2012 11:09, Pierre Massat a écrit :
I did some research on the web and found that some people use samba for the same purpose (reach a computer in the local network by its hostname). What are the differences between avahi and samba ?
Samba is primarily a file-sharing server-client program, not a decentralized name service. Plus it's fat.
Do they both require a client on the other end ?
Cheers,
Pierre.
2012/9/11 Pierre Massat <pimassat@gmail.com mailto:pimassat@gmail.com>
zeronconf looks pretty close indeed to what I was looking for... I'll give it a try tonight and will report the results shortly! Cheers, Pierre. 2012/9/11 Charles Goyard <cg@fsck.fr <mailto:cg@fsck.fr>> Hi, let me advocate zeronconf vs. static IP a little more. Charles Goyard wrote: > Keep dhcp on to satisfy the network topology, and try zeroconf. Also, it can perfectly be that mdns is enabled by default on Raspian. You can check by issuing a "ping yourpihostname.local" from the raspi. I find the static IP way a lot more time consuming and error prone. The IP you choose can be free at the moment you set it, but if a new computer pops up in the network, you can have a conflict. Example: on my network my printer has a reserved IP in the DHCP configuration. If you happen to pick this apparently available IP and I turn the printer on, that's a big mess, because you have not respected the network administrator's work :). Zeroconf has been made for that: you know nothing about the network and still you're reachable by name. Easy, fast, default on Ubuntu and Apples. Search "avahi" in this page: http://raspberrypi.stackexchange.com/questions/38/prepare-for-ssh-without-a-screen To have zeroconf installed in windows: http://support.apple.com/kb/DL999 (yes, it's supposed to be about printers but it works for the whole system) Cheers, -- Charles _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pierre Massat wrote:
I did some research on the web and found that some people use samba for the same purpose (reach a computer in the local network by its hostname). What are the differences between avahi and samba ?
Zeroconf/avahi is meant for standadized automatic discovery/announce of ressources on a network.
Samba (Windows shared folders) is meant for shared folders. It happens to announce the names too. This is because when SMB arrived (long ago), there was no such things as Zeroconf.
Do they both require a client on the other end ?
To make it short, you can see avahi as a general purpose version of the samba name announcer.
The client can be firefox, ftp, ping, pd, whatever service you use.
Ok, what I really need is a name annoucer. Now, if avahi is installed on my RPi machine called "server_pi" (that I would like to use as a server), can I access it from any other machine connected to the local network by using "http://server_pi" in a web browser, or do I need to have something installed on the client machine first (like Bonjour if it's a windows PC)? I'd rather not install anything on the "client" machine.
Cheers,
Pierre.
2012/9/12 Charles Goyard cg@fsck.fr
Pierre Massat wrote:
I did some research on the web and found that some people use samba for
the
same purpose (reach a computer in the local network by its hostname). What are the differences between avahi and samba ?
Zeroconf/avahi is meant for standadized automatic discovery/announce of ressources on a network.
Samba (Windows shared folders) is meant for shared folders. It happens to announce the names too. This is because when SMB arrived (long ago), there was no such things as Zeroconf.
Do they both require a client on the other end ?
To make it short, you can see avahi as a general purpose version of the samba name announcer.
The client can be firefox, ftp, ping, pd, whatever service you use.
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pierre Massat wrote:
Ok, what I really need is a name annoucer. Now, if avahi is installed on my RPi machine called "server_pi" (that I would like to use as a server),
I'm not sure you can use _ in a hostname. Let's say "server-pi".
can I access it from any other machine connected to the local network by using "http://server_pi" in a web browser,
This would be "http://server-pi.local".
or do I need to have something installed on the client machine first (like Bonjour if it's a windows PC)? I'd rather not install anything on the "client" machine.
Well, for (most) Linux and Apples, it should work. For Windows without Bonjour, you can always tell them the IP (found with "ifconfig | grep -w inet") and make a proposal about installing Linux :).
Le 12/09/2012 11:09, Pierre Massat a écrit :
I did some research on the web and found that some people use samba for the same purpose (reach a computer in the local network by its hostname). What are the differences between avahi and samba ? Do they both require a client on the other end ?
On the other end, if you already run a webserver, you coudl add a bind9 server as a secondary domain name server. It runs fine with Apache or nginx running a web interface : http://www.afn.org/~afn23397/ or Webmin (in the Debian rep but fat) See http://www.debianadmin.com/bind-dns-server-web-interfacefrontend-or-gui-tool...
In that case, you wouldn't need anithung else than DHCP clients.
OH
Cheers,
Pierre.
2012/9/11 Pierre Massat <pimassat@gmail.com mailto:pimassat@gmail.com>
zeronconf looks pretty close indeed to what I was looking for... I'll give it a try tonight and will report the results shortly! Cheers, Pierre. 2012/9/11 Charles Goyard <cg@fsck.fr <mailto:cg@fsck.fr>> Hi, let me advocate zeronconf vs. static IP a little more. Charles Goyard wrote: > Keep dhcp on to satisfy the network topology, and try zeroconf. Also, it can perfectly be that mdns is enabled by default on Raspian. You can check by issuing a "ping yourpihostname.local" from the raspi. I find the static IP way a lot more time consuming and error prone. The IP you choose can be free at the moment you set it, but if a new computer pops up in the network, you can have a conflict. Example: on my network my printer has a reserved IP in the DHCP configuration. If you happen to pick this apparently available IP and I turn the printer on, that's a big mess, because you have not respected the network administrator's work :). Zeroconf has been made for that: you know nothing about the network and still you're reachable by name. Easy, fast, default on Ubuntu and Apples. Search "avahi" in this page: http://raspberrypi.stackexchange.com/questions/38/prepare-for-ssh-without-a-screen To have zeroconf installed in windows: http://support.apple.com/kb/DL999 (yes, it's supposed to be about printers but it works for the whole system) Cheers, -- Charles _______________________________________________ Pd-list@iem.at <mailto:Pd-list@iem.at> mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
Olivier Heinry wrote:
On the other end, if you already run a webserver, you coudl add a bind9 server as a secondary domain name server. It runs fine with Apache or nginx running a web interface : http://www.afn.org/~afn23397/ or Webmin (in the Debian rep but fat) See http://www.debianadmin.com/bind-dns-server-web-interfacefrontend-or-gui-tool...
In that case, you wouldn't need anything else than DHCP clients.
No, because at your option:
And Pierre mentionned he knows only a little about networks. Would you recommand bind to a beginner, you BOFH :) ?
If I understand well what Pierre wanted in the first place, the idea is to come anywhere, plug the web server, and shout "go to http://10.0.0.33" (or http://mymobilewebserver.local/ if using zeroconf).
Cheers,
Le 12/09/2012 12:01, Charles Goyard a écrit :
Hi,
Olivier Heinry wrote:
On the other end, if you already run a webserver, you coudl add a bind9 server as a secondary domain name server. It runs fine with Apache or nginx running a web interface : http://www.afn.org/~afn23397/ or Webmin (in the Debian rep but fat) See http://www.debianadmin.com/bind-dns-server-web-interfacefrontend-or-gui-tool...
In that case, you wouldn't need anything else than DHCP clients.
No, because at your option:
- you require people to manually change the resolver setting to know about the DNS server (/etc/resolv.conf on linux, network preferences on mac & windows), so we're back to manual stuff, and in that case a single static IP on the web server is less work,
- or you have to setup a DHCP server on your mobile web server. *Big mess* if there's already a DHCP server on the network (likely).
Well, as a secondary server, *should* work fine
- you have to setup the existing DHCP server to announce your DNS server (complicated, not always possible), and setup your DNS server as recursive to get the pre-existing DNS records. Overcomplicated for the purpose.
Overall you're right!
And Pierre mentionned he knows only a little about networks. Would you recommand bind to a beginner, you BOFH :) ?
Quoi je suis un beauf?
If I understand well what Pierre wanted in the first place, the idea is to come anywhere, plug the web server, and shout "go to http://10.0.0.33" (or http://mymobilewebserver.local/ if using zeroconf).
Cheers,
Olivier Heinry wrote:
Well, as a secondary server, *should* work fine
No, because the first and secondary DNS servers are supposed to hold the same records, and are a backup for each others. So if a name is absent from the first server, the second won't be asked. The second will be asked if the first server is unreachable or has timeouted.
And Pierre mentionned he knows only a little about networks. Would you recommand bind to a beginner, you BOFH :) ?
Quoi je suis un beauf?
Bastard Operator From Hell, oeuf corse :)
Charles
Ok, fidebaque time ! I installed avahi on the RPi (it's not there by default in Raspbian wheezy). I can access the server running on the Pi by its hostname in a web browser from Windows Vista without having to install Bonjour at all (at last! I've found one nice feature of Vista!). I suspect the same behaviour in 7, but i'll have to check. On the other hand, XP is not able to access it by its hostname by default. Installing Bonjour fixes this. I haven't tested this on a linux machine, but I guess it should work just fine.
zeroconf is really cool. Thanks a lot for turning me on to this!
Cheers,
Pierre.
2012/9/12 Charles Goyard cg@fsck.fr
Olivier Heinry wrote:
Well, as a secondary server, *should* work fine
No, because the first and secondary DNS servers are supposed to hold the same records, and are a backup for each others. So if a name is absent from the first server, the second won't be asked. The second will be asked if the first server is unreachable or has timeouted.
And Pierre mentionned he knows only a little about networks. Would you recommand bind to a beginner, you BOFH :) ?
Quoi je suis un beauf?
Bastard Operator From Hell, oeuf corse :)
++
Charles
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-09-12 12:30, Olivier Heinry wrote:
- or you have to setup a DHCP server on your mobile web server.
*Big
mess* if there's already a DHCP server on the network (likely).
Well, as a secondary server, *should* work fine
secondary DHCP server? chances are high, that you will take half of the machines offline with such a setup.
you never ever should run multiple DHCP-servers in a subnet, unless you absolutely know what you are doing (which seems to be not the case). if you absolutely know what you are doing, you probably still won't run multiple DHCP-servers in a subnet.
mfgasdr IOhannes
I ended up using zeroconf on the RPi and installing bonjour on the windows machine which needed it and it works just fine.
Pierre.
2012/9/27 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-09-12 12:30, Olivier Heinry wrote:
- or you have to setup a DHCP server on your mobile web server.
*Big
mess* if there's already a DHCP server on the network (likely).
Well, as a secondary server, *should* work fine
secondary DHCP server? chances are high, that you will take half of the machines offline with such a setup.
you never ever should run multiple DHCP-servers in a subnet, unless you absolutely know what you are doing (which seems to be not the case). if you absolutely know what you are doing, you probably still won't run multiple DHCP-servers in a subnet.
mfgasdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlBkH9YACgkQkX2Xpv6ydvQDTgCfdRxpz4yp3PO3utTwMWqIu+WK IiMAoJF2/jZvSHkivx2jTzFpxygveRrw =cBKF -----END PGP SIGNATURE-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Don, 2012-09-27 at 11:50 +0200, Pierre Massat wrote:
I ended up using zeroconf on the RPi and installing bonjour on the windows machine which needed it and it works just fine.
Good to hear. In my opinion, this is the best|recommended solution and doesn't require additional software except on old Windows machines (and probably non-Desktop Debian installations).
Roman
2012/9/27 IOhannes m zmoelnig zmoelnig@iem.at -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-09-12 12:30, Olivier Heinry wrote: >> - or you have to setup a DHCP server on your mobile web server. >> *Big >>> mess* if there's already a DHCP server on the network >>> (likely). > Well, as a secondary server, *should* work fine > secondary DHCP server? chances are high, that you will take half of the machines offline with such a setup. you never ever should run multiple DHCP-servers in a subnet, unless you absolutely know what you are doing (which seems to be not the case). if you absolutely know what you are doing, you probably still won't run multiple DHCP-servers in a subnet. mfgasdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlBkH9YACgkQkX2Xpv6ydvQDTgCfdRxpz4yp3PO3utTwMWqIu +WK IiMAoJF2/jZvSHkivx2jTzFpxygveRrw =cBKF -----END PGP SIGNATURE----- _______________________________________________ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Good to know, and hear about zeroconf success through this example. Something new to try in the future.
Andy
On Thu, Sep 27, 2012 at 11:50:50AM +0200, Pierre Massat wrote:
I ended up using zeroconf on the RPi and installing bonjour on the windows machine which needed it and it works just fine.
Pierre.
2012/9/27 IOhannes m zmoelnig zmoelnig@iem.at
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-09-12 12:30, Olivier Heinry wrote:
- or you have to setup a DHCP server on your mobile web server.
*Big
mess* if there's already a DHCP server on the network (likely).
Well, as a secondary server, *should* work fine
secondary DHCP server? chances are high, that you will take half of the machines offline with such a setup.
you never ever should run multiple DHCP-servers in a subnet, unless you absolutely know what you are doing (which seems to be not the case). if you absolutely know what you are doing, you probably still won't run multiple DHCP-servers in a subnet.
mfgasdr IOhannes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlBkH9YACgkQkX2Xpv6ydvQDTgCfdRxpz4yp3PO3utTwMWqIu+WK IiMAoJF2/jZvSHkivx2jTzFpxygveRrw =cBKF -----END PGP SIGNATURE-----
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
IOhannes m zmoelnig wrote:
On 2012-09-12 12:30, Olivier Heinry wrote:
- or you have to setup a DHCP server on your mobile web server.
*Big mess* if there's already a DHCP server on the network (likely).
Well, as a secondary server, *should* work fine
secondary DHCP server?
No, secondary DNS server. In both case it won't work as expected.
chances are high, that you will take half of the machines offline with such a setup.
Sure, hours of fun :).
Charlot
Hi,
I have a netgear router and it's possible to reserve a particular IP for a given MAC address. To find the MAC address of the card type in a terminal "sudo ifconfig". It should show a listing for the ethernet port or wireless adapter if you're using one. Look for the "HW address" (or something similar) and this is your MAC address.
Hopefully with this information in hand, your router's configuration page (with the netgear this is accessed via a web browser) will give you the option of reserving an IP for the MAC address via DHCP. On the netgear this config is done under the heading "IP Configuration of LAN".
cheers,
iain
Em Seg, 2012-09-10 às 16:41 +0200, Pierre Massat escreveu:
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 -> http://lists.puredata.info/listinfo/pd-list
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 -> http://lists.puredata.info/listinfo/pd-list
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 ->
On Mon, Sep 10, 2012 at 2:32 PM, Pierre Massat pimassat@gmail.com wrote:
Ok, so the static IP is the way to go.
Actually, Mr Goyard's suggestion is more like what you described. A static IP won't let you just set it up and 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?
You have to get this information about the network by being connected to it. Choosing the right value for a static IP means that you have to know the DHCP range on the router, and that no IP is already assigned to the address you picked. You can get this information from the configuration of the router--my guess is that you won't have access to it, when you go somewhere else.
The static IP option is going to be the most labor/time intensive. It would generally be better to be ~lazy, and just get the IP once you've connected via DHCP, or follow through the steps to setup zeroconf so you just use the same name every time (and disregard the network/IP).
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 -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mon, Sep 10, 2012 at 09:32:38PM +0200, Pierre Massat wrote:
Ok, so the static IP is the way to go. Can I choose x and y arbitrarily ?
Pretty much yes. Obviously the aim is to avoid a clash of IPs, but DHCP running on the behalf of the other things in your network will work by asigning around fixed IPs. Mixed dynamic and static isn't as bad as it may seem when one person is configuring the network and knows all the devices.
How do I know what value of x will match my subnet ?
The router will itself be on that subnet, and its dhcpd will asign joining workstations on that subnet too, so for example if the router is 192.168.0.254 then it will probably have allocated some other machines as 192.168.0.1, 192.168.0.2 and so on. On any of those boxes try
$ ifconfig (nix)
ipconfig (win)
As for the value of y, I guess any value high enough (say, 50) in a small home network will do, right?
Yes. Assuming that dynamic allocation starts at 192.168.x.1 and grows upward some people adopt the scheme of allocating static IPs from the top downward, maybe start at 192.168.0.250, the next at 192.168.0.249 and so on.
best, Andy