NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

TerryJColes's avatar
TerryJColes
Luminary
Jun 29, 2020
Solved

Using a Static IP Address on a Raspberry Pi Connected to my Nighthawk Router

Hi,

 

I have a couple of Raspberry Pis connected to my Home Network which is provided by my Netgear Router.  Ideally I want to set up a static IP Address for each of these Pis, but I cannot make them 'see' the Internet reliably unless I use Address Reservation in LAN Setup page.  This works, but it means that I can only have the IP Address that the Router gave me through DHCP before I reserved it.  What I really want is to specify static IP Addresses in the 'dhcpcd.conf' file on the Pis and have the Router accept these as the addresses to use.

 

I'm sure that I was able to do this in the past, but not any more.

 

Also.  If I reserve the DHCP Server on the Router gave me, I'm sure I used to be able to edit this to the IP Address that I want but this also causes the system to fail.  (For info.  The Router assigns the address and I can connect to either Pi using SSH via the LAN, but the Pis can't see the Internet.)

 

Is there a way to do this?


  • schumaku wrote:

    So t the end of the day, what went wrong and broke the Pi <-> D7800 connection and the Internet connection finally?


    The router was unaware of the presence of the Webserver, so didn't route Google traffic when I was trying to use the Static IP.

13 Replies

  • Configure the Raspberry Pi staticly. That means going into the Pi and assigning an IP address, mask and gateway. Make sure the IP address is outside of the DHCP scope on the router to get things to work. I have 2 Pi's setup this way. One is running Pi-Hole. 

     

    If you need help with the assigning, Google is your friend. Lots of Pi info there. 

    • TerryJColes's avatar
      TerryJColes
      Luminary

      'Configure the Raspberry Pi staticly. That means going into the Pi and assigning an IP address, mask and gateway. '

       

      I have been configuring the IP address statically, eg:

      # Static IP configuration:
      interface eth1
      static ip_address=192.168.1.98/24
      static routers=192.168.1.1
      static domain_name_servers=8.8.8.8
      metric 200

      What do you mean by 'mask and gateway' in this context?

      • labatt's avatar
        labatt
        Mentor

        TerryJColes wrote:

        'Configure the Raspberry Pi staticly. That means going into the Pi and assigning an IP address, mask and gateway. '

         

        I have been configuring the IP address statically, eg:

        # Static IP configuration:
        interface eth1
        static ip_address=192.168.1.98/24
        static routers=192.168.1.1
        static domain_name_servers=8.8.8.8
        metric 200

        What do you mean by 'mask and gateway' in this context?


        I suspect when you did the actual configuration on the Pi you were asked mask. That does not show when doing the command you gave.  

        Normally when doing the actual assignment there is a mask question. Is the .98 address within your DHCP scope? If so that can cause issues.

        Can you ping the Pi? If not then that would be where to start assuming the .98 is outside of the DHCP scope. 

        If you do a ifconfig eth1 you should see the mask. Here is output on my Pi.

        ifconfig eth0
        eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
        inet 192.168.1.220 netmask 255.255.255.0 broadcast 192.168.1.255
        inet6 fe80::1683:1051:7637:eeeb prefixlen 64 scopeid 0x20<link>
        ether b8:27:eb:57:7d:03 txqueuelen 1000 (Ethernet)
        RX packets 1561476 bytes 193229943 (184.2 MiB)
        RX errors 0 dropped 1 overruns 0 frame 0
        TX packets 961779 bytes 114655160 (109.3 MiB)
        TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0