20181112_jeffrey - silenceuncrio/diary GitHub Wiki

0910

早上上班忘了帶員工識別證

先發一封 mail 給 evonne

幫忙把 wifi 的 web ui 從 develop branch 搬到 hotfox/v1.74 branch

0940

commit 88fcef974b9c661a56fcf45cb0aa7392b0961b59
Refs: [hotfix/v1.74], {origin/hotfix/v1.74}
Author: jeffrey <[email protected]>
Date:   Mon Nov 12 09:40:11 2018 +0800

    add 'WIFI / WIFI Config' web page
    - from develop branch

 proscend/prosrc/icos/iweb/iweb.c                 |   4 +
 proscend/prosrc/webcgi/Makefile                  |   4 +
 proscend/prosrc/webcgi/wifi_apsta.c              | 183 +++++++++++++++++++++++
 proscend/prosrc/www/app/feature/wifi_apsta.html  | 115 ++++++++++++++
 proscend/prosrc/www/app/feature/wifi_apsta.js    |  59 ++++++++
 proscend/prosrc/www/app/locale-en.json           |  18 +++
 proscend/prosrc/www/app/locale-fr.json           |  18 +++
 proscend/prosrc/www/app/locale-zh-tw.json        |  18 +++
 proscend/prosrc/www/app/services/icos.service.js |  11 +-
 proscend/prosrc/www/src/index.html.src           |   1 +
 proscend/prosrc/www/src/menu.html.src            |  19 +++
 11 files changed, 448 insertions(+), 2 deletions(-)

1010

差不多要來玩一下 Cisco 2951 Integrated Services Router

參考 [Cisco 3900 Series and Cisco 2900 Series Hardware Installation Guide]https://www.cisco.com/c/en/us/td/docs/routers/access/2900/hardware/installation/guide/Hardware_Installation_Guide/Install_Connect.html

Console terminal (an ASCII terminal or a PC running HyperTerminal or similar terminal emulation software) configured for 9600 baud, 8 data bits, 1 stop bit, no flow control, and no parity.

得知 console 的 baud rate

接上 console 開機吧

System Bootstrap, Version 15.0(1r)M6, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2010 by cisco Systems, Inc.

Total memory size = 512 MB - DIMM0 = 512 MB, DIMM1 = 0 MB
CISCO2951/K9 platform with 524288 Kbytes of main memory
Main memory is configured to 72/0(dimm 0/1) bit mode with ECC enabled

Readonly ROMMON initialized
program load complete, entry point: 0x4000000, size: 0x18fa0
program load complete, entry point: 0x4000000, size: 0x18fa0

這邊停了快 2 分鐘多



IOS Image Load Test
___________________
Digitally Signed Release Software
program load complete, entry point: 0x4000000, size: 0x63e034c
Self decompressing the image : ##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################### [OK]
*** No sreloc section
I2C Init
I2C Init
PCI Bridge Cfg
CPU PCIE cont
IO Controller US port, DS port
Smart Init is enabled
smart init is sizing iomem
                 TYPE      MEMORY_REQ
          HWIC Slot 1      0x00200000
    Onboard devices &
         buffer pools      0x0230F000
-----------------------------------------------
               TOTAL:      0x0250F000

Rounded IOMEM up to: 38MB.
Using 7 percent iomem. [38MB/512MB]

              Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706



Cisco IOS Software, C2951 Software (C2951-UNIVERSALK9-M), Version 15.4(3)M2, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Fri 06-Feb-15 17:54 by prod_rel_team


MBRD Subsys Init
Reg adds done
IO Controller MSI,GPIO,HSIB ERR
SM Resets
GBIC
This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
[email protected].

Installed image archive
Cisco CISCO2951/K9 (revision 1.0) with 485376K/38912K bytes of memory.
Processor board ID FHK1428F2PG
7 Gigabit Ethernet interfaces
1 terminal line
1 Virtual Private Network (VPN) Module
DRAM configuration is 72 bits wide with parity enabled.
255K bytes of non-volatile configuration memory.
254464K bytes of ATA System CompactFlash 0 (Read/Write)

然後問了我一些問題


         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: yes

At any point you may enter a question mark '?' for help.
Use ctrl-c to abort configuration dialog at any prompt.
Default settings are in square brackets '[]'.

Basic management setup configures only enough connectivity
for management of the system, extended setup will ask you
to configure each interface on the system

Would you like to enter basic management setup? [yes/no]:

yes

Would you like to enter basic management setup? [yes/no]: yes
Configuring global parameters:

  Enter host name [Router]:

  The enable secret is a password used to protect access to
  privileged EXEC and configuration modes. This password, after
  entered, becomes encrypted in the configuration.
  Enter enable secret: admin

  The enable password is used when you do not specify an
  enable secret password, with some older software versions, and
  some boot images.
  Enter enable password: admin
