give a fixed IP address

Hello everyone

I wanted to ask you a question, you can give a fixed IP address to the raspberry

Ian Eagland's picture

Re: give a fixed IP address

Hi

Yes, I have done this. You will have to fix the address in your router. Search for your router instructions on google and you should find details of what you need to do.

Regards

Ian

 

 

 

serbat's picture

Re: give a fixed IP address

hello Ian

Kindly might be more accurate.
how or what you did to make it a fixed ip of raspberry, the explanation that you gave me is too general.

Excuse my bad English

 

Regards

Robert Wall's picture

Re: give a fixed IP address

A fixed IP address is something you do in your router. It is not part of the setup of the Raspberry Pi.  Look inside the operating instructions for your router, and search for "fixed IP address", "static IP address" or "reserved IP address".  It will allow you to choose an address. You can use the address it has already, if you wish. This is what a Netgear manual says:

Reserved IP addresses
When you specify a reserved IP address for a computer on the LAN, that computer will always
receive the same IP address each time it accesses the router’s DHCP server. Reserved IP addresses
should be assigned to servers that require permanent IP settings.
To reserve an IP address:
1. Click the Add button.
2. In the IP Address box, type the IP address to assign to the computer or server.
    Choose an IP address from the router’s LAN subnet, such as 192.168.0.x.
3. Type the MAC Address of the computer or server.
     Tip: If the computer is already present on your network, you can copy its MAC address from
     the Attached Devices menu and paste it here.
4. Click Apply to enter the reserved address into the table.
     Note: The reserved address will not be assigned until the next time the computer contacts the
     router's DHCP server. Reboot the computer or access its IP configuration and force a DHCP
     release and renew.

My laptop normally receives the IP address "192.168.1.65"  I have assigned the IP address "192.168.1.66" to my NanodeRF.

serbat's picture

Re: give a fixed IP address

Hi Robert

Thank you so much response, actually I did not know you could set an ip address from the modem directly.

Thanks again for your cooperation

 

Regards

Bill Thomson's picture

Re: give a fixed IP address

Actually, setting up a fixed (usually referred to as static) address on a Raspberry Pi is part of the setup on a Pi. While it's not difficult to do, it's arguably easier to use a Pi configured for DHCP, or as Robert describes above, a configuration often called "static" DHCP. The main thing to be aware of when using static IP addressing is to to be sure not to assign the Pi an address that's inside your router's DHCP address pool. (this is the "difficulty factor," and the reason why DCHP or static DHCP are what most folks are going to want to use.) You'll need to know your router's IP address as well. All that aside, here's how it's done.

edit the file /etc/network/interfaces. (sudo nano /etc/network/interfaces)

Change:

iface eth0 inet dhcp

to

iface eth0 inet static

Below that line, enter the following - replacing x where necessary,
for your network configuration.

address 192.168.x.x
netmask 255.255.255.0
network 192.168.x.0
broadcast 192.168.x.255
gateway 192.168.x.x

Save the file, reboot. You're done configuring your Pi.


Here's an example of the interfaces file I use on my Pi:

auto lo

iface eth0 inet static

address 192.168.1.104

gateway 192.168.1.254

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

 

Regards,

Bill

 

serbat's picture

Re: give a fixed IP address

Thanks bill

I also try your suggestion.

This path "" / etc / network / interfaces "" I find it on the SD card, correct?

Regards

Bill Thomson's picture

Re: give a fixed IP address

If you're not using a hard disk drive to run emoncms on, yes, the /etc/network/interface file is on the SD card. (NB there's no spaces between any of the characters in /etc/network/interfaces) Otherwise, if you're running emoncms on an SD card/Hard disk combination, the file will be on the hard disk drive. Either way, issuing the command cd /etc/network/interfaces will take you to the directory where the file is, whether it be an SD card, or a hard disk.

HTH

Bill

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.