zoukankan      html  css  js  c++  java
  • Cisco交换机IOS配置介绍

    一、模式
    • 用户模式(>):
    • 特权模式(#):
    • 全局配置模式(config#):
    • 接口配置模式(config-if#):
    • 线路模式(#config-line):
    二、基本IOS命令结构
    •每个IOS 命令都具有特定的格式或语法,并在相应的提示符下执行。
    •常规命令语法为命令后接相应的关键字和参数。
    •某些命令包含一个关键字和参数子集,此子集可提供额外功能。

    三、相关配置
    1、 进入用户模式,命令提示符是>号(正常登陆设备CLI(command-line interface,命令行界面)后的第一个配置模式,主要用于查看统计信息,可用的命令比较少,查看部分简单配置,不可修改,配置)
    Switch>
    Switch>?
    Exec commands:
    connect Open a terminal connection
    disable Turn off privileged commands
    disconnect Disconnect an existing network connection
    enable Turn on privileged commands
    exit Exit from the EXEC
    logout Exit from the EXEC
    ping Send echo messages
    resume Resume an active network connection
    show Show running system information
    telnet Open a telnet connection
    terminal Set terminal line parameters
    traceroute Trace route to destination

    2、 输入enable进入特权模式,命令提示符是#号(从用户模式进入,可用命令比较多,查看所有配置,部分修改(保存,恢复出厂等))
    Switch>enable
    Switch#
    Switch#?
    Exec commands:
    clear Reset functions
    clock Manage the system clock
    configure Enter configuration mode
    connect Open a terminal connection
    copy Copy from one file to another
    debug Debugging functions (see also 'undebug')
    delete Delete a file
    dir List files on a filesystem
    disable Turn off privileged commands
    disconnect Disconnect an existing network connection
    enable Turn on privileged commands
    erase Erase a filesystem
    exit Exit from the EXEC
    logout Exit from the EXEC
    more Display the contents of a file
    no Disable debugging informations
    ping Send echo messages
    reload Halt and perform a cold restart
    resume Resume an active network connection
    setup Run the SETUP command facility
    show Show running system information
    --More--

    3、 输入disable从特权模式退到用户模式
    Switch#disable
    Switch>

    4、 输入configure terminal进入全局配置模式(需要从特权模式进入,在全局模式下执行命令将影响整个设备,大配置操作都在这个模式下或从这个模式进入其他模式)
    Switch#configure terminal
    Switch(config)#

    5、输入exit从全局配置模式退到特权模式
    Switch(config)#exit
    Switch#

    6、在全局配置模式下可以设置特权密码(进入特权模式的密码,用于限制人员访问特权执行模式),输入enable password
    Switch(config)#enable password 1234 #密码为1234

    Switch>enable
    Password: #再从用户模式进入特权模式提示输入密码

    7、进入某个接口配置模式
    Switch(config)#interface vlan 100
    Switch(config-if)#

    Switch(config)#interface gigabitEthernet 0/1
    Switch(config-if)#

    8、现在开始配置vlan 100 的管理ip 和子网掩码
    Switch(config-if)#ip address 192.168.100.100 255.255.255.0

    9、配置一条线路(实际线路或虚拟线路,每个连接这个设备的用户都要占用一个线路例Console、AUX 或VTY等连接方式,这里VTY(Virtual Type Terminal) 是虚拟终端的意思)

    Switch(config)#line vty 0 4
    line vty 0 4表示设置0到4号5个线路为远程登录,设置为0 3,0 2,0 1完全是可以的,0 4表示最多可以同时5个线路连接,默认0线路被Console占用)
    Switch(config-line)#

    10、在全局配置模式下可以设置Console密码(用于限制人员通过控制台(Console)连接访问设备)
    Switch(config)#line console 0 #配置console线路
    Switch(config-line)#password 1234 #密码为1234
    Switch(config-line)#login #登录启用密码检查

    11、在全局配置模式下可以设置VTY线路登录密码(用于限制人员通过VTY接访问设备)

    Switch(config)#line vty 0 10 #通过VTY线路同时连接的最大用户是10
    Switch(config-line)#password 12345 #VTY线路登录密码12345
    Switch(config-line)#login #登录启用密码检查

  • 相关阅读:
    新博客即将启用
    关于博主 | 联系博主
    结束吧,为这不圆满的故事划上一个残缺的句号
    自用线段树模板
    NOIP 2017 day 1 游记
    NOIP 2017 Day 0. 游记
    NOIP 2017 day -1 杂记
    再一次想不出应该起什么标题
    做图与树做到吐的一天
    自用二分图匹配模板
  • 原文地址:https://www.cnblogs.com/pipci/p/8116655.html
Copyright © 2011-2022 走看看