What's new

Is it possible to change a routers settings via ssh?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

So I'm trying (I guess "hacky"(?)) methods to accomplish the same effect. I thought that if I disable and then renable DHCP on the router, it might have the same effect, so I did like this:

Code:
nvram set dhcp_dns1_x=123.123.123.123; nvram set dhcp_dns2_x=321.321.321.321; dhcp_enable_x=0; nvram commit; dhcp_enable_x=1; nvram commit; service restart_dnsmasq
And from what I can tell, it *somewhat* works?
In this case, you really didn’t disable DHCP because you didn’t restart dnsmasq in between disabling the nvram setting and enabling it. But I don’t think it would have helped anyway. The net effect was just restarting dnsmasq.
 
You could try either of these network restart commands to force clients to disconnect and maybe renew their leases. Not sure it will work, and I haven’t tested it before suggesting it.

No /etc/init.d

@dave14305 ! you're a life saver! This is working!

Code:
nvram set dhcp_dns1_x=1.1.1.1; nvram set dhcp_dns2_x=1.0.0.1; nvram commit; service restart_net;

I run that command, and there's about a 30 second delay while the service restarts where the internet is unusable, but it's still WAY better than a full reboot, and as soon as it comes back up all of the correct DNSs that were edited are now listed with all of the proper NICs.

I have done about 5 tests on my main Windows 10 machine so far with it and always successful; I haven't tested with any other devices yet on my LAN, like my phone, etc., but I'm crossing my fingers and assuming it'll work fine.

Thanks a trillion! :)
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top