% Please choose a password that is different from the enable secret
  Enter enable password: 2wsx#EDC

  The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password: 2wsx#EDC
  Configure SNMP Network Management? [yes]:
    Community string [public]:

Current interface summary


Any interface listed with OK? value "NO" does not have a valid configuration

Interface                  IP-Address      OK? Method Status                Protocol
Embedded-Service-Engine0/0 unassigned      NO  unset  initializing          down
GigabitEthernet0/0         unassigned      NO  unset  down                  down
GigabitEthernet0/1         unassigned      NO  unset  down                  down
GigabitEthernet0/2         unassigned      NO  unset  down                  down
GigabitEthernet0/1/0       unassigned      YES unset  down                  down
GigabitEthernet0/1/1       unassigned      YES unset  down                  down
GigabitEthernet0/1/2       unassigned      YES unset  down                  down
GigabitEthernet0/1/3       unassigned      YES unset  down                  down
Vlan1                      unassigned      YES unset  down                  down

Enter interface name used to connect to the
management network from the above interface summary: GigabitEthernet0/1/0

Configuring interface GigabitEthernet0/1/0:
  Configure IP on this interface? [no]:

The following configuration command script was created:

hostname Router
enable secret 5 $1$233h$N.McbtNhCupPDDN7oogfb1
enable password 2wsx#EDC
line vty 0 4
password 2wsx#EDC
snmp-server community public
!
!
interface Embedded-Service-Engine0/0
shutdown
no ip address
!
interface GigabitEthernet0/0
shutdown
no ip address
!
interface GigabitEthernet0/1
shutdown
no ip address
!
interface GigabitEthernet0/2
shutdown
no ip address
!
interface GigabitEthernet0/1/0
no shutdown
no ip address
no mop enabled
!
interface GigabitEthernet0/1/1
shutdown
no ip address
!
interface GigabitEthernet0/1/2
shutdown
no ip address
!
interface GigabitEthernet0/1/3
shutdown
no ip address
!
interface Vlan1
shutdown
no ip address
!
end


[0] Go to the IOS command prompt without saving this config.
[1] Return back to the setup without saving this config.
[2] Save this configuration to nvram and exit.

Enter your selection [2]:

回答了一些問題最後我選擇了 [0] Go to the IOS command prompt without saving this config.

% You can enter the setup, by typing setup at IOS command prompt


Press RETURN to get started!


*Jan  2 00:00:02.219: %IOS_LICENSE_IMAGE_APPLICATION-6-LICENSE_LEVEL: Module name = c2951 Next reboot level = ipbasek9 and License = ipbasek9
*Jan  2 00:00:02.311: %IOS_LICENSE_IMAGE_APPLICATION-6-LICENSE_LEVEL: Module name = c2951 Next reboot level = securityk9 and License = securityk9
*Nov 12 02:33:51.643: c3600_scp_set_dstaddr2_idb(184)add = 80 name is Embedded-Service-Engine0/0
*Nov 12 02:33:52.547: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0  State changed to: Initialized
*Nov 12 02:33:52.551: %VPN_HW-6-INFO_LOC: Crypto engine: onboard 0  State changed to: Enabled
*Nov 12 02:34:04.907: %CTS-6-ENV_DATA_START_STATE: Environment Data Download in start state
*Nov 12 02:34:06.903: %PA-3-PA_INIT_FAILED: Performance Agent failed to initialize (Missing Data License)
*Nov 12 02:34:09.743: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down
*Nov 12 02:34:09.743: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to down
*Nov 12 02:34:09.743: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down
*Nov 12 02:34:10.391: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
*Nov 12 02:34:10.743: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to down
*Nov 12 02:34:10.743: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to down
*Nov 12 02:34:10.743: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to down
*Nov 12 02:36:17.383: %SYS-3-HARIKARI: Process Wait on Autoinstall top-level routine exited
*Nov 12 02:36:37.383: %PNP-6-HTTP_CONNECTING: PnP Discovery trying to connect to PnP server https://devicehelper.cisco.com/pnp/HELLO
*Nov 12 02:36:57.382: %PNP-6-HTTP_CONNECTING: PnP Discovery trying to connect to PnP server https://devicehelper.cisco.com/pnp/HELLO
*Nov 12 02:41:23.333: %LINK-5-CHANGED: Interface Embedded-Service-Engine0/0, changed state to administratively down
*Nov 12 02:41:23.337: %LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to administratively down
*Nov 12 02:41:23.409: %LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to administratively down
*Nov 12 02:41:23.513: %LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to administratively down
*Nov 12 02:41:24.333: %LINEPROTO-5-UPDOWN: Line protocol on Interface Embedded-Service-Engine0/0, changed state to down
*Nov 12 02:41:26.513: %IP-5-WEBINST_KILL: Terminating DNS process
*Nov 12 02:41:30.041: %SYS-5-RESTART: System restarted --
Cisco IOS Software, C2951 Software (C2951-UNIVERSALK9-M), Version 15.4(3)M2, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Fri 06-Feb-15 17:54 by prod_rel_team
*Nov 12 02:41:30.101: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is OFF
*Nov 12 02:41:30.101: %CRYPTO-6-GDOI_ON_OFF: GDOI is OFF
*Nov 12 02:41:30.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/0, changed state to down
*Nov 12 02:41:30.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/1, changed state to down
*Nov 12 02:41:30.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/2, changed state to down
*Nov 12 02:41:30.801: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1/3, changed state to down
Router>

