Getting Started with Arista Switches
Before diving into the specific commands, it’s important to understand the basics of accessing and navigating the Arista switch CLI.
Accessing the CLI
1. Console Access: Connect via a console cable to the switch's console port.
2. SSH Access: Use SSH to remotely connect to the switch. Syntax:
```
ssh user@
```
3. Web Interface: Some configurations can also be done through the web interface, but the CLI is preferred for in-depth settings.
Basic Navigation Commands
- `show version` - Displays the current software version and hardware details.
- `show running-config` - Shows the current running configuration.
- `show startup-config` - Displays the configuration that will be loaded on the next reboot.
- `show interfaces` - Lists all interfaces and their statuses.
- `exit` - Logs out of the current session or exits configuration mode.
Configuration Commands
Understanding how to configure an Arista switch is crucial for network management.
Entering Configuration Mode
To start configuring the switch, you need to enter the global configuration mode:
```
configure terminal
```
Common Configuration Tasks
1. Setting Hostname:
```
hostname
```
2. Configuring Management Interface:
```
interface Management1
ip address
no shutdown
```
3. Setting Up VLANs:
- Create a VLAN:
```
vlan
name
```
- Assign a VLAN to an interface:
```
interface Ethernet1
switchport access vlan
```
4. Configuring Interface Settings:
- Enable an interface:
```
interface Ethernet1
no shutdown
```
- Set speed and duplex:
```
interface Ethernet1
speed <100|1000|auto>
duplex
```
Monitoring Commands
Monitoring the performance and status of Arista switches is vital for maintaining a healthy network.
Interface Status Commands
- `show interfaces status` - Displays the status of all interfaces (up/down).
- `show interfaces
VLAN Monitoring Commands
- `show vlan` - Displays all VLANs configured on the switch.
- `show vlan brief` - Provides a summary of VLANs and their statuses.
Troubleshooting Commands
When things go wrong, having the right commands at your fingertips can save time and effort.
Basic Troubleshooting Commands
1. Ping Command:
```
ping
```
Used to check connectivity to a remote device.
2. Traceroute Command:
```
traceroute
```
Helps trace the path packets take to the destination.
3. Show Log Command:
```
show logging
```
Displays the system logs for troubleshooting.
4. Show IP Route:
```
show ip route
```
Displays the current routing table.
Debugging Commands
- `debug ip packet` - Displays packet processing information.
- `debug interface
Advanced Configuration Commands
For more complex network configurations, the following commands are helpful.
QoS Configuration
1. Creating a QoS Policy:
```
policy-map
class
bandwidth
```
2. Applying QoS to an Interface:
```
interface Ethernet1
service-policy input
```
Link Aggregation Configuration
1. Creating a Port-Channel:
```
interface Port-Channel1
switchport mode trunk
```
2. Adding Interfaces to the Port-Channel:
```
interface Ethernet1
channel-group 1 mode active
```
Security Commands
Security is paramount in network configurations, and Arista switches provide various commands to enhance security.
Access Control Lists (ACLs)
1. Creating an ACL:
```
ip access-list
permit
```
2. Applying ACL to an Interface:
```
interface Ethernet1
ip access-group
```
SSH and User Management
1. Creating a User:
```
username
```
2. Enabling SSH:
```
management ssh
```
Saving and Reloading Configuration
After making changes, it’s essential to save them properly.
Saving Configuration
- To save the running configuration to the startup configuration:
```
write memory
```
or
```
copy running-config startup-config
```
Rebooting the Switch
To reboot the switch safely:
```
reload
```
You may also specify a time delay or confirm the reboot.
Conclusion
An arista switch commands cheat sheet is an invaluable tool for anyone working with Arista switches. Familiarity with the commands outlined in this article can streamline many tasks, from basic configuration to advanced troubleshooting. Maintaining an organized approach to command usage will not only enhance efficiency but also contribute to a more stable network environment. Remember to practice these commands in a lab setup before applying them in a production environment to ensure a smooth network operation.
Frequently Asked Questions
What are the basic commands to configure an Arista switch?
Basic commands include 'enable' to enter privileged mode, 'configure terminal' to enter global configuration mode, and 'interface' to configure specific interfaces.
How do you save the configuration on an Arista switch?
Use the command 'write memory' or 'copy running-config startup-config' to save the current configuration.
What command is used to display the current configuration on an Arista switch?
The command 'show running-config' displays the current configuration of the switch.
How can you check the status of interfaces on an Arista switch?
Use the command 'show interfaces status' to view the status and details of all interfaces.
What command would you use to set a hostname on an Arista switch?
You can set the hostname using the command 'hostname [your_hostname]'.
How do you configure a VLAN on an Arista switch?
Use the command 'vlan [vlan_id]' to create a VLAN and 'name [vlan_name]' to assign a name to it.
What command allows you to view the switch's routing table?
The command 'show ip route' displays the routing table of the switch.
How do you enable SSH on an Arista switch?
Use the command 'ip ssh version 2' to enable SSH version 2, followed by 'username [user] privilege [level] secret [password]' to create a user.
What command is used to display the switch's CPU and memory usage?
You can use 'show processes cpu' for CPU usage and 'show memory' for memory usage.
How do you configure a trunk port on an Arista switch?
Enter interface configuration mode with 'interface [interface_id]', then use 'switchport mode trunk' and 'switchport trunk allowed vlan [vlan_list]'.