Cli switch

Cli switch DEFAULT

A data switch serves as a controller that enables networked devices to talk to each other efficiently. After logging on a data switch, do you know how to configure the switch efficiently and manage it appropriately for information sharing and resource allocation? Command Line Interface (CLI) is one of the most prevailing configuration methods to manage network devices. It is considered as the building block of a network software system. This post contains information about the basic CLI functionality of FS data switches, and the specific procedures to get access to a data switch.

What Is the Command Line Interface of a Data Switch?

The command line interface is the main, text-based interface for configuring, managing, and monitoring network devices such as a router or a data switch. CLI allows you to type in configuration commands to get the output from the router or a switch. The network software recognizes the command when you enter enough characters of the command to uniquely identify it, which in turn helps you monitor the status of your network device. The following figure shows the command line interface of FS S3800-24T4S Gigabit Ethernet switch. On the CLI interface, you can read the basic information about this switch and input more characters to execute more commands.

CLI of Gigabit Ethernet switch

How to Access the Command Line Interface?

Before accessing a data switch, you need to prepare a configuration line with USB which is directly connected to a PC, and then install the corresponding driver for the network software system. The network software will configure some parameters and accomplish the connection between the switch and PC.

Generally, you can access the CLI through a direct connection to the console port, or remotely using Telnet or SSH command. The simplest way to enter the CLI interface is to build a direct serial connection to the switch’s console port, which is demonstrated below. In the factory default configuration, a data switch console starts with the CLI prompt. To use the menu interface with manager privileges, go to the manager level prompt and enter the menu command. Here we take FS S5850-48S6Q 10 gigabit switch as an example to show you the operation procedures to access the CLI interface of this data switch.

CLI of data switch

Step 1: Clear the configuration of the switch, input a command as below

A-5850-48S6Q# delete flash:/startup-config.conf

Are you sure to delete startup configuration file? [confirm]

Step 2: Reboot the switch and reset the configuration to Factory Defaults

A-5850-48S6Q# reboot

After finishing the above two steps, the switch console will start with the CLI prompt. But if you have saved the factory configuration, you can reset the factory configuration referring to the following steps.

Method one: save the current configuration to the factory configuration

CommandPurpose
DUT1# chc write factory-configSave the current configuration to the factory configuration
DUT1# show factory-configConfirm the factory configuration OK

Method two: use the configuration file in the flash for the factory configuration

CommandPurpose
DUT1# chc write flash:/config.conf factory-configUse the config.conf file in flash for factory configuration
DUT1# show factory-configConfirm the factory configuration OK

GUI vs. CLI in Data Switch Configuration

In data switch configuration and management, you may often hear terms like Web-based Interface or Graphical User Interface (GUI). This is because most switches are coming with a built-in web browser which is often called GUI interface. Both GUI and CLI are collocation methods to configure, manage and monitor data switches. GUI provides visual cues and uses conventions that allow you to figure out how to get the device up and running fast with some basic configuration. For GUI, you can use either the service port interface or the management interface to access the GUI. But for CLI, you can use the console port of data switches or more complicated Telnet or SSH command to access the CLI. In comparison, GUI is much easier to copy entire configurations from one device to another, thus it has become a great option for first-time deployments or applications that need very little configuration changes after they go live. Whereas, using GUI beyond initial installation is impractical because GUI is inefficient over the lifetime of a network device, and that inefficiency grows as you deploy more and more GUI-based devices. Thus for most mission critical applications, CLI is more preferable among engineers, because CLI functionality can support for high-end switches such as managed switches or PoE switches.

Conclusion

Every software operating system has a different mechanism for communicating commands. Thus the methods to get access to CLI also differ for various network devices. For most high-end data switches, CLI is supported and can be accessed via console port or Telnet/SSH command. Switches with low-level configuration can only be accessed through Web instead of CLI. All of FS data switches can support CLI functionality because they are all high-end data switches with high performance. When buying data switches, one of the most frequently asked questions from our customers is that "Is there a simple GUI to configure the switch or should it be done only through CLI”? Actually, all of our data switches can be configured through both GUI and CLI. Console cables and grounding cables used to connect the switches are also included in our product packages. For more information, please feel free to contact us via [email protected]

Sours: https://community.fs.com/blog/what-is-cli-of-a-data-switch-and-how-to-access-it.html

Objective

The Cisco Business Managed Switches can be remotely accessed and configured through the Command Line Interface (CLI). Accessing the CLI allows commands to be entered in a terminal-based window. If you prefer to configure using terminal commands on your switch through the CLI rather than the web-based utility, this would be an easier alternative. Certain tasks such as Layer 3 mode enabling can only be performed through the CLI.

In order to remotely access the CLI of your switch, you must use an SSH or Telnet client. You must also enable the Telnet and SSH service on your switch first before you can access it remotely.

Note: For instructions on how to configure the Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) settings on your switch, click here.

This article provides instructions on how to access the CLI of your switch through SSH or Telnet using the following clients:

  • PuTTY - A standard Telnet and SSH client. You can download an installer here and install in your Windows computer.
  • Terminal - An application that is pre-installed in every Mac OS X computer. It is also known as the shell or the console.