進入了 IOS command prompt ?

看一下有什麼東西

Router>?
Exec commands:
  <0-4>/<0-4>      Enter card slot/sublot number
  access-enable    Create a temporary Access-List entry
  access-profile   Apply user-profile to interface
  clear            Reset functions
  connect          Open a terminal connection
  crypto           Encryption related commands.
  disable          Turn off privileged commands
  disconnect       Disconnect an existing network connection
  do-exec          Mode-independent "do-exec" prefix support
  emm              Run a configured Menu System
  enable           Turn on privileged commands
  ethernet         Ethernet parameters
  exit             Exit from the EXEC
  help             Description of the interactive help system
  hw-module        Hardware module level specific operations
  ip               IP SLA Exec Command
  ips              Intrusion Prevention System
  lock             Lock the terminal
  login            Log in as a particular user
  logout           Exit from the EXEC
  modemui          Start a modem-like user interface
  mrinfo           Request neighbor and version information from a multicast
                   router
  mstat            Show statistics after multiple multicast traceroutes
  mtrace           Trace reverse multicast path from destination to source
  name-connection  Name an existing network connection
  pad              Open a X.29 PAD connection
  ping             Send echo messages
  power            PS exec commands
  ppp              Start IETF Point-to-Point Protocol (PPP)
  release          Release a resource
  renew            Renew a resource
  resume           Resume an active network connection
  rlogin           Open an rlogin connection
  routing-context  Routing Context
  set              Set system parameter (not config)
  show             Show running system information
  slip             Start Serial-line IP (SLIP)
  ssh              Open a secure shell client connection
  systat           Display information about terminal lines
  tclquit          Quit Tool Command Language shell
  telnet           Open a telnet connection
  terminal         Set terminal line parameters
  traceroute       Trace route to destination
  trm              Trend Registration Module
  tunnel           Open a tunnel connection
  ucse             UCSE server
  udptn            Open an udptn connection
  waas             IOS Wide Area Application Services
  where            List active connections
  x28              Become an X.28 PAD
  x3               Set X.3 parameters on PAD

Router>

先關機吧 有點吵

看一下我剛剛設定了什麼密碼

enable secret: admin

  The enable secret is a password used to protect access to
  privileged EXEC and configuration modes. This password, after
  entered, becomes encrypted in the configuration.
  Enter enable secret: admin

enable password: 2wsx#EDC

  The enable password is used when you do not specify an
  enable secret password, with some older software versions, and
  some boot images.
  Enter enable password: admin
% Please choose a password that is different from the enable secret
  Enter enable password: 2wsx#EDC

virtual terminal password: 2wsx#EDC

  The virtual terminal password is used to protect
  access to the router over a network interface.
  Enter virtual terminal password: 2wsx#EDC

下面的說明只是上述的中翻英罷了

enable password 和 enable secret 指令被用來限制存取特權 EXEC 模式。enable password 只能在 enable secret 沒有設定的時候使用。應該使用 enable secret 指令,因為 enable secret 指令是加密的,而 enable password 指令沒有加密

1330

繼續熟悉手邊的 Cisco 2951

Cisco 2951 - interface - all image

Cisco 2951 - interface - valid image

對照一下早上的 Current interface summary

Current interface summary


Any interface listed with OK? value "NO" does not have a valid configuration

Interface                  IP-Address      OK? Method Status                Protocol
Embedded-Service-Engine0/0 unassigned      NO  unset  initializing          down
GigabitEthernet0/0         unassigned      NO  unset  down                  down
GigabitEthernet0/1         unassigned      NO  unset  down                  down
GigabitEthernet0/2         unassigned      NO  unset  down                  down
GigabitEthernet0/1/0       unassigned      YES unset  down                  down
GigabitEthernet0/1/1       unassigned      YES unset  down                  down
GigabitEthernet0/1/2       unassigned      YES unset  down                  down
GigabitEthernet0/1/3       unassigned      YES unset  down                  down
Vlan1                      unassigned      YES unset  down                  down

