---
title: Management Port
slug: aidc/management-port
createdAt: 2025-12-01T11:05:36.000Z
---

By default, the management port (mgmt 0) of the switch does not have an IP address when shipped from factory. It can automatically obtain IP address through DHCP by connecting the management port to DHCP Server on the same network segment.
At the same time, AsterNOS supports users to manually configure the management port IP, which can only have one IPv4 address and one IPv6 address. Multiple configurations will be overwritten.

## <font color="#1d50a2">Management Port View</font>

<font color="#1d05a2">Table 1 Management Port View</font>

| **Command**             | **Purpose**                            |
| ----------------------- | -------------------------------------- |
| **show interface mgmt** | Display management port configuration. |

### <font color="#1d50a2">show interface mgmt</font>

**\[Command]**
**show interface mgmt**

**\[Purpose]**
Display management port configuration.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show interface mgmt
Management IP address = 10.250.0.138/24
Management Network Default Gateway = 10.250.0.254
```

## <font color="#1d50a2">Management Port Config</font>

<font color="#1d05a2">Table 2 Management Port Config</font>

| **Command**                                    | **Purpose**                                                              |
| ---------------------------------------------- | ------------------------------------------------------------------------ |
| **interface mgmt 0**                           | Enter Management Port Configuration View.                                |
| **ip address** *A.B.C.D/M* \[**gw** *A.B.C.D*] | Configure or modify the IPv4 address and gateway of the management port. |
| **ipv6 address** \[*A\::B/M* **gw** *A\::B*]   | Configure or modify the IPv6 address and gateway of the management port. |

### <font color="#1d50a2">interface mgmt 0</font>

**\[Command]**
**interface mgmt 0**

**\[Purpose]**
Enter Management Port Configuration View

**\[View]**
Global Configuration View

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface mgmt 0
```

### <font color="#1d50a2">ip address *A.B.C.D/M* \[gw *A.B.C.D*\]</font>

**\[Command]**
**ip address** *A.B.C.D/M* \[**gw** *A.B.C.D*]

**\[Purpose]**
Configure or modify the IPv4 address and gateway of mgmt.

**\[Parameters]**

| **Parameter** | **Description**                                        |
| ------------- | ------------------------------------------------------ |
| *A.B.C.D/M*   | IPv4 address with prefix length.                       |
| *A.B.C.D*     | (Optional) IPv4 gateway address without prefix length. |

**\[View]**
Management Port Configuration View

**\[Notes]**
IPv4 address with subnet mask /32 is not allowed to be configured. Addresses with subnet mask /31 is allowed. In other subnet masks, addresses with the host portion all-zeros or all-ones are not allowed.
Run command **no ip address** *A.B.C.D/M* \[**gw** *A.B.C.D*] to delete IPv4 address configuration of mgmt.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface mgmt 0
sonic(config-mgmt-0)# ip address 10.250.0.103/24 gw 10.250.0.254
```

### <font color="#1d50a2">ipv6 address \[*A\:\:B/M* gw *A\:\:B*\]</font>

**\[Command]**
**ipv6 address** *A\::B/M* \[**gw** *A\::B*]

**\[Purpose]**
Configure or modify the IPv6 address and gateway of mgmt.

**\[Parameters]**

| **Parameter** | **Description**                                        |
| ------------- | ------------------------------------------------------ |
| *A\::B/M*     | IPv6 address with prefix length.                       |
| *A\::B*       | (Optional) IPv6 gateway address without prefix length. |

**\[View]**
Management Port Configuration View

**\[Notes]**
IPv6 address with subnet mask /127 or /128 is not allowed to be configured. In other subnet masks, addresses with the host portion all-zeros are not allowed, but all-ones are allowed.
Run command **no ip address** *A.B.C.D/M* \[**gw** *A.B.C.D*] to delete IPv6 address configuration of mgmt.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface mgmt 0
sonic(config-mgmt-0)# ipv6 address 2013::138/64 gw 2013::1
```

