0

Why do I cant update my gateway ip? I have rebooted many times and nothing...

I have this configuration /etc/network/interfaces

# The loopback network interface
auto lo eth0
iface lo inet loopback

# The primary network interface
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    broadcast 192.168.1.255
    network 192.168.1.0
    gateway 192.168.1.254
dns-nameservers 192.168.1.254

Have this route

pi@raspberrypi ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

Routing table should update to 192.168.1.254, right?


Solution:

I had an ip configuration on cmdline.txt (located on boot folder), i just had to remove it and everything started to work good. The reason i still had that configuration was because i forgot to remove it, i dont have any SD card reader, so i had to add some ip on boot load.

Sry and thanks everyone :)

  • turned off the raspberry for 1 hour and started to work...router problem? maybe – Vítor Campeã Mar 22 '15 at 22:22
1

Change auto lo eth0 to auto eth0 on the second line of interfaces file.

EDIT: Well then. I think you have to do it manually.

Type these in exact order (based on your configs)

route del default ---> Just ignore if it says any errors and stuff. Then,

route add default gw 192.168.1.254 dev eth0

Anyways, before trying it, try this interface file first. Replace the old one.

# The loopback network interface
auto eth0
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
  address 192.168.1.100
  netmask 255.255.255.0
  gateway 192.168.1.254
dns-nameservers 192.168.1.254

REBOOT AFTER YOU ARE DONE. RESTARTING NETWORKING DOES NOT ALWAYS CUT IT!

  • didnt worked :( – Vítor Campeã Mar 23 '15 at 18:22
  • updated it. Simplified your network config file. Reduced the amount of spaces before address, netmask, and gateway (was my issue before). Fixed up "auto eth0". Allowed hotplugging. Dumped unnecessary settings. Mark as answer if it worked :D – PNDA Mar 24 '15 at 8:27
  • 1
    thanks for the help but the problem was another, i had a ip configuration on a boot file cmdline.txt, as soon i removed everything worked very well – Vítor Campeã Mar 25 '15 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.