Cisco 2951 - interface - GE 0/0, GE 0/1, GE 0/2

image

這對應到的應該是

Interface                  IP-Address      OK? Method Status                Protocol
...
GigabitEthernet0/0         unassigned      NO  unset  down                  down
GigabitEthernet0/1         unassigned      NO  unset  down                  down
GigabitEthernet0/2         unassigned      NO  unset  down                  down
...

左側還有 4 個 port

Cisco 2951 - interface - EHWIC 1

image

對應到的應該是

Interface                  IP-Address      OK? Method Status                Protocol
...
GigabitEthernet0/1/0       unassigned      YES unset  down                  down
GigabitEthernet0/1/1       unassigned      YES unset  down                  down
GigabitEthernet0/1/2       unassigned      YES unset  down                  down
GigabitEthernet0/1/3       unassigned      YES unset  down                  down
...

先學著怎麼設定 GE 0/0 讓自己的 PC 能夠 ping 的到吧

再開機吧

         --- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]:

這次選 no

看一下有什麼 command

Router>?
Exec commands:
  <0-4>/<0-4>      Enter card slot/sublot number
  access-enable    Create a temporary Access-List entry
  access-profile   Apply user-profile to interface
  clear            Reset functions
  connect          Open a terminal connection
  crypto           Encryption related commands.
  disable          Turn off privileged commands
  disconnect       Disconnect an existing network connection
  do-exec          Mode-independent "do-exec" prefix support
  emm              Run a configured Menu System
  enable           Turn on privileged commands
  ethernet         Ethernet parameters
  exit             Exit from the EXEC
  help             Description of the interactive help system
  hw-module        Hardware module level specific operations
  ip               IP SLA Exec Command
  ips              Intrusion Prevention System
  lock             Lock the terminal
  login            Log in as a particular user
  logout           Exit from the EXEC
  modemui          Start a modem-like user interface
  mrinfo           Request neighbor and version information from a multicast
                   router
  mstat            Show statistics after multiple multicast traceroutes
  mtrace           Trace reverse multicast path from destination to source
  name-connection  Name an existing network connection
  pad              Open a X.29 PAD connection
  ping             Send echo messages
  power            PS exec commands
  ppp              Start IETF Point-to-Point Protocol (PPP)
  release          Release a resource
  renew            Renew a resource
  resume           Resume an active network connection
  rlogin           Open an rlogin connection
  routing-context  Routing Context
  set              Set system parameter (not config)
  show             Show running system information
  slip             Start Serial-line IP (SLIP)
  ssh              Open a secure shell client connection
  systat           Display information about terminal lines
  tclquit          Quit Tool Command Language shell
  telnet           Open a telnet connection
  terminal         Set terminal line parameters
  traceroute       Trace route to destination
  trm              Trend Registration Module
  tunnel           Open a tunnel connection
  ucse             UCSE server
  udptn            Open an udptn connection
  waas             IOS Wide Area Application Services
  where            List active connections
  x28              Become an X.28 PAD
  x3               Set X.3 parameters on PAD
Router>

利用 enable - Turn on privileged commands

