/network-interface-manager

Test task to create Windows Service hosting OWIN/Web API that manages PC Network Interface's IPv4 Addresses

Primary LanguageC#

Network Interface Manager

Through app.config it is possible to configure port (by default, 9000) which service listen for REST requests

Web API service accepts GET and POST methods at endpoint http://localhost:9000/api/network/interface

GET without parameters will return all network interfaces and their IPv4 addresses

[
    {
        "name": "Ethernet",
        "description": "Realtek PCIe GBE Family Controller",
        "addresses": [
            {
                "ip4address": "192.168.1.112",
                "subnetMask": "255.255.255.0"
            }
        ]
    }
]

POST adds IPv4 address to the list, and if OK 200 it will return new object describing updated Network Interface

Params:

Name Sample Value
networkInterfaceName Ethernet
ipAddress 192.168.1.118
subnetMask 255.255.255.0