Need a clean network config example

So in monkeying around with my network config, I have managed to hose it up. I'm looking for a clean and simple working example for a typical wifi router configuration (with ipv4 and ipv6). I'm confused by what is the interface vs. device. I checked documentation and couldn't locate a basic example.

Looking for /etc/config/network or a screenshot from Luci.

Thanks for your help!

Why not do a reset?

4 Likes

If I'm not mistaken then /etc/config/network is auto configured during boot if not present.... Right?

1 Like

Loading defaults for the device…

Which should be a clean config?

yes , it will be

A clean config will be auto generated if you reset the device.

2 Likes

The router has a rather extensive configuration of firewall rules and static hosts...if I do a reset I would lose all that. I just got confused with what should be in /etc/config/network and I can't get it back to square one.

Yeah but maybe the user does not want to revert everything

Then do an export of the config, reset it, replace the bad part in the export, and reimport the settings.

2 Likes
  1. Network settings are device specific (and you do not mention your device).
  2. Even if someone were to hand you their configuration you'd still have to modify MAC addresses yourself.

The network configuration is generated upon first boot, either reset your device (after backing up settings) like @frollic suggested, or regenerate or manually by running the abroad script(s) in /etc/board.d/.

2 Likes

Interface is L3 routing/logical routing, in basic practical terms that means IP address based data movement.

Device is L2 routing, in meaningful words that means the switch ports definitions are in the device settings. Here is also VLAN data movement controlled since it is hardware controlled in the switch.

You should make a copy of a clean file before you start making changes to it...

Like suggested in the thread, the network config defaults are re-generated at boot, if they are missing.

But there is no need to reset the whole device.
It should be enough to delete (or rename) the current /etc/config/network file, so that it is not there in the boot. Then it will be generated with defaults.
No need to delete e.g. the firewall config (assuming that the LAN part is compatible with the default network config.)

2 Likes

Run the commands below and find your default network configuration file in the /root directory.
The current network configuration (and everything else) will remain intact.

mv /etc/config/network /etc/config/cur_net
/bin/config_generate
mv /etc/config/network /root/network_default
mv /etc/config/cur_net /etc/config/network
4 Likes