Command Line Reference
IP Service
IPv4 Configuration
5 min
ipv4 configuration ipv4 configuration show ip interface show ip interface \[command] show ip interfaces \[purpose] display the ip address configured for the interface \[view] system view \[use cases] sonic# show ip interfaces interface master ipv4 address/mask admin/oper bgp neighbor neighbor ip \ ethernet1 192 168 2 217/24 up/up n/a n/a ethernet4 100 1 1 1/24 up/up n/a n/a loopback0 10 1 0 1/32 up/up n/a n/a docker0 240 127 1 1/24 up/down n/a n/a lo 127 0 0 1/16 up/up n/a n/a ip address ip address a b c d/m \[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] 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 ip address dhcp alloc ip address dhcp alloc \[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] sonic# configure terminal sonic(config)# interface vlan 10 sonic(config vlanif 10)# ip address dhcp alloc mac address mac address hh\ hh\ hh\ hh\ hh\ hh \[command] mac address hh\ hh\ hh\ hh\ hh \ hh no mac address \[purpose] configure mac addresses for layer 3 ports \[parameter] hh\ hh\ hh\ hh\ hh\ hh mac address \[view] interface view \[notes] 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 \[use cases] 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
