netcfg is a method for configuring and managing network interfaces. The goal
is to provide an intuitive "back-end" for doing so. After the "back-end" is
created a configuration daemon should be created that provides a user interface,
reading the configuration supplied from file
and then using the utilities
detailed here to "push" the configuration.
The immediate motivation for changing the method of configuring network interfaces are as follows.
- We need to be able to handle multiple interfaces.
- Handling of interfaces configured to use DHCP is currently non-functional.
- No method to change interface IP addresses or the gateway IP.
Once IPv6 is supported, the situation is expected to become more complex.
- adding/removing IPv4 addresses
- adding/removing the IPv4 gateway
- adding/changing the mac address
- setting the interface up/down
- return a list of all neighbors (ARP cache).
- ability to "listen" for a change in one of the above
__________ ________________
---------- | Config | | Network |
| Smolnetd | <-> | Protocol | <- | Config |
---------- ---------- | Application(s) |
^ | (dhcpd) |
| ----------------
_______________
| Desktop |
| GUI |
| Displaying |
| Interface |
| Configuration |
---------------
Create a scheme under network:netcfg
that contains endpoints for
each of the options to configure for each interface.
The design proposed here is quite simple. Create netcfg
which contains
a path for each network interface id. Each of these paths contain a
endpoint for mac
, flags
, ipv4/addrs
, ipv4/neighbors
, and
ipv4/routes
.
network:netcfg
├── 0
│ ├── mac
│ ├── flags
│ └── ipv4
│ ├── addrs
│ ├── neighbors
│ └── routes
└── 1
...
- The simplicity of this design makes it the most intuitive of the two.
- As the number and complexity of routes increase, we're placing a
greater burden on the end-user to keep the format of the "file"
correct (Think
/etc/passwd
). - We do not have the ability to return errors to the user. For example, we cannot inform a user that the address they provided was malformed.
- The addition of IPv6 will make this a bit more complex due to the increased complexity of default routes.
Create a scheme endpoint under network:netcfg
that loosely adheres to
the netlink protocol, in particular RFC 3549 § 2.3.3.2.
TODO(@dlrobertson)
- The addition of error messages may make this nice for advanced users
- Users do not need to worry about keeping the format of the "file" correct.
- Create new socket type with a new binary protocol.
- Far from intuitive