Important: Before you make an SSH or Telnet connection to the switch, you must set the IP address for the switch. For instructions, click here.

Applicable Devices | Software Version

Access the CLI of the Switch through SSH

The SSH sessions disconnect automatically after the idle time configured in the switch has passed. The default idle session timeout for SSH is 10 minutes.

To make an SSH connection to the switch, choose your platform:

Windows Computer using PuTTY

Mac Computer using Terminal

Access the CLI through SSH using PuTTY

Note: The images may vary according to the version of the Windows operating system you are using. In this example, the Windows 7 Ultimate is used and the PuTTY version is 0.63.

Step 1. Launch the PuTTY client on your computer.

Step 2. Enter the hostname or IP address of the switch that you want to remotely access in the Host Name (or IP address) field.

Note: In this example, 192.168.100.105 IP address is used.

Step 3. Enter 22 as the port number to be used for the SSH session in the Port field.

Step 4. In the Connection type area, click the SSH radio button to choose SSH as your method of connection with the switch.

Step 5. (Optional) To save the session, enter the session name in the Saved Sessions field.

Note: In this example, SSH Sessions is used.

Step 6. (Optional) Click Save to save the session.

Step 7. (Optional) In the Close window on exit area, click the radio button to choose the behavior of the SSH window upon exit.

Note: In this example, Only on clean exit is chosen.

Step 8. Click Open to start the session.

Step 9. If this is your first time using SSH to connect to the switch, you may receive a Security Breach Warning. This warning lets you know that it is possible that you are connecting to another computer pretending to be the switch. Once you have ensured you entered the correct IP address in the Host Name field in Step 4, click Yes to update the Rivest Shamir Adleman 2 (RSA2) key to include the new switch.

Step 10. Enter the username and password of the switch in the login as, User Name and Password fields accordingly.

You should now have successfully remotely accessed the CLI of your switch through SSH using PuTTY.

Access the CLI through SSH using Terminal

Note: The images may vary according to the version of the operating system of the Mac computer that you are using. In this example, the macOS Sierra is used and the Terminal version is 2.7.1.

Step 1. Go to Applications > Utilities then launch the Terminal.app application.

Step 2. Enter the ssh command and then the IP address to access the CLI of the switch.

Note: In this example, 192.168.100.105.

Step 3. Once prompted by the message asking if you want to continue connecting, enter Yes.

Step 4. Enter the username and password of the switch in the User Name and Password fields accordingly.

You should now have successfully remotely accessed the CLI of your switch through SSH using the Terminal.

Access the CLI of the Switch through Telnet

The Telnet sessions disconnect automatically after the idle time configured in the switch has passed. The default idle session timeout for Telnet is 10 minutes.

To make a Telnet connection to the switch, choose your platform:

Windows Computer using PuTTY

Mac Computer using Terminal

Access the CLI through Telnet using PuTTY

Note: The images may vary according to the version of the Windows operating system you are using. In this example, the Windows 7 Ultimate is used and the PuTTY version is 0.63.

Step 1. Launch the PuTTY client on your computer.

Step 2. Enter the hostname or IP address of the switch that you want to remotely access in the Host Name (or IP address) field.

Note: In this example, 192.168.100.105 is used.

Step 3. Enter 23 as the port number to be used for the Telnet session in the Port field.

Step 4. In the Connection type area, click the Telnet radio button to choose Telnet as your method of connection with the switch.

Step 5. (Optional) To save the session, enter the session name in the Saved Sessions field.

Note: In this example, Telnet Sessions is used.

Step 6. (Optional) Click Save to save the session.

Step 7. Optional) In the Close window on exit area, click the radio button to choose the behavior of the SSH window upon exit.

Note: In this example, Never is chosen.

Step 8. Click Open to start the session.

Step 9. Enter the username and password of the switch in the login as, User Name and Password fields accordingly.

You should now have successfully remotely accessed the CLI of your switch through Telnet using PuTTY.

Access the CLI through Telnet using Terminal

Note: The images may vary according to the version of the operating system of the Mac computer that you are using. In this example, the macOS Sierra is used and the Terminal version is 2.7.1.

Step 1. Go to Applications > Utilities then launch the Terminal.app application.

Step 2. Enter the telnet command and then the IP address to access the CLI of the switch.

Note: In this example, 192.168.100.105.

Step 3. Enter the username and password of the switch in the User Name and Password fields accordingly.

You should now have successfully remotely accessed the CLI of your switch through Telnet using the Terminal.

Sours: https://www.cisco.com/c/en/us/support/docs/smb/switches/Cisco-Business-Switching/kmgmt-2243-access-an-smb-switch-cli-using-ssh-or-telnet.html
  1. Hamburger helper orange chicken
  2. Outlaw tattoo prices
  3. Kegerator hose kit
  4. Fastest minecraft speedrun
  5. Goodman dehumidification mode

Using the Command-Line Interface

The Cisco IOS user interface is divided into many different modes. The commands available to you depend on which mode you are currently in. Enter a question mark (?) at the system prompt to obtain a list of commands available for each command mode.

