| Both sides previous revision Previous revision Next revision | Previous revision |
| docs:techref:netifd [2020/12/30 01:12] – lemoer | docs:techref:netifd [2023/10/06 04:17] (current) – update links vgaetera |
|---|
| * some scripts in ''/etc/hotplug.d''.) | * some scripts in ''/etc/hotplug.d''.) |
| |
| ''netifd'' is intended to stay compatible with the existing format of ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'', the only exceptions being rare special cases like | ''netifd'' is intended to stay compatible with the existing format of ''[[docs:guide-user:network:network_configuration|/etc/config/network]]'', the only exceptions being rare special cases like |
| aliases or the overlay variables in ''/var/state'' (though even most of those can be easily emulated). | aliases or the overlay variables in ''/var/state'' (though even most of those can be easily emulated). |
| |
| |
| * Add the switch ''-l <level>'' to ///etc/init.d/network// | * Add the switch ''-l <level>'' to ///etc/init.d/network// |
| * Level is a an integer: | * Level is specified as an integer: |
| * 1 = L_CRIT | * 1 = L_CRIT |
| * 2 = L_WARNING | * 2 = L_WARNING |
| * 3 = L_NOTICE | * 3 = L_NOTICE (default) |
| * 4 = L_INFO | * 4 = L_INFO |
| * 5 = L_DEBUG | * 5 = L_DEBUG |
| * 4 = DEBUG_INTERFACE | * 4 = DEBUG_INTERFACE |
| * 8 = DEBUG_WIRELESS | * 8 = DEBUG_WIRELESS |
| * Add your favorite options together to optain the ''<mask>''. | * Add your favorite options together to obtain the ''<mask>''. |
| | |
| | * In order for the output to be seen you'll need to modify /etc/init.d/network to add: |
| | * procd_set_param stdout 1 |
| | * procd_set_param stderr 1 |
| | * to start_service so that procd doesn't send netifd hotplug script output to /dev/null. |
| |
| ==== Help with the development of netifd ==== | ==== Help with the development of netifd ==== |
| |
| ==== Why do we want netifd? ==== | ==== Why do we want netifd? ==== |
| One thing that ''netifd'' does much better then old //OpenWrt-network configuration scripts// is handling configuration changes. With ''netfid'', when the file ''[[docs:guide-user:base-system:basic-networking|/etc/config/network]]'' changes, you no longer have to restart all interfaces. Simply run **''/etc/init.d/network reload''**. This will issue an ''ubus''-call to ''netifd'', telling it to figure out the difference between runtime state and the new config and apply only that. This works on a per-interface level, even with protocol handlers written as shell scripts. | One thing that ''netifd'' does much better then old //OpenWrt-network configuration scripts// is handling configuration changes. With ''netifd'', when the file ''[[docs:guide-user:network:network_configuration|/etc/config/network]]'' changes, you no longer have to restart all interfaces. Simply run **''/etc/init.d/network reload''**. This will issue an ''ubus''-call to ''netifd'', telling it to figure out the difference between runtime state and the new config and apply only that. This works on a per-interface level, even with protocol handlers written as shell scripts. |
| |
| It boils down to the fact that the current network and interface setup mechanisms (via network configuration scripts) are rather constrained and inflexible: | It boils down to the fact that the current network and interface setup mechanisms (via network configuration scripts) are rather constrained and inflexible: |