Loss of Default Gateway

I've just changed my router, but the new one has been setup with the same IP address (192.168.1.254).

I've also got 6 PIs on my network. Of those, 2 seem OK, but the other four have decided that their default gateway is now going to be

192.168.1.1.

I've used route delete default gw 192.168.1.1 eth0 route add default gw 192.168.1.254 eth0

to reset the default gateway, but in each case, overnight the default has reset itself back to 192.168.1.1 None of the PIs have been rebooted. I'm not convinced that this is a coincidence, but my WIN7 PC also reset the default gateway mid evening (whilst I was using it), again to 192.168.1.1.

Any suggestions on how I can persuade my PIs to stick to the proper GW ?

Thanks

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian
Loading thread data ...

Have a feeling default routes are set elsewhere these days

Lemme see in Mi Pi...

Ah yes. Imn /etc/dhcpcd.conf

there will be a line saying

static routers=192.168.1.254 or whatever.

Make sure it is.

Pis tend to use dhcp and te easy way to static them is to frig with dhcp

- but these Pis might hacve decided to 'renew their leases'

And also make sure that the router* isnt advertising a bad gateway

*or some other dhcp master on the LAN
--
Labour - a bunch of rich people convincing poor people to vote for rich  
people 
 Click to see the full signature
Reply to
The Natural Philosopher

Thanks.

This is rather odd. The two PIs that are behaving don't have a /etc/dhcpcd.conf file at all. The other four have one, but the relevant entries were commented out.

It will be interesting to see if things behave now.

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

That is consistent with a full DHCP non static address.

Is your new router advertising the wrong gateway?

--
Canada is all right really, though not for the whole weekend. 

"Saki"
Reply to
The Natural Philosopher

ther

The router is probably still advertising 192.168.1.1 as the default gateway via DHCP. Make sure it doesn't have a separate setting for the default gateway, as some will allow it to be different from their own address. Then reboot the router, and any Pis with the wrong gateway (or use dhclient to get a new lease).

---druck

Reply to
druck

A bit more digging in the router, and indeed, it is possible to have a gateway IP address that is different to the router IP address. I've changed the gateway IP address from 1.1 to 1.254 and rebooted. Time will tell what that does. A quick test with my phone suggests that it is working.

Thanks

Adrian

--
To Reply : 
replace "bulleid" with "adrian" - all mail to bulleid is rejected 
 Click to see the full signature
Reply to
Adrian

That is sound practice anyway. So that 'dhcp only' clients will work

--
You can get much farther with a kind word and a gun than you can with a  
kind word alone. 
 Click to see the full signature
Reply to
The Natural Philosopher

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.