You can start a CLI session through a console connection, through Telnet, a SSH, or by using the browser.

When you start a session, you begin in user mode, often called user EXEC mode. Only a limited subset of the commands are available in user EXEC mode. For example, most of the user EXEC commands are one-time commands, such as show commands, which show the current configuration status, and clear commands, which clear counters or interfaces. The user EXEC commands are not saved when the switch reboots.

To have access to all commands, you must enter privileged EXEC mode. Normally, you must enter a password to enter privileged EXEC mode. From this mode, you can enter any privileged EXEC command or enter global configuration mode.

Using the configuration modes (global, interface, and line), you can make changes to the running configuration. If you save the configuration, these commands are stored and used when the switch reboots. To access the various configuration modes, you must start at global configuration mode. From global configuration mode, you can enter interface configuration mode and line configuration mode.

This table describes the main command modes, how to access each one, the prompt you see in that mode, and how to exit the mode.

Mode

Access Method

Prompt

Exit Method

About This Mode

User EXEC

Begin a session using Telnet, SSH, or console.

Switch>

Enter logout or quit.

Use this mode to

  • Change terminal settings.
  • Perform basic tests.
  • Display system information.

Privileged EXEC

While in user EXEC mode, enter the enable command.

Switch#

Enter disable to exit.

Use this mode to verify commands that you have entered. Use a password to protect access to this mode.

Global configuration

While in privileged EXEC mode, enter the configure command.

Switch(config)#

To exit to privileged EXEC mode, enter exit or end, or press Ctrl-Z.

Use this mode to configure parameters that apply to the entire switch.

VLAN configuration

While in global configuration mode, enter the vlanvlan-id command.

Switch(config-vlan)#

To exit to global configuration mode, enter the exit command.

To return to privileged EXEC mode, press Ctrl-Z or enter end.

Use this mode to configure VLAN parameters. When VTP mode is transparent, you can create extended-range VLANs (VLAN IDs greater than 1005) and save configurations in the switch startup configuration file.

Interface configuration

While in global configuration mode, enter the interface command (with a specific interface).

Switch(config-if)#

To exit to global configuration mode, enter exit.

To return to privileged EXEC mode, press Ctrl-Z or enter end.

Use this mode to configure parameters for the Ethernet ports.

Line configuration

While in global configuration mode, specify a line with the line vty or line console command.

Switch(config-line)#

To exit to global configuration mode, enter exit.

To return to privileged EXEC mode, press Ctrl-Z or enter end.

Use this mode to configure parameters for the terminal line.

Sours: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3850/software/release/3se/consolidated_guide/b_consolidated_3850_3se_cg_chapter_01.html
Cisco CLI for Beginners - Network Fundamentals Part 10

Most Cisco devices (including routers and switches) use a CLI (Command Line Interface) to configure the network device. The CLI is an interface, based on text. You type in configuration commands and use show commands to get the output from the router or switch. There are also GUIs (Graphical User Interface) for the routers, switches and firewalls but the majority of the work is done on the CLI.

This might sound dated but with so many commands that are available to use, the CLI is much easier to work with than any of the graphical interfaces. It’s also much easier to copy entire configurations from one device to another.

In this lesson, I’ll explain how to access the CLI and the basics of how Cisco IOS works.

Access to Cisco IOS CLI

Before we can enter any commands, we need access to the CLI. There are three options:

The console is a physical port on the switch that allows access to the CLI. We typically use this the first time we configure the switch. Telnet and SSH are both options for remote access.

Console Cabling

On the switch, you will find one or two physical connectors for the console. Take a look at the picture below:

Cisco 2960 Catalyst Switch

On the left side of this 2960 Catalyst switch, you see the light blue RJ45 port and a micro-USB port on the left of it. Older switches only have the RJ45 port, newer switches (and other devices) often have both options.

Even though it’s an RJ45 port, it’s not an Ethernet port. We use this connection to connect the switch to a serial port on your computer with the following cable:

Cisco Rollover Cable

This cable is called a Cisco console cable and you will need a serial port on your computer. Modern computers or laptops don’t have these serial ports anymore so you might have to use a serial-to-USB cable like this one:

USB to serial cable

This cable emulates a serial port and has a USB connection. Once you have connected your computer to the switch, we can start a terminal application to access the CLI.

Terminal Emulator

There are many terminal emulator applications. If you are new to this, the best one to start with is Putty. It’s free and allows you to connect using a serial connection, telnet and SSH. Once you have downloaded it, you will see the main screen:

putty serial console options

Make sure you select the “Serial” option. The default speed is 9600 (baud rate). The COM port will depend on your computer, it might be COM1 but if you are unsure, check the device manager in Windows. Click on Start > Run and enter “devmgmt.msc”:

windows start run devmgmt

Here is the device manager:

windows device manager com port number

Above you can see that on my computer, I have to use COM4. Change the COM port and click on Open to start the console:

putty com4

Now is a good time to power on your switch or in case it is already powered on, pull the plug so it can reload.

First Boot

When the switch boots, you will see a lot of stuff on the console. First, it will initialize the flash memory:

