0

I'm trying to set up a static IP for the Raspberry Pi but the Verizon router keeps ignoring the interfaces config file and uses it's own DHCP IP address. I tried sudo rm /var/lib/dhcp/* to remove licenses but that did not work. I tried to refresh the router and remove the old instance of the Raspberry Pi from the DHCP list but that did not work either. Why is this happening and how do I fix it? Below is the config file:

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet static
        pre-up /etc/firewall-openvpn-rules.sh
address 192.168.1.18
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

allow-hotplug wlan0
iface wlan0 inet manual
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
        wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Milliways
  • 59,890
  • 31
  • 101
  • 209
Danica Panica
  • 439
  • 3
  • 7
  • 2
    Of course the router ignores a file on the Pi, why on earth would it be affected by a random file on the network? You need to configure the Verizon router at the Verizon router. The Pi appears to be irrelevant to your question. – joan Dec 07 '15 at 09:24
  • "how do I fix it?" How did you break it? In simpler terms what did you do to the "interfaces config file" – Milliways Dec 07 '15 at 09:50
  • Which raspbian. Wheezy or jessie. With jessie you may need to sudo systemctl daemon-reload after editing interfaces file – Jaromanda X Dec 08 '15 at 06:46
  • @joan: previously the only thing i had to do on the router was the port forwarding for the VPN. the router seemed to have picked up on the interfaces config file – Danica Panica Dec 08 '15 at 16:48
  • @Milliways: i think i broke it when i reformatted the Raspberry Pi and reinstalled Raspian Noobs. this is the newer version Jessie and things are not working the same way. here is the config file: 'source-directory /etc/network/interfaces.d auto lo iface lo inet loopback

    iface eth0 inet static pre-up /etc/firewall-openvpn-rules.sh address 192.168.1.18 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1'

    – Danica Panica Dec 08 '15 at 16:59
  • @Jaromanda X: i was using Wheezy before. now it has been updated to Jessie when i reinstalled Raspian. so things are different. i just tried the daemon-reload command and it did not work. it is still stuck on the DHCP address and refuses to follow the Static address in the interfaces config file. – Danica Panica Dec 08 '15 at 17:03
  • inline 'source-directory /etc/network/interfaces.d

    auto lo iface lo inet loopback

    iface eth0 inet static pre-up /etc/firewall-openvpn-rules.sh address 192.168.1.18 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 allow-hotplug wlan0 iface wlan0 inet manual

    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

    allow-hotplug wlan1 iface wlan1 inet manual

    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf'

    – Danica Panica Dec 08 '15 at 17:22
  • @Dan DO NOT enter code into comments - it is illegible. Paste into your question. – Milliways Dec 08 '15 at 22:55
  • @Milliways: tried to edit the question with the code - still not coming out right. lol – Danica Panica Dec 09 '15 at 02:04

1 Answers1

0

You cannot set static addresses this way (at least not without disabling other software).

Follow the instructions in the following to configure.

How do I set up networking/WiFi/static IP address?

As usual, I will point out that there are better options than setting a static addresses (discussed in the above link).

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • If you feel the other question solves this, you should flag the question for closing as a duplicate. Just posting a link to another answer isn't really how stack exchange sites work. – Chris Stratton Dec 09 '15 at 03:45
  • @Milliways: i added the 3 lines according to the link on top of the /etc/dhcpcd.config file and got the static IP to work now. thanks. – Danica Panica Dec 09 '15 at 12:05