After the network restarts, dnsmasq must be restarted

Sometimes it is necessary to restart the network (/etc/init.d/network restart), but after restarting the network, the devices under the router cannot access the Internet even if the connection status is normal. After restarting dnsmasq (/etc/init.d/dnsmasq restart), all The device can access the Internet. The device under the router has a static IP, and DHCP obtains the IP. All devices use public DNS. The DNS provided by routing dnsmasq is not applicable. I don't know why?

That probably depends on what you actually changed in the network to begin with.
The network settings is kind of the big foundation to the whole OpenWRT firmware system so you probably need to restart most systems around the network after changes in the network.

Just restart the service without making any changes. If the server that relies on the network cannot be restarted automatically, then restarting the network operation is of little significance, and it is better to restart the system

If you look in the init.d file in /etc.
What does it say for the network?

Why did you do that to begin with? Or did you change anything somewhere else you didn’t mentioned?

For example: I sometimes want to re-dial up PPPoE through /etc/init.d/network restart, although I know that ifup wan can be done.

Well, then you are trying to use a sledgehammer for a minimal task. Use ifup wan.

Sure, but it is a major operation, and it should not be done without a good reason. And "necessary" means that no smaller easy thing (like "ifup wan") works, right?

Not all dependent services may notice the network restart. I think that they usually monitor the network config file for changes, so a network restart without changes goes undetected.

1 Like

For example: redialing, resetting statistics data such as traffic, enabling all devices to connect, etc. In fact, here we should not focus on why we need to restart the network, and our focus is that since this function is provided, other servers have also done it. Depend on the configuration, then it should work properly.

Well, OpenWrt is a community project, so feel free to investigate the issue and author patches to fix things, and then propose those fixes to the core devs.