Initializing the flash memory is required since it contains the IOS image (Operating System) of the switch. Its next step is to load the IOS image from the flash memory:

The IOS image is compressed so the switch uncompresses the image and loads it in RAM. You are then presented with some legal information and information about the switch:

This tells us the version of the IOS image. IOS is now up and running, it also initializes the flash memory:

IOS starts with a POST (Power on Self Test) for some of the switch components:

It then warns us about the cryptographic features:

You might be wondering what a switch has to do with cryptography. Depending on your IOS image, your switch is able to run SSH server. This allows encrypted remote access. Another feature that uses cryptography is SNMP version 3, this is used by network management software to read statistics from the switch. In certain countries, cryptography is forbidden or limited.

The final part of the boot process gives us some general information about the switch:

Above we can see the switch model, the interfaces it has, some serial numbers, etc. It ends with the following message:

Now it’s up to us to configure the switch.

Depending if your switch already has a configuration or not, you might see the following message:

If there is no configuration, the switch will ask you if you would like to follow a wizard called the initial configuration dialog. If you see this, type “no” to continue so that we can start with a blank configuration. We will configure the device ourselves.

User and Enable mode (Privileged Exec Mode)

Once the switch has booted and we have pressed the enter key, we end up in what we call the user mode or user EXEC mode. In this mode, we have permission to use some simple commands but we are restricted to configure anything or use some more advanced commands.

Right now, the command line will show you this:

The > symbol tells us that we are currently in user mode. To get full access to the switch, we have to enter privileged mode, also called enabled mode. Here is how to do this:

Above you can see that the > symbol changed to #. This tells us we are now in enabled mode, granting us full access to the switch. bliep…

The disable command lets you jump back to user mode.

Erasing the Switch Configuration

If you are using used hardware, it’s possible that the previous owner did not erase the configuration of the switch. To start with a clean slate, we’ll wipe the configuration of the switch before we continue. Here’s how to do this:

Type erase startup-config and the switch will ask you to remove all configuration files. Between the brackets, you see confirm. If you see anything between [] you only have to press enter. You don’t have to type “confirm”.

Switches also store VLAN (Virtual LAN) information in another file. What a VLAN is and what it does is something that we will cover in another lesson, for now, let’s just make sure it is deleted. Here’s how to do it:

Type delete flash:vlan.dat to delete the file. You only have to press enter to confirm what Cisco IOS tells us between the brackets. If you get an error that there is no such file, do not worry. It means someone else already deleted the VLAN information and you can continue.

Type reload and the switch will reboot:

Once the switch has reloaded, we can try something else…

Show commands

The show command is probably the most used command for Cisco IOS. We can use it to fetch any information from the switch. Let’s start with a simple example, let’s say we want to see some general information about the switch:

The show version command gives us a lot of information about the switch, including the model, IOS image, and more. What if we want to see what MAC addresses the switch has learned? There is another command for that:

The show mac address-table dynamic command tells us all MAC addresses that the switch has learned. In this example, it only learned one MAC address on interface Fa0/12 (FastEthernet port 12).

What if we want to see the entire configuration of the switch? There’s a show command for that:

The show running-config command gives us the entire active configuration of the switch. Even though we haven’t configured anything yet, there is a basic configuration.

In all these Cisco lessons, you will see a LOT of show commands that I use to explain things. There are also debug commands. These show commands only produce “static” information. If you want to see changes, you have to use the same show command a couple of times. Debug commands allow us to see things in real-time. You will see some examples of debug commands in other lessons.

Configuration

When you take a new switch out of the box, it will work right away with its default (empty) configuration. It will behave just like any other unmanaged switch, it will start learning MAC addresses and forwards Ethernet frames.

However, you probably want to make some changes to the configuration of your switch. Change its default hostname, perhaps add an IP address so you can manage it remotely, etc.

To do this, we have to use configuration mode. In this mode, we can make changes to the configuration of the switch. Here’s how you enter configuration mode:

First, you need to make sure you are in enable mode. Now you can use the following command:

With the configure terminal command, we enter configuration mode. Now we can make changes to the switch.

Let’s start with something simple, let’s change the name of our switch with the hostname command:

You can see this is applied immediately. Our switch is now called SW1.

The command above was executed in “global” configuration mode. When we want to make changes to interfaces or console settings, we have to dive into one of the configuration sub modes. Let me give you an example, let’s say we want to add a password to the console:

First, we use the line console 0 command to dive into the line configuration. You can recognize this because it shows (config-line). I used the password command to specify a password (cisco) and the login command to tell the switch to ask for this password. Next time you access the console, it will ask for this password.

If I want to get back to global configuration, I have to type exit or press CTRL+Z:

I’m now back in the global configuration mode.

Let me give you one more example, let’s say we want to make changes to one of our interfaces:

First, I use the interface command and specify the interface that I want to make changes to. You can see we are now in the interface sub-mode as it shows (config-if) to us.

Once you enter the interface configuration, the switch does not show you which interface you selected. Only that you are in the sub-mode configuration.

I can now make some changes to this interface, let’s try a few commands:

