1. Commands supported by the switch:
Switch Basic Status:
Switch:; ROM state, router is rommon>
hostname>; user mode
hostname#; privileged mode
Hostname (config) #; global configuration mode
Hostname (CONFIG-IF) #; interface State
Switch Password settings:
switch>enable; access to privileged mode
Switch#config terminal; Enter global configuration mode
Switch (config) #hostname;
Switch (config) #enable secret xxx; set privileged encryption password
Switch (config) #enable password xxa; set privileged non-secret password
Switch (config) #line console 0; Enter the console port
Switch (config-line) #line vty 0 4; Enter virtual terminal
Switch (config-line) #login; Allow logon
Switch (config-line) #password xx; set Login password xx
switch#exit; return command
Switch VLAN settings:
Switch#vlan database; Enter VLAN settings
Switch (VLAN) #vlan 2; Build VLAN 2
Switch (VLAN) #no VLAN 2; Delete VLAN 2
Switch (config) #int f0/1; Enter Port 1
Switch (config-if) #switchport access VLAN 2; When the front port joins VLAN 2
Switch (config-if) #switchport mode trunk; set to trunk
Switch (config-if) #switchport trunk allowed VLAN 1,2; set allowed VLANs
Switch (config-if) #switchport trunk encap dot1q; set up VLAN relay
Switch (config) #vtp domain; set the VTP name
Switch (config) #vtp password; set VTP password
Switch (config) #vtp mode server; set up hair VTP modes
Switch (config) #vtp mode client; set up the Send VTP pattern
Switch set IP address:
Switch (config) #interface vlan 1; Enter VLAN 1
Switch (config-if) #ip address; Set IP addresses
Switch (config) #ip default-gateway; Set default gateway
Switch#dir flash:; View Flash
Switch Display command:
Switch#write; Save configuration information
Switch#show VTP; View VTP configuration information
Switch#show run; View current configuration information
Switch#show VLAN; View VLAN configuration information
Switch#show interface; View port information
switch#show int f0/0; View specified port information
2. Commands supported by routers:
Router Display command:
Router#show run; Display configuration information
Router#show interface; Display interface information
Router#show IP route, displaying routing information
Router#show CDP nei; show neighbor information
Router#reload; restart
Router Password settings:
router>enable; access to privileged mode
Router#config terminal; Enter global configuration mode
Router (config) #hostname; set the host name of the switch
Router (config) #enable secret xxx; set privileged encryption password
Router (config) #enable password xxb; set privileged non-secret password
Router (config) #line console 0; Enter the console port
Router (config-line) #line vty 0 4; Enter virtual terminal
Router (config-line) #login; password Authentication required
Router (config-line) #password xx; set Login password xx
Router (config) # (CTRL+Z), returning privileged mode
router#exit; return command
Router configuration:
Router (config) #int s0/0; Enter Serail interface
Router (config-if) #no shutdown; activating the current interface
Router (config-if) #clock rate 64000; set Sync clock
Router (config-if) #ip address; Set IP addresses
Router (config-if) #ip address second; set a second IP
Router (config-if) #int f0/0.1; Enter Sub-interface
Router (CONFIG-SUBIF.1) #ip address; set Sub-interface IP
Router (CONFIG-SUBIF.1) #encapsulation dot1q; Bind VLAN Relay protocol
Router (config) #config-register 0x2142; skip configuration file
Router (config) #config-register 0x2102, normal use of configuration files
Router#reload; re-boot
Router file operations:
Router#copy running-config startup-config; Save configuration
Router#copy running-config tftp; save configuration to TFTP
Router#copy startup-config tftp; boot configuration save to TFTP
Router#copy tftp flash:; Send files to Flash
router#copy tftp startup-config; Download configuration file
Rom Status:
ctrl+break; Enter ROM monitoring status
Rommon>confreg 0x2142; Skip configuration file
Rommon>confreg 0x2102; Restore configuration file
Rommon>reset; re-boot
Rommon>copy xmodem:flash:; transfer files from console
rommon>ip_address=10.65.1.2; set Router IP
rommon>ip_subnet_mask=255.255.0.0; setting the router mask
rommon>tftp_server=10.65.1.1; Specify the TFTP server IP
Rommon>tftp_file=c2600.bin; Specify the downloaded file
rommon>tftpdnld; Download from tftp
Rommon>dir flash:; View Flash content
rommon>boot; boot iOS
Static routes:
IP route; command format
Router (config) #ip route 2.0.0.0 255.0.0.0 1.1.1.2; Static Route example
Router (config) #ip Route 0.0.0.0 0.0.0.0 1.1.1.2; default Route Example
Dynamic routing:
Router (config) #ip routing; Start routing forwarding
Router (config) #router rip; start the RIP routing protocol.
Router (config-router) #network; setting up a publishing route
Router (config-router) #negihbor, point to point Frame Relay.
Frame Relay Command:
Router (config) #frame-relay switching; enabling Frame Relay switching
Router (config-s0) #encapsulation frame-relay; enabling Frame Relay
Router (config-s0) #fram-relay lmi-type Cisco; setting Management type
Router (config-s0) #frame-relay intf-type DCE; set to DCE
Router (config-s0) #frame-relay DLCI 16;
Router (config-s0) #frame-relay LOCAL-DLCI 20; Set Virtual circuit number
Router (config-s0) #frame-relay Interface-dlci 16;
Router (config) #log-adjacency-changes; record adjacency changes
Router (config) #int s0/0.1 Point-to-Point; Set sub-interface point to Point
Router#show frame PVC; Display permanent virtual circuit
Router#show frame map; display mappings
Basic Access Control List:
Router (config) #access-list permit|deny
Router (config) #interface; Default:deny any
Router (config-if) #ip access-group in|out; default:ut
Example 1:
Extended access Control list: Access-list permit|deny ICMP wild>[type]access-list permit|deny TCP Wild>[port] example 3:router (config) # Access-list ' deny ICMP any 10.64.0.2 0.0.0.0 echorouter (config) #access-list-Permit ip any Anyrouter (config) #int s0/ 0router (config-if) #ip access-group in case 3:router (config) #access-list 102 deny TCP any 10.65.0.2 0.0.0.0 eq 80router (con FIG) #access-list 102 Permit ip any Anyrouter (config) #interface s0/1router (config-if) #ip Access-group 102 out
To delete an Access control example table:
Router (config) #no access-list 102
Router (config-if) #no IP access-group
NAT configuration for Routers
Router (config-if) #ip nat inside; The current interface is specified as an internal interface
Router (config-if) #ip Nat outside; The current interface is specified as an external interface
Router (config) #ip nat inside source static [P] < private ip>< public network ip> [Port]
Router (config) #ip nat inside source static 10.65.1.2 60.1.1.1
Router (config) #ip nat inside source static TCP 10.65.1.3 80 60.1.1.1 80
Router (config) #ip nat pool P1 60.1.1.1 60.1.1.20 255.255.255.0
Router (config) #ip nat inside source list 1 pool P1
Router (config) #ip nat inside Destination List 2 pool P2
Router (config) #ip nat inside source List 2 interface s0/0 overload
Router (config) #ip nat pool P2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
The Router#show IP nat translationrotary parameter is meant to be rotated, and IP rotation in the address pool matches the address of the NAT assignment. The overload parameter is used for Pat to map the internal IP to a different port on a public network IP.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.