Configure Management Ethernet and Loopback Interfaces
After you bootstrap SONiC via the console interface, configure an external management Ethernet interface for subsequent operation of the device. In a fixed chassis, a 10-Gigabit management port is connected to the X86 CPU on the front panel.
An Ethernet switch on RP connects to:
- Local X86 CPU
- Ethernet switch on the peer RP
Two ports on the router on each RP are connected to front panel 10-Gigabit Ethernet ports providing external connectivity. The management Ethernet interface is configured to use the DHCP client to get the IP address from the DHCP server by default. Connect the management interface to the same network in which your DHCP server is connected and get the IP address from the DHCP server.
To shut down or startup interfaces, use the following command:
configure interface [shutdown | startup] <interface-name>
Configure IP address on the management port either with DHCP (default option) or with the following CLI.
admin@sonic:~$ sudo config interface ip add <interface-name> <IP-address> <default-gateway-IP-address>
admin@sonic:~$ sudo config interface ip add eth0 1.72.33.2/16
You can establish an SSH connection to this management interface IP address from the management network.
Save the setting to
config_db.json
file.admin@sonic:~$ sudo config save -y
Configure IP address for the loopback interface.
admin@sonic:~$ sudo config interface ip add Loopback0 1.1.1.1/32
View the details about all the Layer3 IP interfaces for which IP address is assigned successfully.
cisco@sonic:~$ show ip interfaces Interface Master IPv4 address/mask Admin/Oper BGP Neighbor Neighbor IP ----------- -------- ------------------- ------------ -------------- ------------- docker0 240.127.1.1/24 up/down N/A N/A eth0 1.72.33.2/16 up/up N/A N/A lo 127.0.0.1/16 up/up N/A N/A
View the details of the interfaces such as lanes, speed, MTU, type, operational and administrative status of the interfaces.
admin@sonic:~$ show interfaces status Interface Lanes Speed MTU Alias Oper Admin Type Asym PFC ----------- ------------- -------- ----- ------------ ------- ------- ------ ---------- Ethernet0 49,50,51,52 100G 9100 hundredGigE1/1 down up N/A off Ethernet4 53,54,55,56 100G 9100 hundredGigE1/2 down up N/A off ....
View more details about the transceivers that are plugged into the Ethernet ports.
cisco@sonic:~$ show interfaces transceiver eeprom Ethernet0: SFP EEPROM detected Application Advertisement: N/A Connector: Unknown Encoding: Unknown Extended Identifier: Unknown Extended RateSelect Compliance: Unknown Identifier: QSFP-DD Double Density 8X Pluggable Transceiver Length Cable Assembly(m): 124 Nominal Bit Rate(100Mbs): 73 Specification compliance: {'Fibre Channel Speed': '200 Mbytes/Sec', '10/40G Ethernet Compliance Code': '10GBase-LRM', 'Fibre Channel link length/Transmitter Technology': 'Electrical inter-enclosure (EL)', 'Fibre Channel transmission media': 'Multi-mode 50m (M5)', 'SONET Compliance codes': 'OC 48 short reach', 'Gigabit Ethernet Compliant codes': '1000BASE-CX'} Vendor Date Code(YYYY-MM-DD Lot): 20 Vendor Name: T-DP4CNH-NCI Vendor OUI: 45-49-4e Vendor PN: L23340629 19 Vendor Rev: 08 Vendor SN: PCAAƔ0 Ethernet1: SFP EEPROM detected Application Advertisement: N/A Connector: Unknown Encoding: Unknown Extended Identifier: Unknown Extended RateSelect Compliance: Unknown Identifier: QSFP-DD Double Density 8X Pluggable Transceiver Length Cable Assembly(m): 124 Nominal Bit Rate(100Mbs): 73 Specification compliance: {'Fibre Channel Speed': '200 Mbytes/Sec', '10/40G Ethernet Compliance Code': '10GBase-LRM', 'Fibre Channel link length/Transmitter Technology': 'Electrical inter-enclosure (EL)', 'Fibre Channel transmission media': 'Multi-mode 50m (M5)', 'SONET Compliance codes': 'OC 48 short reach', 'Gigabit Ethernet Compliant codes': '1000BASE-CX'} Vendor Date Code(YYYY-MM-DD Lot): 20 Vendor Name: T-DP4CNH-NCI Vendor OUI: 45-49-4e Vendor PN: L23340629 19 Vendor Rev: 08 Vendor SN: PCAA 0 Ethernet2: SFP EEPROM detected Application Advertisement: N/A Connector: Unknown Encoding: Unknown Extended Identifier: Unknown Extended RateSelect Compliance: Unknown Identifier: QSFP-DD Double Density 8X Pluggable Transceiver Length Cable Assembly(m): 124 Nominal Bit Rate(100Mbs): 73 Specification compliance: {'Fibre Channel Speed': '200 Mbytes/Sec', '10/40G Ethernet Compliance Code': '10GBase-LRM', 'Fibre Channel link length/Transmitter Technology': 'Electrical inter-enclosure (EL)', 'Fibre Channel transmission media': 'Multi-mode 50m (M5)', 'SONET Compliance codes': 'OC 48 short reach', 'Gigabit Ethernet Compliant codes': '1000BASE-CX'} Vendor Date Code(YYYY-MM-DD Lot): 20 Vendor Name: T-DP4CNH-NCI Vendor OUI: 45-49-4e Vendor PN: L23340629 19 Vendor Rev: 08 Vendor SN: PCAA 0 ---------------------------- Truncated for brevity -------------------------------------------
Save the setting to
config_db.json
file.admin@sonic:~$ sudo config save -y
In the
config_db.json
file, the management interfaces are defined inMGMT_INTERFACE
table. The object key is composed of a management interface name and IP prefix. Attribute gwaddr specifies the gateway address of the prefix.{ "MGMT_INTERFACE": { "eth0|1.72.33.2/16": { "gwaddr": "10.11.0.1" } } }
For the changes to take effect, initiate a configuration reload to replace the configuration. The system stops relevant services, replaces the entire configuration on the router, and restarts the services for the configuration.
admin@sonic:~$ sudo config reload