Above you can see I added a description and changed the duplex/speed settings of this interface. If I want to get back, I can use the exit command or CTRL-Z:

The first time, it jumps back to global configuration mode. The second time I do it, we jump back to enable mode and exit the configuration mode:

Here is a picture to help you visualize the different modes and how to move from one to another:

user enable configuration mode

 

Saving the configuration

We entered a couple of commands but once we pull the power plug, everything is gone…

Why? Everything we configure on our switch is applied to the running configuration. This configuration is only active in RAM, pull the plug and it’s gone.

If we want to save our configuration, we have to save it as the startup configuration which is saved in NVRAM. Next time we boot our switch, it will look for the startup configuration and use that.

Here’s how to copy our running configuration to the startup configuration:

Use the copy command to copy the running configuration to the startup configuration.

Here’s a simple illustration to help you visualize the two configuration files:

copy running config startup config

Another popular command to save your configuration is “wr”. This is short for write and the old command to save your configuration. It does the exact same thing as copy running-config startup-config which is why it’s still very popular.

Help Features

You have now seen the basics of Cisco IOS. We used some show commands and a few configuration commands. The CLI has some tricks up its sleeve to make your life easier. Let’s discuss these…

Question Mark

Not sure what the command was again or how to type it? The question mark is your friend. If you use it, it will tell you all possible commands:

The question mark works in user, enable and configuration mode so go ahead and try it everywhere. It also helps you finding out which commands are possible. For example:

If I type cl? then the CLI tells me there are two possible commands:

Let’s take a closer look at the clock command as it’s a great example to explain the question mark a bit more. If I want to set the time, what format should it be? It could be 18:00, 6PM, 6:00PM or anything else. the question mark will help us figure out what the command requires:

First, it tells us that we need to use clock set. Let’s try that:

Clock set tells us that time should be in hh:mm:ss format so let’s enter that:

Now it tell us that it needs a day and month. Let’s try the month first:

We still have to enter the day, let’s do that:

Finally, we have to enter the year. Let’s do this:

Now we only see <cr> which means that the clock command has everything it needs. Remove the question mark and hit enter:

The clock is now configured.

Abbreviation

There is no need to type the exact command for CLI to accept it. You can also shorten commands. For example, I just used copy running-config startup config but I don’t have to type the entire thing. This will also work:

After the copy command, there is only one parameter that starts with “run” which is running-config. The only parameter that starts with “st” is startup-config. Once you get more experience with the CLI and become familiar with the different commands, you will automatically use this more often.

Errors and incomplete commands

In a perfect world, we would remember everything and make no spelling errors. In real life, this happens all the time. Luckily for us, the CLI has something to help. Let’s try the clock command again:

The switch tells us that the command is incomplete. This is because I didn’t add a month or year, when this happens…use the question mark to figure out what the command requires.

What if I make a typing error?

The CLI complains but does show the ^ symbol to tell me where I made an error. When this happens, remove whatever you typed in above the ^ symbol and use the question mark:

This tells me that I should have typed November, not 11.

Keyboard Shortcuts

There are a couple of useful keyboard shortcuts that you can use for the CLI.

Cisco IOS keeps a history of previously entered commands. All you need to do is press the up and down arrow keys to browse through your previous commands.

With the left and right arrow keys, you can move the cursor one character in either direction. If you want to make some changes to a very long command that you are trying to enter, it might be a bit annoying to keep one of the arrow keys pressed. Instead, try the CTRL+A or CTRL+E combinations. This will make the cursor jump to the start or end of the line.

No idea how to spell a certain command? The TAB button will auto-complete commands for you. For example, try typing this:

And then hit the TAB button. The CLI will auto-complete it to:

This saves some typing and you don’t have to think about silly things like remembering if the command has a space or dash in between.

If you hit the TAB button a couple of times and nothing happens, try the question mark. There will be more than one command that starts with the same letters.

Do command

If you are in the configuration mode, you will face the following issue if you try a show command:

Why? The command is typed correctly but the problem here is that this is a command for the enable mode, not the configuration mode.

You could exit the configuration mode but instead, you can add do in front of the show command:

Problem solved!

Output Modifiers

What if you want to get the output of a show command but you don’t have to see everything? For example, look at the following show command:

This produces quite some output. What if I only want to see the IOS version that this switch has? We can use some output modifiers:

At the end of your show command, add the | symbol. Let’s look at our options:

The two I personally use most often are begin and include. Let’s try both:

Include will only show me the line that have “IOS” in them.

Begin will start the output with the word you are looking for. For example, let’s say I am only interested in the interface configuration from the running configuration. Here’s how to do this:

Instead of seeing the entire running configuration, it will skip the first part of the output and starts with the interfaces instead.

Conclusion

You have now learned the basics of Cisco IOS and how to connect to the CLI. Here are some of the things we discussed:

  • How to connect to a Cisco Catalyst switch with a console cable.
  • How to use the terminal emulator (Putty) to connect to your switch.
  • The bootup sequence.
  • The difference between user mode, enable mode (privileged mode) and the configuration mode.
  • What show commands are.
  • Some examples of configuration commands.
  • How to delete the startup configuration.
  • How to use CLI features like auto complete, the question mark and output modifiers.

