1# Network Management 2 3## Overview 4 5A Network Manager is a daemon which handles network management operations. 6It must 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 10implementing physical 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 15physical/virtual interface 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, 33but if it is a virtual 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. 40These objects 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> xyz.openbmc_project.Network.IP.Create IP ssys "xyz.openbmc_project.Network.IP.Protocol.IPv4" "<ip>" <subnetmask> "<networkgateway>" 61 62curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d '{"data":["xyz.openbmc_project.Network.IP.Protocol.IPv4","<ip>",<subnetmask>,"<networkGateway>"] 63}' https://<hostname/ip>/xyz/openbmc_project/network/eth0/action/IP 64 65## Configure Default Gateway 66 67### Get 68 69busctl get-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration DefaultGateway 70 71curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://<hostname/ip>/xyz/openbmc_project/network/config/attr/DefaultGateway 72 73### Set 74 75busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration DefaultGateway s "<DefaultGateway>" 76 77curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "x.x.x.x"}' https://<hostname/ip>/xyz/openbmc_project/network/config/attr/DefaultGateway 78 79NOTE: Since the system does not allow unpingable gateway address, make sure the gateway address is pingable. 80 81## Configure HostName 82 83### Get 84 85busctl get-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration HostName 86 87curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://<hostname/ip>/xyz/openbmc_project/network/config/attr/HostName 88 89### Set 90 91busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/config xyz.openbmc_project.Network.SystemConfiguration HostName s "<HostName>" 92 93curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": "<hostname>"}' https://<hostname/ip>/xyz/openbmc_project/network/config/attr/HostName 94 95## Delete IP address 96 97busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/<interface>/ipv4/<id> xyz.openbmc_project.Object.Delete Delete 98 99NOTE: How to get the ipv4/id: After creating the IP address object enumerate the network interface object. 100 101curl -c cjar -b cjar -k -H "Content-Type: application/json" -X DELETE https://<hostname/ip>/xyz/openbmc_project/network/eth0/ipv4/fbfc29b 102 103## Configure DHCP 104 105### Get 106 107busctl get-property xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.EthernetInterface DHCPEnabled 108 109curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/DHCPEnabled 110 111### Set 112 113busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.EthernetInterface DHCPEnabled b 1 114 115curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d '{"data": 1}' https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/DHCPEnabled 116 117## Configure MACAddress 118 119### Get 120 121busctl get-property xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.MACAddress MACAddress 122 123curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/MACAddress 124 125### Set 126 127NOTE: MAC address should be LOCAL ADMIN MAC (2nd bit of first byte should be on). 128 129busctl set-property xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0 xyz.openbmc_project.Network.MACAddress MACAddress s "XX:XX:XX:XX:XX:XX" 130 131curl -c cjar -b cjar -k -H "Content-Type: application/jon" -X PUT -d '{"data": "XX:XX:XX:XX:XX:XX" }' https://<hostname/ip>/xyz/openbmc_project/network/eth0/attr/MACAddress 132 133## Network factory reset 134 135busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network xyz.openbmc_project.Common.FactoryReset Reset 136 137curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d '{"data":[] }' https://<hostname/ip>/xyz/openbmc_project/network/action/Reset 138 139## VLAN 140 141### Create 142 143curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d '{"data":["eth0",50] }' https://<hostname/ip>/xyz/openbmc_project/network/action/VLAN 144 145### Delete 146 147curl -c cjar -b cjar -k -H "Content-Type: application/json" -X DELETE https://<hostname/ip>/xyz/openbmc_project/network/eth0_50 148 149busctl call xyz.openbmc_project.Network /xyz/openbmc_project/network/eth0_50 xyz.openbmc_project.Object.Delete Delete 150 151### Enumerate 152 153curl -c cjar -b cjar -k -H "Content-Type: application/json" -X GET https://<hostname/ip>/xyz/openbmc_project/network/eth0_50/enumerate 154 155### Configure IP on VLAN Interface 156 157Please refer to the "Configure IP address" section. 158