Router>enable
Router#?
Exec commands:
  <0-4>/<0-4>      Enter card slot/sublot number
  access-enable    Create a temporary Access-List entry
  access-profile   Apply user-profile to interface
  access-template  Create a temporary Access-List entry
  archive          manage archive files
  auto             Exec level Automation
  beep             Blocks Extensible Exchange Protocol commands
  bfe              For manual emergency modes setting
  bulkstat         Bulkstat exec commands
  calendar         Manage the hardware calendar
  call-home        Call-Home commands
  cd               Change current directory
  clear            Reset functions
  clock            Manage the system clock
  cns              CNS agents
  configure        Enter configuration mode
  connect          Open a terminal connection
  copy             Copy from one file to another
  crypto           Encryption related commands.
  cts              Cisco Trusted Security Exec Commands
  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
  do-exec          Mode-independent "do-exec" prefix support
  dot1x            IEEE 802.1X Exec Commands
  eap              EAP Exec Commands
  emm              Run a configured Menu System
  enable           Turn on privileged commands
  eou              EAPoUDP
  erase            Erase a filesystem
  ethernet         Ethernet parameters
  event            Event related commands
  exit             Exit from the EXEC
  format           Format a filesystem
  fsck             Fsck a filesystem
  help             Description of the interactive help system
  hw-module        Hardware module level specific operations
  if-mgr           IF-MGR operations
  ip               Exec commands for IP features
  ip               IP SLA Exec Command
  ips              Intrusion Prevention System
  isdn             Run an ISDN EXEC command on an ISDN interface
  license          License information
  lock             Lock the terminal
  logging          Handles logging operations
  login            Log in as a particular user
  logout           Exit from the EXEC
  microcode        microcode commands
  mkdir            Create new directory
  modemui          Start a modem-like user interface
  monitor          Monitoring different system events
  more             Display the contents of a file
  mrinfo           Request neighbor and version information from a multicast
                   router
  mrm              IP Multicast Routing Monitor Test
  mstat            Show statistics after multiple multicast traceroutes
  mtrace           Trace reverse multicast path from destination to source
  name-connection  Name an existing network connection
  no               Disable debugging functions
  onep             ONEP related commands
  pad              Open a X.29 PAD connection
  partition        Partition disk
  ping             Send echo messages
  power            PS exec commands
  ppp              Start IETF Point-to-Point Protocol (PPP)
  pwd              Display current working directory
  redundancy       Redundancy Facility (RF) exec commands
  release          Release a resource
  reload           Halt and perform a cold restart
  rename           Rename a file
  renew            Renew a resource
  restart          Restart Connection
  resume           Resume an active network connection
  rlogin           Open an rlogin connection
  rmdir            Remove existing directory
  routing-context  Routing Context
  rsh              Execute a remote command
  send             Send a message to other tty lines
  service-module   Service module
  set              Set system parameter (not config)
  setup            Run the SETUP command facility
  show             Show running system information
  slip             Start Serial-line IP (SLIP)
  software         Software commands
  spec-file        format spec file commands
  ssh              Open a secure shell client connection
  start-chat       Start a chat-script on a line
  systat           Display information about terminal lines
  tarp             TARP (Target ID Resolution Protocol) commands
  tclquit          Quit Tool Command Language shell
  tclsh            Tool Command Language shell
  telnet           Open a telnet connection
  terminal         Set terminal line parameters
  test             Test subsystems, memory, and interfaces
  traceroute       Trace route to destination
  trm              Trend Registration Module
  tunnel           Open a tunnel connection
  ucse             UCSE server
  udptn            Open an udptn connection
  undebug          Disable debugging functions (see also 'debug')
  upgrade          Upgrade commands
  verify           Verify a file
  vlan             Configure VLAN parameters
  vtp              Configure global VTP state
  waas             IOS Wide Area Application Services
  webvpn           WebVPN exec command
  where            List active connections
  which-route      Do OSI route table lookup and display results
  write            Write running configuration to memory, network, or terminal
  x28              Become an X.28 PAD
  x3               Set X.3 parameters on PAD

Router#

參考 Cisco交換器常用指令大彙整

熟悉一下

1415

privileged mode 之下可以利用 configure - Enter configuration mode

Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#

看一下 configuration mode 有什麼 command

