Cisco IOS Basic CLI Configuration : Switch Port Command

1.  Basic

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#interface vlan 1

Switch(config-if)#ip address 192.168.1.200 255.255.255.0

Switch(config-if)#no shutdown

Switch(config-if)#

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#exit

Switch(config)#ip default-gateway 192.168.1.1

Switch(config)#

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#interface fastethernet0/1

Switch(config-if)#duplex auto

Switch(config-if)#speed 10

Switch(config-if)#description PC1 connected

Switch(config-if)#exit

Switch(config)#interface range fastethernet 0/10 - 20

Switch(config-if-range)#description hello world

Switch(config-if-range)#exit

Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#

2.  Port Security

Switch>en

Switch#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#interface fastethernet0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport port-security

Switch(config-if)#switchport port-security maximum 1

Switch(config-if)#switchport port-security mac-address 0060.70e5.cdd1

Switch(config-if)#switchport port-security violation shutdown

Switch(config-if)#exit

Switch(config)#

Switch(config)#int fast0/2

Switch(config-if)#switchport mode access

Switch(config-if)#switchport port-security

Switch(config-if)#switchport port-security maximum 1

Switch(config-if)#switchport port-security mac-address sticky

Switch(config-if)#switchport port-security violation protect

Switch(config-if)#exit

Switch(config)#

Switch#show port-security interface fastethernet0/2

Port Security              : Enabled

Port Status                : Secure-up

Violation Mode             : Protect

Aging Time                 : 0 mins

Aging Type                 : Absolute

SecureStatic Address Aging : Disabled

Maximum MAC Addresses      : 1

Total MAC Addresses        : 1

Configured MAC Addresses   : 0

Sticky MAC Addresses       : 1

Last Source Address:Vlan   : 0004.9A36.D069:1

Security Violation Count   : 0

Switch#show port-security interface fastethernet0/1

Port Security              : Enabled

Port Status                : Secure-up

Violation Mode             : Shutdown

Aging Time                 : 0 mins

Aging Type                 : Absolute

SecureStatic Address Aging : Disabled

Maximum MAC Addresses      : 1

Total MAC Addresses        : 1

Configured MAC Addresses   : 1

Sticky MAC Addresses       : 0

Last Source Address:Vlan   : 0060.70E5.CDD1:1

Security Violation Count   : 0

3.  Port Security Actions

1.Note that the shutdown option does not actually add the shutdown subcommand to the interface configuration. Instead, IOS puts the interface in an error disabled (err-disabled) state, which makes the switch stop all inbound and outbound frames. To recover from this state, someone must manually disable the interface with the shutdown interface command and then enable the interface with the no shutdown command.

2. Port security does not save the configuration of the sticky addresses, so use the copy running-config startup-config command if desired.

Cisco IOS Basic CLI Configuration : Switch Port Command的更多相关文章

  1. Cisco IOS Basic CLI Configuration:Access Security 01

    1.  Telnet Switch Config: Switch>en Switch#conf t Enter configuration commands, one per line.  En ...

  2. Cisco IOS basic system management command reference

    absolute : to specify an absolute time for a time-range (in time-range configuration mode) no absolu ...

  3. Cisco IOS Debug Command Reference I through L

    debug iapp through debug ip ftp debug iapp : to begin debugging of IAPP operations(in privileged EXE ...

  4. Cisco IOS Security command Guide

    copy system:running-config nvram:startup-config : to save your configuration changes to the startup ...

  5. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  6. Cisco IOS debug command reference Command A through D

    debug aaa accounting through debug auto-config debug aaa accounting : to display information on acco ...

  7. Cisco IOS Software Activation Command Reference

    clear license agent : to clear license agent statistics counters or connection statistics (in privil ...

  8. Cisco IOS和IOS XE 新漏洞检测与修复

    Cisco IOS/IOS XE 新漏洞检测与修复 CVE-2018-0150 Cisco IOS XE 存在默认弱口令 漏洞影响: 默认弱口令可以导致攻击者直远程登录控制Cisco设备.受影响版本, ...

  9. Cisco IOS

    IOS Internetwork Operating System 互联网操作系统(基于UNIX系统) Cisco IOS 软件提供多种网络服务进而支持各种网络应用. Cisco IOS用户界面的基本 ...

随机推荐

  1. foundation框架之反射机制

    概念 例子 一.概念 反射:根据字符串实例话对象或者调用方法 // // main.m // 反射机制 // // Created by apple on 14-3-28. // Copyright ...

  2. 在ios开发中nil和NUll和Nilde区别————和如何判断连个对象的关系和UISlider不能拖动的问题

    nil表示一个对象指针为空,针对对象 >示例代码: NSString *someString = nil; NSURL *someURL = nil; id someObject = nil; ...

  3. 借助linq2db使用Linq访问MySQL

    linq2db (@github)支持Linq访问多种数据库.使用它操作MySQL非常简单,但使用方式上有一些“新奇”,特记录一下. 下载安装(@NuGet)以及使用教程(@For MySQL). 使 ...

  4. poj 1390 动态规划

    思路: 黑书的例题 #include<iostream> #include<cstring> #include<algorithm> #include<cma ...

  5. 使用Boost asio实现异步的TCP/IP通信

    可以先了解一下Boost asio基本概念,以下是Boost asio实现的异步TCP/IP通信: 服务器: #include "stdafx.h" #include <io ...

  6. android面试

    1. Android dvm的进程和Linux的进程, 应用程序的进程是否为同一个概念 DVM指dalivk的虚拟机.每一个Android应用程序都在它自己的进程中运行,都拥有一个独立的Dalvik虚 ...

  7. android:launchMode概述

    android:launchMode An instruction on how the activity should be launched. There are four modes that ...

  8. Part 95 to 96 Deadlock in a multithreaded program

    Part 95   Deadlock in a multithreaded program class Program { static void Main(string[] args) { Cons ...

  9. jQuery之DOM操作

    对于DOM的认知,我们了解多少? DOM是Document Object Model的缩写,意思是文档对象模型,是由W3C制定的一套访问和操作XML(eXtensible Markup Languag ...

  10. SQL数据库开发知识总结:基础篇

    1数据库概述 (1) 用自定义文件格式保存数据的劣势. (2) DBMS(DataBase Management System,数据库管理系统)和数据库,平时谈到”数据库”可能有两种含义:MSSQL ...