---
title: IPv4 Configuration
slug: enterprise-v6p1/ipv4-configuration
createdAt: 2025-12-04T06:44:50.878Z
---

## <font color="#1d50a2">IPv4 Configuration</font>

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

**\[Command]**
**show ip interface**

**\[Purpose]**
Display the IP address configured for the interface

**\[View]**
System view

**\[Use Cases]**

```plaintext
sonic# show ip interface
Interface  Master  IPv4 address/mask  Admin/Oper  BGP Neighbor  Neighbor IP
----------- -------- ----------------- ------------ -------------- ---------
0/49               30.11.13.10/30      up/up       N/A          N/A
0/50               30.11.13.138/30     up/up       N/A          N/A
loopback0          30.11.0.84/32       up/up       N/A          N/A
vlan400            30.11.64.1/32       up/up       N/A          N/A
vlan800            30.11.14.254/32     up/up       N/A          N/A
mgmt       mgmt    192.168.1.10/24     up/up       N/A          N/A
```

### <font color="#1d50a2">ip address</font>

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

**\[Purpose]**
Add an IP address to the interface

**\[Parameter]**

| **Parameter** | **Description**               |
| ------------- | ----------------------------- |
| *A.B.C.D/M*   | IP address with prefix length |

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 2
sonic(config-if-2)# ip address 3.3.3.6/24
sonic(config-if-2)# show this
!
interface ethernet 2
ip address 3.3.3.6/24
```

### <font color="#1d50a2">ip address dhcp-alloc</font>

**\[Command]**
**ip address dhcp-alloc**

**\[Purpose]**
Enable the device to act as a DHCP client to dynamically obtain an IP address.

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface vlan 10
sonic(config-vlanif-10)# ip address dhcp-alloc
```

### <font color="#1d50a2">mac-address</font>

**\[Command]**
**mac-address** *HH\:HH\:HH\:HH\:HH*:HH
**no mac-address**

**\[Purpose]**
Configure MAC addresses for layer 3 ports

**\[Parameter]**

| **Parameter**             | **Description** |
| ------------------------- | --------------- |
| *HH\:HH\:HH\:HH\:HH*:*HH* | MAC address     |

**\[Note]**
By default, all Layer 3 interfaces on the device have the same MAC address.
The first 32bits of user-defined Layer 3 interface MAC addresses need to be consistent.

**\[View]**
Interface view

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# interface ethernet 2
sonic(config-if-2)# mac-address 00:00:00:37:67:af
sonic(config-if-2)# show this
!
interface ethernet 2
 mac-address 00:00:00:37:67:af
```

##