Router(config)#?
Configure commands:
  aaa                         Authentication, Authorization and Accounting.
  access-list                 Add an access list entry
  alias                       Create command alias
  appfw                       Configure the Application Firewall policy
  archive                     Archive the configuration
  arp                         Set a static ARP entry
  async-bootp                 Modify system bootp parameters
  authentication              Auth Manager Global Configuration Commands
  autoupgrade                 Auto Upgrade Manager simplifies image upgrade
                              process
  backhaul-session-manager    Configure Backhaul Session Manager
  banner                      Define a login banner
  bba-group                   Configure BBA Group
  beep                        Configure BEEP (Blocks Extensible Exchange
                              Protocol)
  bfd                         BFD configuration commands
  bfd-template                BFD template configuration
  boot                        Modify system boot parameters
  bridge                      Bridge Group.
  buffers                     Adjust system buffer pool parameters
  bulkstat                    Bulkstat Application
  busy-message                Display message when connection to host fails
  call                        Configure Call parameters
  call-history-mib            Define call history mib parameters
  call-home                   Enter call-home configuration mode
  carrier-id                  Name of the carrier associated with this trunk
                              group
  cdp                         Global CDP configuration subcommands
  cef                         Cisco Express Forwarding
  cem                         Configure a specific cem channel
  chat-script                 Define a modem chat script
  cisp                        Set CISP parameters
  class-map                   Configure CPL Class Map
  clns                        Global CLNS configuration subcommands
  clock                       Configure time-of-day clock
  cns                         CNS agents
  config-register             Define the configuration register
  configuration               Configuration access
  connect                     cross-connect two interfaces
  control-plane               Configure control plane services
  credentials                 credentials service
  crypto                      Encryption module
  csdb                        Common Session Database
  cts                         Cisco Trusted Security commands
  cwmp                        Configure CPE WAN Management Protocol(CWMP)
  cws                         Cloud Web Security
  default                     Set a command to its defaults
  default-value               Default character-bits values
  define                      interface range macro definition
  device-sensor               IOS Sensor Commands
  dialer                      Dialer commands
  dialer-list                 Create a dialer list entry
  dnsix-dmdp                  Provide DMDP service for DNSIX
  dnsix-nat                   Provide DNSIX service for audit trails
  do-exec                     To run exec commands in config mode
  dot1x                       IEEE 802.1X Global Configuration Commands
  downward-compatible-config  Generate a configuration compatible with older
                              software
  dspfarm                     Enable the dspfarm service
  eap                         EAP Global Configuration Commands
  emm                         Specify pre-loading of MDF
  enable                      Modify enable password parameters
  end                         Exit from configure mode
  energywise                  EnergyWise Global Configuration Commands
  eou                         EAPoUDP Global Configuration Commands
  epm                         EPM Global Configuration Commands
  errdisable                  Error disable
  ethernet                    Ethernet configuration
  event                       Event related configuration commands
  exception                   Exception handling
  exit                        Exit from configure mode
  fhrp                        Configure First Hop Redundancy Protocols
  file                        Adjust file system parameters
  flow                        Global Flow configuration subcommands
  flow-sampler-map            Flow sampler configuration
  format                      Format the output
  frame-relay                 global frame relay configuration commands
  global-address-family       Enter address-family base routing topology mode
  help                        Description of the interactive help system
  hostname                    Set system's network name
  hw-module                   Configure specific hardware module
  id-manager                  ID Pool Manager
  ida-client                  IDA Client provides infra for communication with
                              IDA on cisco server
  identity                    Identity Configuration Commands
  interface                   Select an interface to configure
  ip                          Global IP configuration subcommands
  ipc                         Configure IPC system
  iphc-profile                Configure IPHC profile
  ipv6                        Global IPv6 configuration commands
  isis                        Global ISIS configuration subcommands
  iua                         Configure ISDN user Adaptation Layer
  ixi                         IXI Config command
  kerberos                    Configure Kerberos
  key                         Key management
  kron                        Kron interval Facility
  l2protocol-tunnel           Tunnel Layer2 protocols
  l2tp                        Layer 2 Tunneling Protocol (L2TP) parameters
  l2tp-class                  l2tp-class configuration
  li-view                     LI View
  license                     Configure license features
  line                        Configure a terminal line
  lldp                        Global LLDP configuration subcommands
  location                    Global location configuration commands
  logging                     Modify message logging facilities
  login                       Enable secure login checking
  login-string                Define a host-specific login string
  mab                         MAC Authentication Bypass Global Configuration
                              Commands
  mac-address-table           Configure the MAC address table
  macro                       Create a command macro
  map-class                   Configure static map class
  map-list                    Configure static map list
  memory                      Configure memory management
  memory-size                 Adjust memory size by percentage
  menu                        Define a user-interface menu
  metadata                    Metadata Application
  microcode                   configure microcode
  mls                         mls global commands
  modem-pool                  Configure a modem pool
  modemcap                    Modem Capabilities database
  monitor                     Monitoring different system events
  mop                         Configure the DEC MOP Server
  multilink                   PPP multilink global configuration
  nat64                       NAT64 configuration commands
  netbios                     NETBIOS access control filtering
  netconf                     Configure NETCONF
  network-clock-participate   Participate in Network Clocking
  network-clock-select        Choose system clocking priority
  network-clock-switch        Network clock switch or restore period
  nmsp                        NMSP configuration commands
  no                          Negate a command or set its defaults
  ntp                         Configure NTP
  object-group                Configure ACL Object Group
  onep                        ONEP functionality
  parameter-map               parameter map
  parser                      Configure parser
  password                    Configure encryption password (key)
  pnp                         Configure PNP
  policy-map                  Configure Policy Map
  port-channel                EtherChannel configuration
  ppp                         PPP global configuration
  printer                     Define an LPD printer
  privilege                   Command privilege parameters
  process                     Configure process
  process-max-time            Maximum time for process to run before
                              voluntarily relinquishing processor
  prompt                      Set system's prompt
  qos                         Global QoS configuration subcommands
  rbe                         Commands for Routing RFC 1483 Ethernet
                              encapsulated packets
  redundancy                  Enter redundancy mode
  regexp                      regexp commands
  resource                    Configure Embedded Resource Manager (ERM)
  resume-string               Define a host-specific resume string
  rif                         Source-route RIF cache
  rlogin                      Rlogin configuration commands
  rmon                        Remote Monitoring
  route-map                   Create route-map or enter route-map command mode
  route-tag                   Route Tag
  router                      Enable a routing process
  sampler                     Define a Sampler
  sasl                        Configure SASL
  scheduler                   Scheduler parameters
  scripting                   Configure options for scripting languages
  secure                      Secure image and configuration archival commands
  security                    Infra Security CLIs
  service                     Modify use of network based services
  service-instance            Configure a Static Service
  service-list                Enter the service list
  service-routing             Configure service-routing
  service-routing             Configure service-routing
  sgbp                        SGBP Stack Group Bidding Protocol configuration
  shell                       Configure shell command
  shutdown                    Shutdown system elements
  signaling-class             Configure signaling class
  snap                        SNAP configuration
  snmp                        Modify non engine SNMP parameters
  snmp-server                 Modify SNMP engine parameters
  sntp                        Configure SNTP
  source-bridge               Source-route bridging ring groups
  spanning-tree               Spanning Tree Subsystem
  stackmaker                  Specify stack name and add its member
  stacks                      Configure stacks
  standby                     Global HSRP configuration commands
  state-machine               Define a TCP dispatch state machine
  subscriber                  Subscriber configuration
  subscriber-policy           Subscriber policy
  table-map                   Configure Table Map
  tacacs-server               Modify TACACS query parameters
  tarp                        Global TARP configuration subcommands
  template                    Select a template to configure
  terminal-queue              Terminal queue commands
  tftp-server                 Provide TFTP service for netload requests
  time-range                  Define time range entries
  track                       Object tracking configuration commands
  transceiver                 Select from transceiver configuration commands
  translate                   Translate global configuration commands
  trunk                       Global trunk configuration
  user-group                  User Group Configuration Commands
  username                    Establish User Name Authentication
  vc-group                    Define a Frame Relay VC group
  virtual-profile             Virtual Profile configuration
  virtual-template            Virtual Template configuration
  vlan                        VLAN commands
  voice-ctl-file              Configure a ctl-file instance
  voice-phone-proxy           Configure Phone proxy
  vpdn                        Virtual Private Dialup Network
  vpdn-group                  VPDN group configuration
  vpdn-template               vpdn-template configuration
  vrf                         VRF commands
  vstack                      Configure vstack parameters and enable or disable
                              SmartInstall
  vtp                         Configure global VTP state
  vty-async                   Enable virtual async line configuration
  waas                        IOS Wide Area Application Services
  warm-reboot                 Warm reboot allows quick reload in case of a
                              crash or by request
  webvpn                      SSL VPN Commands
  wrr-queue                   Configure weighted round-robin xmt queues
  wsma                        Configure Web Services Management Agents
  x25                         X.25 Level 3
  x29                         X29 commands
  xot                         Global XOT commands
  zone                        FW with zoning
  zone-pair                   Zone pair command

