IPv4 Configuration
此内容尚不支持你的语言。
show ip interface
Section titled “show ip interface”[Command] show ip interfaces
[Purpose] Display the IP address configured for the interface
[View] System view
[Use Cases]
sonic# show ip interfacesInterface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP----------- -------- ------------------- ------------ -------------- -------------Ethernet1 192.168.2.217/24 up/up N/A N/AEthernet4 100.1.1.1/24 up/up N/A N/Aloopback0 10.1.0.1/32 up/up N/A N/Adocker0 240.127.1.1/24 up/down N/A N/Alo 127.0.0.1/16 up/up N/A N/Aip address
Section titled “ip address”[Command] ip addressA.B.C.D/M no ip addressA.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 terminalsonic(config)# interface ethernet 2sonic(config-if-2)# ip address 3.3.3.6/24sonic(config-if-2)# show this!interface ethernet 2ip address 3.3.3.6/24ip address dhcp-alloc
Section titled “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 terminalsonic(config)# interface vlan 10sonic(config-vlanif-10)# ip address dhcp-allocmac_address
Section titled “mac_address”[Command] mac_addressHH: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 terminalsonic(config)# interface ethernet 2sonic(config-if-2)# mac-address 00:00:00:37:67:afsonic(config-if-2)# show this!interface ethernet 2mac-address 00:00:00:37:67:af