I hope this lesson has been useful, the best thing to do now is to boot up a switch and try all of this by yourself.

Sours: https://networklessons.com/cisco/ccna-routing-switching-icnd1-100-105/introduction-cisco-ios-cli-command-line-interface

Switch cli

Switch Command-Line Interface

You configure and maintain the Catalyst 5000 series Ethernet, Fast Ethernet, Copper Distributed Data Interface (CDDI), and Fiber Distributed Data Interface (FDDI) modules by entering commands from the switch command-line interface (CLI). In addition, through the CLI session command, you can access the router configuration software. The CLI is a basic command-line interpreter similar to the UNIX C shell. Command-line editing is provided, including history substitution and the creation of aliases.

This chapter contains the following sections:

In order to configure the Asynchronous Transfer Mode (ATM) module, you must use the ATM module CLI. For more information about the ATM module CLI, refer to the "ATM Command-Line Interface" chapter.

Accessing the Switch CLI

You access the switch CLI from a console terminal connected to an EIA/TIA-232 port or through a Telnet session. The CLI allows fixed baud rates. Telnet sessions are automatically disconnected after remaining idle for a configurable time period.


Note EIA/TIA-232 was known as RS-232 before its acceptance as a standard by the Electronic Industries Association (EIA) and Telecommunications Industry Association (TIA).

Accessing the Switch CLI via the Console Port (EIA/TIA-232)

To access the switch through the console (EIA/TIA-232) port, perform the steps in Table 2-1.

After connecting through the console port, you see the following display:

Cisco Systems Console Enter password: Console> Console>

Accessing the Switch CLI via Telnet

To access the switch through a Telnet session, you must first set the IP address for the switch. You can open multiple sessions to the switch via Telnet.

To access the switch from a remote host with Telnet, perform the steps in Table 2-2.


Table  2-2: Accessing the Switch CLI via Telnet
TaskCommand
Step 1 From the remote host, enter the telnet command and the name or IP address of the switch you want to access. telnet hostname | ip address
Step 2 At the prompt, enter the password for the CLI. If no password has been configured, press Return.
Step 3 Enter the necessary commands to complete your desired tasks. Appropriate commands
Step 4 When finished, exit the Telnet session. quit

After connecting through a Telnet session, you see the following display:

172.16

Operating the Switch CLI

This section describes the functions that allow you to access the command modes and operate the switch CLI.

Accessing the Command Modes

There are two modes of operation in the CLI: normal and privileged. Both are password protected. Use normal-mode commands for everyday system monitoring. Use privileged commands for system configuration and basic troubleshooting.

After you log in, the system enters normal mode, which gives you access to normal-mode commands only. You can enter privileged mode by issuing the enable command followed by the enable password. Privileged mode is indicated by the appearance of the word "enable" in the system prompt. To return to normal mode, enter the disable command at the prompt.

The following example shows how to enter privileged mode:

Console> Enter password: Console> (enable)

Command-Line Processing

Switch commands are not case sensitive. Commands and parameters can be abbreviated as long as they contain enough letters to be unique relative to any other currently available commands or parameters.

Table 2-3 shows special commands used for command-line processing:


Table  2-3: Command-Line Processing Commands
CommandFunction
Ctrl-W Deletes last word typed.
Ctrl-U Deletes entire line.
Ctrl-C Escapes and terminates prompts and lengthy tasks.
Delete key or backspace key Erases mistake when entering a command; reenter command after using this key.

Command Aliases

Table 2-4 lists command aliases that have been defined for ease of use. Like regular commands, aliases are not case sensitive. However, unlike regular commands, some aliases cannot be abbreviated.


Table  2-4: Switch CLI Command Aliases
AliasCommand
?help
batchconfigure
dishow
earlcam
exitquit
logoutquit

History Substitution

Commands that you enter during each terminal session are stored in a history buffer. The history buffer stores the last 20 commands entered during a terminal session.


Table  2-5: History Substitution Commands
CommandFunction
Repeating recent commands:
!! Repeat the most recent command
!-nn Repeat the nnth most recent command
!nn Repeat command nn
!aaa Repeat the command beginning with string aaa
!?aaa Repeat the command containing the string aaa
To modify and repeat the most recent command:
^aaa^bbb Replace the string aaa with the string bbb in the most recent command
To add a string to the end of a previous command and repeat it:
!!aaa Add string aaa to the end of the most recent command
!nn aaa Add string aaa to the end of command nn
!aaa bbb Add string bbb to the end of the command beginning with string aaa
!?aaa bbb Add string bbb to the end of the command containing the string aaa

Accessing Command Help

Context-sensitive help for commands is provided. Type help or ? in normal or privileged mode to see a listing of the commands available in those modes. On selected commands, typing help or ? after a command will provide additional information. In general, command usage, the help menu, and, when appropriate, parameter ranges are provided if you enter a command using the wrong number of arguments or inappropriate arguments.

