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. Hadoop学习笔记(1) ——菜鸟入门

    Hadoop学习笔记(1) ——菜鸟入门 Hadoop是什么?先问一下百度吧: [百度百科]一个分布式系统基础架构,由Apache基金会所开发.用户可以在不了解分布式底层细节的情况下,开发分布式程序. ...

  2. Java、Android中Math详解

    java.math.Math类常用的常量和方法: Math.PI 记录的圆周率 Math.E记录e的常量 Math.abs 求绝对值 Math.sin 正弦函数 Math.asin 反正弦函数 Mat ...

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

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

  4. 重构10-Extract Method(提取方法)

    我们要介绍的重构是提取方法.这个重构极其简单但却大有裨益.首先,将逻辑置于命名良好的方法内有助于提高代码的可读性.当方法的名称可以很好地描述这部分代码的功能时,可以有效地减少其他开发者的研究时间.假设 ...

  5. 02. SQL表达式的灵活使用

    什么是SQL表达式?在SQL语句中,表达式可以是函数,也可以是列和列之间的混合运算.很多时候,对于表达式的使用,可以比单独操作表上的列,带来更多方便. 一. 在HAVING中使用表达式 --drop ...

  6. HDU 5253 连接的管道 (最小生成树)

    连接的管道 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  7. 抽奖随机算法的技术探讨与C#实现

    一.模拟客户需求 1.1 客户A需求:要求每次都按照下图的概率随机,数量不限,每个用户只能抽一次,抽奖结果的分布与抽奖概率近似. 1.2 客户B需求:固定奖项10个,抽奖次数不限,每个用户只能抽一次, ...

  8. VB.NET 小程序 3

    Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ...

  9. asp.net MVC dropList 绑定

    废话我就不多说了..上个图.给自己备忘一下

  10. android app性能优化大汇总(google官方Android性能优化典范 - 第2季)

    Google前几天刚发布了Android性能优化典范第2季的课程,一共20个短视频,包括的内容大致有:电量优化,网络优化,Wear上如何做优化,使用对象池来提高效率,LRU Cache,Bitmap的 ...