Cisco IOS CLI -- 全局配置和控制台线路配置模式之间的区别(使用 line console 0 命令)?

网络工程 思科 转变 以太网 思科-ios 命令行
2021-07-28 06:07:12

学生在这里。有人可以向我解释这两者之间的区别吗?我为此使用串行连接。后者是指一个单独的串行终端会话吗?为什么要使用线路配置模式而不是全局?谢谢,我感谢任何帮助。

2个回答

全局配置模式用于配置全局参数。这是进入配置模式时的默认模式。

某些命令会导致您进入更具体的配置模式。当您指定要配置的线路时,将进入线路配置模式(类似于接口配置模式)。线路配置模式是您输入适合该特定线路的配置的地方。

当您处于特定配置模式时,如果您提示寻求帮助(即键入“?”),您将只会看到与该配置模式相关的命令,而不是与全局配置模式相关的命令。

这是我的一个测试开关的线路配置模式的输出:

Test(config-line)#?
Line configuration commands:
  access-class            Filter connections based on an IP access list
  accounting              Accounting parameters
  authorization           Authorization parameters
  autocommand             Automatically execute an EXEC command
  autocommand-options     Autocommand options
  data-character-bits     Size of characters being handled
  databits                Set number of data bits per character
  default                 Set a command to its defaults
  domain-lookup           Enable domain lookups in show commands
  editing                 Enable command line editing
  escape-character        Change the current line's escape character
  exec                    Configure EXEC
  exec-banner             Enable the display of the EXEC banner
  exec-character-bits     Size of characters to the command exec
  exec-timeout            Set the EXEC timeout
  exit                    Exit from line configuration mode
  flowcontrol             Set the flow control
  full-help               Provide help to unprivileged user
  help                    Description of the interactive help system
  history                 Enable and control the command history function
  international           Enable international 8-bit character support
  ip                      IP options
  length                  Set number of lines on a screen
  location                Enter terminal location description
  logging                 Modify message logging facilities
  login                   Enable password checking
  modem                   Configure the Modem Control Lines
  monitor                 Copy debug output to the current terminal line
  motd-banner             Enable the display of the MOTD banner
  no                      Negate a command or set its defaults
  notify                  Inform users of output from concurrent sessions
  padding                 Set padding for a specified output character
  parity                  Set terminal parity
  password                Set a password
  privilege               Change privilege level for line
  refuse-message          Define a refuse banner
  rotary                  Add line to a rotary group
  rxspeed                 Set the receive speed
  session-timeout         Set interval for closing connection when there is no input traffic
  special-character-bits  Size of the escape (and other special) characters
  speed                   Set the transmit and receive speeds
  start-character         Define the start character
  stop-character          Define the stop character
  stopbits                Set async line stop bits
  terminal-type           Set the terminal type
  timeout                 Timeouts for the line
  transport               Define transport protocols for line
  txspeed                 Set the transmit speeds
  vacant-message          Define a vacant banner
  width                   Set width of the display terminal

请注意,虽然某些命令相同(或相似),但您可能期望的许多全局配置模式命令并不存在,例如aaabootcdp这最后一个将出现在接口配置模式中,但控制台上没有 CDP,因此它不存在。

如果您通过控制台、telnet、SSH 等方式连接到路由器并不重要,您可以在该特定功能的模式中配置特定功能。

如果您需要配置全局命令,请在全局配置中进行。

如果要配置接口,请在接口配置中进行。

如果您正在配置线路,则在线路配置中进行。

如果您正在配置路由协议,则在路由器配置中进行。

等等。