The ? command allows you to display usage and syntax information about a specific command or to list groups of commands. In normal mode, use the ? command to display a list of top-level commands, as follows:

Console> Commands: ---------------------------------------------------------------------- enable Enable privileged mode help Show this message history Show contents of history substitution buffer ping Send echo packets to hosts quit Exit from the Admin session session Tunnel to ATM or Router module set Set, use 'set help' for more info show Show, use 'show help' for more info wait Wait for x seconds Console>
Note The overall function of the ?command is the same as the helpcommand.

In privileged mode, enter the ? command to display a list of commands, as follows:

Console> (enable)
Note You can enter the ?command appended to any command associated with a group of commands, for example, clear, set, and show. Or you can append ?to any specific command for a list of usage and syntax information.

The Catalyst 5000 series switch is a multimodule system. Commands you enter from the CLI can apply to the entire system or to a specific module, port, or virtual LAN (VLAN).

The Catalyst 5000 modules (module slots), ports, and VLANs are numbered starting with 1. The supervisor module is module 1, residing in the top slot. If you are using a Catalyst 5500 with a redundant supervisor engine, the supervisor modules reside in slots 1 and 2. On each module, port 1 is the left-most port. To reference a specific port on a specific module, the command syntax is mod_num/port_num. For example, 3/1 denotes module 3, port 1. In some commands, such as set trunk, set cam, and set vlan, you can enter lists of ports and VLANs.

You designate ports by entering the module and port number pairs, separated by commas. To specify a range of ports, use a dash (-) between the module number and port number pairs. Dashes take precedence over commas. The following examples show several ways of designating ports:

Example 1: 2/1,2/3 denotes module 2, port 1 and module 2, port 3

Example 2: 2/1-12 denotes module 2, ports 1 through 12

Example 3: 2/1-2/12 also denotes module 2, ports 1 through 12

Each VLAN is designated by a single number. You specify lists of VLANs the same way you do for ports. Individual VLANs are separated by commas (,); ranges are separated by dashes (-). In the following example, VLAN numbers 1 through 10 and VLAN 1000 are specified:

1-10,1000

Designating MAC Addresses, IP Addresses, and IP Aliases

Some commands require a Media Access Control (MAC) address, IP address, or IP alias, which must be designated in a standard format. The MAC address format must be six hexadecimal numbers separated by hyphens, as shown in the following example:

00-00-0c-24-d2-fe

The IP address format is 32 bits, written as four octets separated by periods (dotted decimal format). IP addresses are made up of a network section, an optional subnet section, and a host section, as shown in the following example:

126.2.54.1

If the IP alias table is configured, you can use IP aliases in place of the dotted decimal IP address. This is true for most commands that use an IP address, except commands that define the IP address or IP alias. For more information about the set interface and set ip alias commands, refer to the "Switch set Commands" chapter.

Copyright 1989-1997 © Cisco Systems Inc.Sours: http://www.ftj.agh.edu.pl/wfitj/complab/doc/catalyst/cmdref23/sw_cli.htm
Cisco Tech Talk: Overview of Common CLI Commands on Cisco Business Switches

TechLibrary

You can use two interfaces to monitor, configure, troubleshoot, and manage a Juniper Networks EX Series Ethernet Switch: the J-Web graphical user interface and the Junos operating system (Junos OS) command-line interface (CLI). Both of these user interfaces are shipped with the switch. This topic describes the CLI. For information about the J-Web user interface, see J-Web User Interface for EX Series Switches Overview.

CLI Overview

Junos operating system (Junos OS) CLI is a Juniper Networks specific command shell that runs on top of a UNIX-based operating system kernel. The CLI provides command help and command completion.

The CLI also provides a variety of UNIX utilities, such as Emacs-style keyboard sequences that allow you to move around on a command line and scroll through recently executed commands, regular expression matching to locate and replace values and identifiers in a configuration, filter command output, or log file entries, store and archive router files on a UNIX-based file system, and exit from the CLI environment and create a UNIX C shell or Bourne shell to navigate the file system, manage switch processes, and so on.

CLI Help and Command Completion

To access CLI Help, type a question mark (?) at any level of the hierarchy. The system displays a list of the available commands or statements and a short description of each.

To complete a command, statement, or option that you have partially typed, press the Tab key or the Spacebar. If the partially typed letters uniquely identify a command, the complete command name appears. Otherwise, a beep indicates that you have entered an ambiguous command and the possible completions are displayed. This completion feature also applies to other strings, such as filenames, interface names, usernames, and configuration statements.

CLI Command Modes

The CLI has two modes, operational mode and configuration mode.

In operational mode, you enter commands to monitor and troubleshoot switch hardware and software and network connectivity. Operational mode is indicated by the > prompt—for example, [email protected]>.

In configuration mode, you can define all properties of the Juniper Networks Junos operating system (Junos OS), including interfaces, VLANs, Virtual Chassis information, routing protocols, user access, and several system hardware properties.

To enter configuration mode, enter the configure command: .

Configuration mode is indicated by the # prompt, and includes the current location in the configuration hierarchy—for example:

[edit interfaces ge-0/0/12][email protected]#

