IPv4 Configuration
6 min
\<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 ] 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 ] 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 ] 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 \[n ote] 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 ] 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
