Router (config-line) #login
Router (config-line) #password cisco Set a telnet password: Set telnet password. Router (config) #line vty 0 4
Router (config-line) #login
Router (config-line) #password cisco Stop console timing out: Console is not logged off. Router (config) #line child 0
Router (config-line) # exec-timeout 0 0 Set the enable password to cisco: Set the enable password to be cisco. Router (config) #enable password cisco
Đặt sự mật khẩu enable enable sang peter:
Set secret password is peter. This password overrides the enable password and is encrypted in the configuration file.
Router (config) #enable secret peter Enable an interface: Enable interface. Router (config-if) #no shutdown To disable an interface: Turn off the interface. Router (config-if) #shutdown Set the clock rate for a router with a DCE cable to 64K: Set the clock rate for the router with the DCE cable to 64000. Router (config-if) clock rate 64000 Set a logical bandwidth assignment of 64K the serial interface: Assign logical bandwidth to the serial interface. Router (config-if) bandwidth 64 To add an IP address to a interface: Add IP to the interface. Router (config-if) #ip addr 10.1.1.1 255.255.255.0 To enable RIP on all 172.16.xy interfaces: Turn on RIP on all interface 172.16.xy Router (config) #router ripEnable the http server to SDM can be used: Enable http server to use SDM.
Router (config) #ip http server
Defines a username and password: Set username (sue) and password (cisco). Can be used for PPP authentication or user access.
Router (config) #username to password cisco
Determine the local host file in unix, like:
/ etc / hosts in unix
Router (config) #ip host mypc 10.1.1.3
Disable Disables DNS lookup. Useful when commands are typed.
Router (config) #no ip domain-lookup
Set the logical bandwidth (not physical) for the interface. Commonly used by routing protocols, SNMP queries.
Router (config) #int s0
Router (config-if) #bandwidth
Setting up the physical clock
Router (config-if) #clock rate 64000
Set WAN interface serial encapsulation: In addition to hdlc there is another option, PPP and frame-relay.
Router (config-if) #encapsulation hdlc
Authentication on PPP is optional: Authentication on PPP is optional. This command turns chap on interface, another option is PAP.
Router (config-if) #ppp authentication chap
Choose LMI type. If the LMI type is not properly configured it will be detected automatically.
Router (config-if) # frame-relay lmi-type cisco
Static routing. Static routing types have Administrative Distance (AD) of 1, so it will override any dynamic routing.
Router (config) #ip route 50.0.0.0 255.0.0.0
10.1.2.1
Enables RIP version 1 on all LOCAL interfaces mà có một 10.xxx address: Enable RIP v1 on all LOCAL interfaces with address 10.xxx
Enables RIP version 2: Turn on RIP v2
Router (config) #router rip
Router (config-router) #network 10.0.0.0
Router (config-router) #version 2
Enable router to provide a DHCP service: Set up DHCP on the router.
Router (config) #ip dhcp pool MYPOOL
Router (dhcp-config) #network 10.1.1.0 255.255.255.0
Router (dhcp-config) # default-router 10.1.1.1 Router (dhcp-config) #exit
Router (config) #ip excluded-address dhcp 10.1.1.1 10.1.1.99
Setup config register: Specify the router to do when it starts.
Router (config) # config-register 0x2102
Create sub logic interface under the physical interface.
Enable 802.1q trunking on the interface.
Set IP address.
Router (config) #int fa0 / 0.1
Router (config-subif) #encapsulation dot1Q 1
Router (config-subif) #ip address 10.1.1.1
255.255.255.0
Enabling OSPF on any local interface starts with IP address 10.1.xx
Router (config -) # router ospf 1
Router (config-router) #network 10.1.0.0
0.0.255.255 area 0
EIGRP can be configured in the same way as RIP or use mask options.
Router (config) #router eigrp 1
Router (config-router) #network 172.16.0.0 Or
Router (config-router) # Network 172.16.2.0
0.0.0.255
Set ACL standard. This standard uses numbers from 1 to 99.
Router (config) # access-list 1 permit
172.16.1.1
Set Extended ACL. The first address is the source IP address.
Router (config) # access-list 101 deny tcp host
172.16.1.1 host 172.16.2.1 eq telnet Router (config) # access-list 101 ip permits any any
Dùng bộ lệnh này để attach một giao diện ACL: Use the group command to attach the ACL to the interface.
Router (config) #interface fa0 / 0
Router (config-if) #ip access-group 1 out
An example of using an ACL name instead of a number.
Router (config) #ip access-list extended my_list
Router (config-ext-nacl) # deny tcp host
172.16.1.1 host 172.16.2.1 eq ftp
Router (config-ext-nacl) # ip permit any any
Assign the ACL to the interface by name.
Router (config) #int fa0 / 0
Router (config-if) #ip access-group my_list printed
Configuring a static NAT to allow a server to be accessed via the Internet, using the IP address on interface s0 / 0/1: Configure static NAT to allow server access over the Internet, using the IP address on the interface s0 / 0 /first.
Router (config) #ip nat inside source static
10.1.1.2 interface s0 / 0/1
Defining interface which NAT takes place between: Specifies the interface that NAT happens.
Router (config) #int fa0 / 0.1
Router (config-if) #ip nat inside
Enables RIPng: Turn on RIPng
Router (config) # ipv6 unicast-routing
Router (config) # ipv6 rip ccna router
Router (config) #int s0 / 0/0
Router (config-if) # ipv6 rip ccna enable
Privilege Commands on the Switch
Describe
Order
Turn on the setup dialog box automatically when the device starts without configuration.
Switch # setup
Displays the held config in DRAM. Có không có nếu không sao lưu chạy câu lệnh start không được dùng: Show configuration saved in DRAM. This configuration is lost when the command not copy run start is not used.
Switch # show running-config
Displays the NVRAM (None volatile) config: Displays NVRAM configuration.
Switch # show startup-config
Saves the config: Save the configuration, without this command all changes and configuration will be lost.
Switch # copy running-config startup-config
Lưu hành chạy config để một TFTP server: Save the configuration running into the TFTP server.
Switch # copy running-config tftp
Copies IOS files to a TFTP server: Copy the IOS file to the TFTP server.
Switch # copy flash tftp
Copies files from a TFTP server the flash device: Copy files from TFTP to the flash device.
Switch # copy tftp flash
Erase the config held in NVRAM: Delete the configuration saved in VNRAM. If you execute this command with reload, all configuration will be lost.
Switch # erase startup-config
Reboots the device: Restart the switch.
Switch # reload
Sequence abort: Cancel a command, procedure
6
Suspend Telnet Session: Pause telnet session
Press at the same time 6, release all the keys and immediately press x
Show the current sessions: View the current session, which session * is the active session.
Switch # show sessions
Forcible closes a telnet session: Force to close a telnet session.
Switch # disconnect
Set the local device clock: Set the local time for the device. This command is not executed in configuration mode.
Switch # clock set 10:00:00 april 2 2008
Display version IOS along with other useful info: View IOS version and other useful information such as uptime system, register configuration .
Switch # show version
View file contents of flash.
Switch # show flash
See time.
Switch # show clock
See the user currently logged in.
Switch # show users
By default displays the last 10 commands: See the 10 commands used.
Switch # show history
Displays the ARP cache: View ARP cache.
Switch # show arp
Displays the spanning tree status on 1 vlan: View the state of spanning tree on vlan 1.
Switch # show spanning-tree vlan 1
Lists all the configured vlans: List all configured vlan.
Switch # show vlan
Displays VTP info such as VTP mode, VTP domain, VTP counter: View VTP information such as mode, domain, counter.
Switch # sh vtp status
Ping selected address: Ping an IP address.
Switch # ping 10.1.1.1
Extended ping: Must be executed in privilege mode.
Switch # ping
Display the status interface: Displays the interface status.
Switch # show int fa0 / 1
Hiển thị trạng thái vlan và địa chỉ IP địa chỉ IP (thường sự quản lý vlan): See VLAN 1 status.
Switch # show interfaces vlan 1
Displays a list of CDP neighbors: See CDP list.
Switch # show cdp neighbors
Extended information on the above: See more information than the above command.
Switch # show cdp neighbors details
Display CDP packets as they arrive: See CDP packages when they arrive.
Switch # debug cdp packets
Display ping packets as they arrive: Displays ping packets when they arrive.
Switch # debug icmp packets
Display MAC Addresses table switch. Entries are from the source address in the Ethernet frames: See the MAC address table, taken from the source MAC address in the Ethernet frame.
Switch # show mac address-table
Request
Cisco command
Enter privileged mode
enable
Return to user mode from privileged
disable
Exit the router
logout / exit / quit
See the router version
Router # show version
View current configuration (DRAM)
Router # show running-config
See startup configuration (NVRAM)
Router # show startup-config
See the capacity of IOS file, flash
Router # show flash
View all recorded router logs.
Router # show log
See interface status of interface e0
Router # show interface e0
Hiển thị thiết bị xác thực giao diện và IP địa chỉ giao diện cho các giao dịch: See operating status of interface and IP address for all router interfaces.
Router # show ip interface brief
See cable type on s0
Router # show controllers 0
See connected cdp devices
Router # show cdp neighbor
See detailed information on all devices
Router # show cdp entry *
Displays all the routing protocols: See all configured routing protocols.
Router # show ip protocols
Displays the IP routeing table: Displays IP routing tables.
Router # show ip route
Show access list
Router # show access-lists
See which routers see the ISDN switch
Router # show isdn status
Displays the NAT translations: See the NET translation.
Router # show ip nat translations
View physical cable configuration:
DTE / DCE, x.21, V.35,
RS232
Router # show controllers s 0
Displays the end-to-end status: Displays end-to-end status
Router # show frame-relay pvc
Displays the type of LMI and the number LMI frames: See LMI type and LMI frame number.
Router # show frame-relay lmi
Hiển thị một số hiệu đối số đối tượng bracket ARP table: Show frame frame relay inverse ARP.
Router # show frame-relay map
See the list of ospf neighbors and their status
Router # show ip ospf neighbor
See the status of ospf interface.
Router # show ip ospf interface
View the list of neighbor eigrp and their status.
Router # show ip eigrp neighbor
See interface status EIGRP.
Router # show ip eigrp interface
View all trunk ports on the device
Router # show interface trunk
ping IPv6
Router # ping 2000: 1000: 500: 3 :: 1
undebug all
See also: CCNP_BCMSN Lab: Trunk Configuration