In configuration mode, you are actually viewing and changing the candidate configuration file. The candidate configuration allows you to make configuration changes without causing operational changes to the current operating configuration, called the active configuration. When you commit the changes you added to the candidate configuration, the system updates the active configuration. Candidate configurations enable you to alter your configuration without causing potential damage to your current network operations.

To activate your configuration changes, enter the commit command.

To return to operational mode, go to the top of the configuration hierarchy and then quit—for example:

[edit interfaces ge-0/0/12][email protected]# top[edit][email protected]# exit

You can also activate your configuration changes and exit configuration mode with a single command, commit and-quit. This command succeeds only if there are no mistakes or syntax errors in the configuration.

Tip: When you commit the candidate configuration, you can require an explicit confirmation for the commit to become permanent by using the commit confirmed command. This is useful for verifying that a configuration change works correctly and does not prevent management access to the switch. After you issue the commit confirmed command, you must issue another commit command within the defined period of time (10 minutes by default) or the system reverts to the previous configuration.

Modified: 2013-08-16

Sours: https://www.juniper.net/documentation/en_US/release-independent/junos/topics/concept/ex-series-cli-interface-overview.html

Similar news:

Share

Network switch is the major building block of many business networks, as they connect multiple PCs, printers, access points, servers, and other hardware to make your business up and running. Switches enables you to send and receive information and access shared resources in a smooth, efficient and highly secure way. It happens at some points we need to make settings or adjustments on switches to perform certain function, like configuring VLAN or check status of switch ports. So how to get the configuration access to a network switch? Does GUI or CLI work better for you? What’s the difference between GUI vs CLI? We’ll address these issues and guide you to manage switch via GUI and CLI.

gui vs cli for configuring network switch

What Is GUI (Graphical User Interface)?

GUI is short for Graphical User Interface – it uses graphics like windows, scrollbars, buttons, etc. to allow users to communicate with the data switch or GUI operating system. It facilitate users, especially novice users in an intuitive and easy-to-learn way. GUI access need recognition and good exploratory analysis and graphics, which is more suitable for users who requires no access to advanced tasks.

what is command line cli

What Is CLI (Command Line Interface)?

CLI stands for Command Line Interface, which allows users to write commands in a terminal or console window to communicate with an operating system. CLI acts as the medium between operators and the network switch: Users have to type command to perform a task. CLI is more accurate than GUI, but it has a very steep learning curve. CLI is appropriate for users who uses it in a regular basis, or for the costly computing where input precision is the priority.

what is gui graphical user interface

GUI vs CLI: What Is the Difference?

GUI vs CLI, both as the mainstream interface for accessing network switch, differs in the following aspects:

Ease of Use: CLI enable users to type manual command in order to perform the desired task whereas in GUI users provided visuals to communicate with the data switch. So the beginners will pick up a GUI much faster than a CLI.

Control: With a GUI, there’s control over files and the operating system – but advanced tasks may still need CLI. While CLI enables all the control over file system and operating system, making tasks simple.

Speed: In GUI, using the mouse and the keyboard to control is slower than using the command line. With CLI, the operator simply use the keyboard and may need to execute only few commands to complete the task.

Hacking: In terms of hacking, all the vulnerability exploits are done from command line. All the remote access and file manipulation are done from the command line.

Scripting: CLI excels in this field since it allows you to create a script that contains few lines of command and it will do the work for you.

Here we use the chart to summarize GUI vs CLI differences.

BASIS FOR COMPARISON

CLI

GUI

Basic

Command line interface enables a user to communicate with the system through commands.

Graphical User interface permits a user to interact with the system by using graphics which includes images, icons, etc.

Device used

Keyboard

Mouse and keyboard

Ease of performing tasks

Hard to perform an operation and require expertise.

Easy to perform tasks and does not require expertise.

Precision

High

Low

Flexibility

Intransigent

More flexible

Memory consumption

Low

High

Appearance

Can’t be changed

Custom changes can be employed

Speed

Fast

Slow

Integration and extensibility

Scope of potential improvements

Bounded

GUI vs CLI: How to Use Them to Manage Network Switch?

CLI and GUI are different kinds of user interfaces with their own merits and drawbacks. It is important to understand where each one excels so you can pick the right tool. Using the defining features of two different tools provides the best of both worlds. The following video, using FS S5850-32S2Q 10GbE switch as an example, offers a complete guide on how to use command line and GUI to access a network switch, through which you may figure out which one fits better for you.

Conclusion

In all, the GUI provides a higher degree of multitasking and more efficiency, whereas CLI offers more control, precision and repeatability. The decision on choosing GUI vs CLI to configure the network switch should better based on user requirements. FS.COM offers a comprehensive product line of network switches, including Gigabit Ethernet switch, Gigabit PoE switch, etc. If you are seeking network switch configuration or management solutions, feel free to contact us at [email protected]

This entry was posted in Network Switches and tagged command line interface, data switch, graphical user interface, gui vs cli, network switch on by Aria Zhu. Sours: https://www.cables-solutions.com/gui-vs-cli-manage-network-switch.html


1347 1348 1349 1350 1351