Here's how to perform basic interface configuration in SONiC 4.0. The video covers 'native' and 'standard' mode, 'int config' commands, working with ranges and 'show' commands.
Hi, welcome to Dell Networking Technologies. Today we're demonstrating SONiC switch interface configuration commands. The steps assume that your switch has been configured with factory default settings as a standalone unit. Please save the link to the knowledge base article for the written examples.
First, we'll start in SONiC CLI. The native format SONiC front panel interfaces are simply named ‘Ethernet0’ to ‘EthernetX’ with ‘X’ being the last front panel port. Standard naming convention uses the X/Y/Z mode, where ‘X’ and ‘Y’ are the slot and port numbers, and ‘Z’ is used for breakout ports. As you can see the interface mode starts out as ‘native’. We're going to show the interface status and look at the naming.
You can see the interface name is ‘Ethernet0’ and increments starting at zero. Over on the right you'll see the alternate name, starting at one, with the slash. We'll go into the config terminal and we will change the interface naming to ‘standard’. We must exit SONiC CLI in order for the changes to take effect. Get back into SONiC CLI, now the interface naming mode has been changed to ‘standard’. We'll show the interface status, and you see on the left side the interfaces have started at one, with the 1/1 mode, and on the right the alternate name is the ‘Ethernet0’.
We are happy with our changes; we will write memory to save them. To configure an interface, we will show the interface default configuration for 1/30. As you can see there's no configuration other than the default, and it is shut down. We will enter configuration terminal, and we'll enter the interface configuration mode for interface ‘eth 1/30’. The first thing we will do is no shut the interface, and then we'll add an IP address ’10.1.1.2/24’. Now we’ll ‘end’, and we'll show the running configuration of that interface to see our changes.
Here we can see it is ‘no shutdown’ and we have the IP address configured. If we ‘show ip interfaces’ we'll see our interface configured and now we can show the interface state with ‘show interface eth 1/30’. We'll see the ethernet is ‘up’, the line protocol is ‘up’, we have our IP address and our MAC address, and we have statistics for packet input and output. We are happy with our changes; we will ‘write memory’ to save the configuration. We have the ability to configure many interfaces at the same time if the interface configuration is the same for all of them.
To view a range of interfaces we will start with a show command. ‘show interface’ ethernet, and we will use hyphens and commas to delineate the interfaces we wish to see. Here we see we can see interface 1/1, 1/2, 1/3, and we've skipped 1/4. We’ve cleared the screen and now we're going to configure the terminal and use the ‘interface range’ command and we're going to configure 1/1 through 1/3, comma, 1/5, comma, 1/7 through 1/9.
We're going to no shut the interface, and we're going to add the port as a switchport access for VLAN 1. Now we going to ‘exit’ and ‘show interface status’. Here we can see that in some cases the interface is ‘up’ and ‘up’, in some cases the phy-link is down but the interface has been no shut, and in some cases it's admin down depending on which interfaces we configured and which interfaces we skipped in a range command. I’ll ‘show vlan 1’, you can see it is untagged and these are all the interfaces assigned - we skipped four and six as we configured. If we're happy with our changes, we will ‘write memory’.
Thank you very much for watching.