1# Network Management 2 3## Overview 4 5A Network Manager is a daemon which handles network management operations. It 6must implement the `xyz.openbmc_project.Network.SystemConfiguration.interface` 7and `org.freedesktop.DBus.ObjectManager`. 8 9When the network manager daemon comes up, it should create objects implementing 10physical link/virtual interfaces such as 11`xyz.openbmc_project.Network.EthernetInterface` or 12`xyz.openbmc_project.Network.VLANInterface` on the system. 13 14IP address(v4 and v6) objects must be children objects of the physical/virtual 15interface object. 16 17## Interfaces 18 191. SystemConfiguration: This describes the system-specific parameters. 202. EthernetInterface: This describes the interface-specific parameters. 213. IP: This describes the IP address-specific parameters. 224. IPProtocol: This describes the IP protocol type (IPv4/IPv6). 235. VLANInterface: This describes the VLAN-specific properties. 246. Bond: This describes the interface bonding parameters. 25 26# DbusObjects 27 28## Interface Objects 29 30Interface objects can be physical as well as virtual. 31 32If the object is a physical interface, it can't be deleted, but if it is a 33virtual interface object it can be deleted. 34 35Example: `/xyz/openbmc_project/network/eth0` 36 37## IPAddress Objects 38 39There can be multiple IP address objects under an interface object. These 40objects can be deleted by the delete function. 41 42IPv4 objects will have the following D-Bus object path. 43 44Example: `/xyz/openbmc_project/network/eth0/ipv4/3fd41d13/` 45 46IPv6 objects will have the following D-Bus object path. 47 48Example: `/xyz/openbmc_project/network/eth0/ipv6/5dfghilp/` 49 50## Conf Object 51 52This object will have the system configuration related parameters. 53 54Example: `/xyz/openbmc_project/network/conf` 55 56# UseCases 57 58## Configure IP address: 59 60busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/<interface> 61xyz.openbmc_project.Network.IP.Create IP ssys 62"xyz.openbmc_project.Network.IP.Protocol.IPv4" "<ip>" <subnetmask> 63"<networkgateway>" 64 65curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d 66'{"data":["xyz.openbmc_project.Network.IP.Protocol.IPv4","<ip>",<subnetmask>,"<networkGateway>"] 67}' https://<hostname/ip>/xyz/openbmc_project/network/eth0/action/IP 68 69## Configure Default Gateway 70 71### Get 72 73busctl get-property xyz.openbmc_project.Network 74/xyz/openbmc_project/network/config 75xyz.openbmc_project.Network.SystemConfiguration DefaultGateway 76 77curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET 78https://<hostname/ip>/xyz/openbmc_project/network/config/attr/DefaultGateway 79 80### Set 81 82busctl set-property xyz.openbmc_project.Network 83/xyz/openbmc_project/network/config 84xyz.openbmc_project.Network.SystemConfiguration DefaultGateway s 85"<DefaultGateway>" 86 87curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 88"x.x.x.x"}' 89https://<hostname/ip>/xyz/openbmc_project/network/config/attr/DefaultGateway 90 91NOTE: Since the system does not allow unpingable gateway address, make sure the 92gateway address is pingable. 93 94## Configure HostName 95 96### Get 97 98busctl get-property xyz.openbmc_project.Network 99/xyz/openbmc_project/network/config 100xyz.openbmc_project.Network.SystemConfiguration HostName 101 102curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET 103https://<hostname/ip>/xyz/openbmc_project/network/config/attr/HostName 104 105### Set 106 107busctl set-property xyz.openbmc_project.Network 108/xyz/openbmc_project/network/config 109xyz.openbmc_project.Network.SystemConfiguration HostName s "<HostName>" 110 111curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 112"<hostname>"}' 113https://<hostname/ip>/xyz/openbmc_project/network/config/attr/HostName 114 115## Delete IP address 116 117busctl call xyz.openbmc_project.Network 118/xyz/openbmc_project/network/<interface>/ipv4/<id> 119xyz.openbmc_project.Object.Delete Delete 120 121NOTE: How to get the ipv4/id: After creating the IP address object enumerate the 122network interface object. 123 124curl -c cjar -b cjar -k -H "Content-Type: application/json" -X DELETE 125https://<hostname/ip>/xyz/openbmc_project/network/eth0/ipv4/fbfc29b 126 127## Configure DHCP 128 129### Get 130 131busctl get-property xyz.openbmc_project.Network 132/xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.EthernetInterface 133DHCPEnabled 134 135curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET 136https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/DHCPEnabled 137 138### Set 139 140busctl set-property xyz.openbmc_project.Network 141/xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.EthernetInterface 142DHCPEnabled b 1 143 144curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 1451}' https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/DHCPEnabled 146 147## Configure MACAddress 148 149### Get 150 151busctl get-property xyz.openbmc_project.Network 152/xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.MACAddress 153MACAddress 154 155curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET 156https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/MACAddress 157 158### Set 159 160NOTE: MAC address should be LOCAL ADMIN MAC (2nd bit of first byte should be 161on). 162 163busctl set-property xyz.openbmc_project.Network 164/xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.MACAddress 165MACAddress s "XX:XX:XX:XX:XX:XX" 166 167curl -c cjar -b cjar -k -H "Content-Type: application/jon" -X PUT -d '{"data": 168"XX:XX:XX:XX:XX:XX" }' 169https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/MACAddress 170 171## Network factory reset 172 173busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network 174xyz.openbmc_project.Common.FactoryReset Reset 175 176curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d 177'{"data":[] }' https://<hostname/ip>/xyz/openbmc_project/network/action/Reset 178 179## VLAN 180 181### Create 182 183curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d 184'{"data":["eth0",50] }' 185https://<hostname/ip>/xyz/openbmc_project/network/action/VLAN 186 187### Delete 188 189curl -c cjar -b cjar -k -H "Content-Type: application/json" -X DELETE 190https://<hostname/ip>/xyz/openbmc_project/network/eth0_50 191 192busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0_50 193xyz.openbmc_project.Object.Delete Delete 194 195### Enumerate 196 197curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET 198https://<hostname/ip>/xyz/openbmc_project/network/eth0_50/enumerate 199 200### Configure IP on VLAN Interface 201 202Please refer to the "Configure IP address" section. 203