Router(config)#

利用 interface - Select an interface to configure 指定 GigabitEthernet 0/0

Router(config)#interface GigabitEthernet 0/0
Router(config-if)#

看一下有哪些 command

Router(config-if)#?
Interface configuration commands:
  aaa                 Authentication, Authorization and Accounting.
  access-expression   Build a bridge boolean access expression
  arp                 Set arp type (arpa, probe, snap), timeout, log options or
                      packet priority
  authentication      Auth Manager Interface Configuration Commands
  backup              Modify backup parameters
  bandwidth           Set bandwidth informational parameter
  bfd                 BFD interface configuration commands
  bgp-policy          Apply policy propagated by bgp community string
  bridge-group        Transparent bridging interface parameters
  carrier-delay       Specify delay for interface transitions
  cdp                 CDP interface subcommands
  channel-group       Add this interface to an Etherchannel group
  clns                CLNS interface subcommands
  cmns                OSI CMNS
  crypto              Encryption/Decryption commands
  cts                 Configure Cisco Trusted Security
  cwmp                Configure CPE WAN Management Protocol(CWMP) on this
                      interface
  cws                 Configure Cloud Web Security
  dampening           Enable event dampening
  default             Set a command to its defaults
  delay               Specify interface throughput delay
  description         Interface specific description
  dot1q               dot1q interface configuration commands
  dot1x               Interface Config Commands for IEEE 802.1X
  duplex              Configure duplex operation.
  eou                 EAPoUDP Interface Configuration Commands
  ethernet            Ethernet interface parameters
  exit                Exit from interface configuration mode
  fhrp                Configure FHRP
  flow-sampler        Attach flow sampler to the interface
  glbp                Gateway Load Balancing Protocol interface commands
  help                Description of the interactive help system
  history             Interface history histograms - 60 second, 60 minute and
                      72 hour
  hold-queue          Set hold queue depth
  ip                  Interface Internet Protocol config commands
  iphc-profile        Configure IPHC profile
  ipv6                IPv6 interface subcommands
  isis                IS-IS commands
  iso-igrp            ISO-IGRP interface subcommands
  keepalive           Enable keepalive
  llc2                LLC2 Interface Subcommands
  lldp                LLDP interface subcommands
  load-interval       Specify interval for load calculation for an interface
  location            Interface location information
  logging             Configure logging for interface
  loopback            Configure internal loopback on an interface
  mab                 MAC Authentication Bypass Interface Config Commands
  mac-address         Manually set interface MAC address
  macro               Command macro
  metadata            Metadata Application
  mop                 DEC MOP server commands
  mtu                 Set the interface Maximum Transmission Unit (MTU)
  nat64               NAT64 interface commands
  netbios             Use a defined NETBIOS access list or enable name-caching
  no                  Negate a command or set its defaults
  ntp                 Configure NTP
  onep                Configure onep settings
  ospfv3              OSPFv3 interface commands
  pagp                PAgP interface subcommands
  port-tagging        Allow port tagging on an interface
  pppoe               pppoe interface subcommands
  pppoe-client        pppoe client
  rate-limit          Rate Limit
  redundancy          RG redundancy interface config
  routing             Per-interface routing configuration
  service-policy      Configure CPL Service Policy
  service-routing     Service Routing in Interface Mode
  shutdown            Shutdown the selected interface
  snapshot            Configure snapshot support on the interface
  snmp                Modify SNMP interface parameters
  source              Get config from another source
  speed               Configure speed operation.
  standby             HSRP interface configuration commands
  tarp                TARP interface subcommands
  timeout             Define timeout values for this interface
  topology            Configure routing topology on the interface
  transmit-interface  Assign a transmit interface to a receive-only interface
  transport-opt       Enable Transport Optimization on an Interface or a
                      Sub-Interface
  tx-ring-limit       Configure PA level transmit ring limit
  user-group          Interface-User-group Association
  vlan-id             Process VLAN-encapsulated packets with a specific VLAN ID
  vlan-range          Process VLAN-encapsulated packets with a range of VLAN
                      IDs
  vnet                Configure VNET interface options
  vrf                 VPN Routing/Forwarding parameters on the interface
  vrrp                VRRP Interface configuration commands
  waas                WAN Optimization
  zone-member         Apply zone name

Router(config-if)#

利用 ip address ? 得知怎麼來設定 ip

Router(config-if)#ip address ?
  A.B.C.D  IP address
  dhcp     IP Address negotiated via DHCP
  pool     IP Address autoconfigured from a local DHCP pool

ip address 192.168.1.200 255.255.255.0

Router(config-if)#ip address 192.168.1.200 255.255.255.0
Router(config-if)#

怎麼來 check 呢?

這要利用 exit 退出 configuration mode

然後利用 show interfaces GigabitEthernet 0/0

Router#show interfaces GigabitEthernet 0/0
GigabitEthernet0/0 is administratively down, line protocol is down
  Hardware is PQ3_TSEC, address is d0d0.fd3f.42e0 (bia d0d0.fd3f.42e0)
  Internet address is 192.168.1.200/24
  MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Auto Duplex, Auto Speed, media type is RJ45
  output flow-control is unsupported, input flow-control is unsupported
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input never, output never, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts (0 IP multicasts)
     0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
     0 watchdog, 0 multicast, 0 pause input
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 unknown protocol drops
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier, 0 pause output
     0 output buffer failures, 0 output buffers swapped out

可以把網路線接上去了

接上網路線都沒亮燈

應該是受 administratively down 所影響

Router#show interfaces GigabitEthernet 0/0
GigabitEthernet0/0 is administratively down, line protocol is down
...

回到 configuration mode 的 interface GigabitEthernet 0/0

利用 no shutdown 把該 interface 叫起來

Router(config-if)#no shutdown
...
*Nov 12 07:05:02.923: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to down
*Nov 12 07:05:06.735: %LINK-3-UPDOWN: Interface GigabitEthernet0/0, changed state to up
*Nov 12 07:05:07.735: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up
...

應該是起來囉

Router#show interfaces GigabitEthernet 0/0
GigabitEthernet0/0 is up, line protocol is up
...

由 PC 已經可以 ping 到 GigabitEthernet 0/0

關機吧

⚠️ **GitHub.com Fallback** ⚠️