Detailed explanation of Cisco router switch configuration commands

Source: Internet
Author: User

1. commands supported by the vswitch:
Vswitch basic status: switch:; ROM status, vrommon>
Hostname>; User Mode
Hostname #; privileged Mode
Hostname (config) #; global configuration mode
Hostname (config-if) #; interface status
Switch password settings: switch> enable; enter privileged Mode
Switch # config terminal; enter global configuration mode
Switch (config) # hostname; set the Host Name of the switch.
Switch (config) # enable secret xxx; set the privileged encryption Password
Switch (config) # enable password xxa; set the privileged non-password
Switch (config) # line console 0; enter the console Port
Switch (config-line) # line vty 0 4; enter the virtual terminal
Switch (config-line) # login; Allow Logon
Switch (config-line) # password xx; set the logon password xx
Switch # exit; return command
Switch VLAN settings:
Switch # vlan database; go to VLAN settings
Switch (vlan) # vlan 2; Create 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; Add vlan 2 to the current port
Switch (config-if) # switchport mode trunk; set to trunk Line
Switch (config-if) # switchport trunk allowed vlan 1 and 2; set the allowed vlan
Switch (config-if) # switchport trunk encap dot1q; Set vlan Relay
Switch (config) # vtp domain; set the vtp domain name to be sent
Switch (config) # vtp password; set the vtp password
Switch (config) # vtp mode server; Set vtp mode
Switch (config) # vtp mode client; Set vtp mode
Vswitch IP Address:
Switch (config) # interface vlan 1; enter vlan 1
Switch (config-if) # ip address; set the ip address
Switch (config) # ip default-gateway; set the 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 the specified port information
2. commands supported by routers:
Vro display command:
Router # show run; displays configuration information
Router # show interface; display interface information
Router # show ip route; displays route information
Router # show cdp nei; displays neighbor Information
Router # reload; restart
Vro password settings:
Router> enable; enter privileged Mode
Router # config terminal; enter global configuration mode
Router (config) # hostname; set the vswitch Host Name
Router (config) # enable secret xxx; set the privileged encryption Password
Router (config) # enable password xxb; set a privileged non-password
Router (config) # line console 0; enter the console Port
Router (config-line) # line vty 0 4; enter the virtual terminal
Router (config-line) # login; password verification required
Router (config-line) # password xx; set the logon password xx
Router (config) # (Ctrl + z); returns the privileged Mode
Router # exit; return command
Vro Configuration:
Router (config) # int s0/0; enter the Serail Interface
Router (config-if) # no shutdown; activate the current interface
Router (config-if) # clock rate 64000; set the synchronization clock
Router (config-if) # ip address; set the ip address
Router (config-if) # ip address second; set the second IP address
Router (config-if) # int f0/0.1;
Router (config-subif.1) # ip address; sets the subinterface IP
Router (config-subif.1) # encapsulation dot1q; Bind vlan relay Protocol
Router (config) # config-register 0x2142; skip the configuration file
Router (config) # config-register 0x2102; Use the configuration file normally
Router # reload; reboot
Vro file operations:
Router # copy running-config startup-config; Save the Configuration
Router # copy running-config tftp; Save the configuration to tftp
Router # copy startup-config tftp; the boot configuration is saved to tftp
Router # copy tftp flash:; upload files to flash
Router # copy tftp startup-config; download the configuration file
ROM status:
Ctrl + Break; enters ROM monitoring status
Rommon> confreg 0x2142; Skip configuration file
Rommon> confreg 0x2102; restore the configuration file
Rommon> reset; reboot
Rommon> copy xmodem: flash:; transfers files from the console
Rommon> IP_ADDRESS = 10.65.1.2; set the router IP Address
Rommon> IP_SUBNET_MASK = 255.255.0.0; set the router mask
Rommon> TFTP_SERVER = 10.65.1.1; specifies the IP address of the TFTP server.
Rommon> TFTP_FILE = c2600.bin; specifies the downloaded file
Rommon> tftpdnld; download from tftp
Rommon> dir flash:; view flash Content
Rommon> boot; boot IOS
Static Routing:
Ip route; Command Format
Router (config) # ip route 2.0.0.0 255.0.0.0 1.1.1.2; Static Routing 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 route forwarding
Router (config) # router rip; start the RIP routing protocol.
Router (config-router) # network; Set publish route
Router (config-router) # negihbor; used for point-to-point frame relay.
Frame Relay command:
Router (config) # frame-relay switching; Enable frame relay switching
Router (config-s0) # encapsulation frame-relay; enables frame relay
Router (config-s0) # fram-relay lm-type cisco; set the 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; sets the virtual circuit number
Router (config-s0) # frame-relay interface-dlci 16;
Router (config) # log-adjacency-changes; record the adjacent 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 ing
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: out
Example 1:
Router (config) # access-list 4 permit 10.8.1.1
Router (config) # access-list 4 deny 10.8.1.0 0.0.255
Router (config) # access-list 4 permit 10.8.0.0 0.0.255.255
Router (config) # access-list 4 deny 10.0.0.0 0.20.255.255
Router (config) # access-list 4 permit any
Router (config) # int f0/0
Router (config-if) # ip access-group 4 in


Extended access control list:
Access-list permit | deny icmp
Wild> [type]
Access-list permit | deny tcp
Wild> [port]
Example 2:
Router (config) # access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
Router (config) # access-list 101 permit ip any
Router (config) # int s0/0
Router (config-if) # ip access-group 101 in
Example 3:
Router (config) # access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
Router (config) # access-list 102 permit ip any
Router (config) # interface s0/1
Router (config-if) # ip access-group 102 out

Delete an access control instance table:
Router (config) # no accesskey-list 102
Router (config-if) # no ip access-group 101 in
Nat configuration of the vro
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 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
Router # show ip nat translation
The rotary parameter indicates that the IP address in the address pool matches the NAT address in turn.
The overload parameter is used by PAT to map an internal IP address to a port with a different public IP address.

External Gateway Protocol Configuration:
Routeconfig # router bgp 100
Routeconfig-router # network 19.0.0.0
Routeconfig-router # neighbor 8.1.1.2 remote-as 200
Configure PPP Verification:
Routeconfig # username password
Routeconfig # int s0
Routeconfig-if # ppp authentication {chap | pap}
3. PIX Firewall commands
Pix525 (config) # nameif ethernet0 outside security0; naming interface and level
Pix525 (config) # interface ethernet0 auto; set the interface Method
Pix525 (config) # interface ethernet1 100 full; set the interface mode
Pix525 (config) # interface ethernet1 100 full shutdown
Pix525 (config) # ip address inside 192.168.0.1 255.255.255.0
Pix525 (config) # ip address outside 133.0.0.1 255.255.255.252 Pix525 (config) # global (if_name) natid ip-ip; defines the public IP address range
Pix525 (config) # global (outside) 1 7.0.0.1-7.0.0.15; example
Pix525 (config) # global (outside) 1 133.0.0.1; example
Pix525 (config) # no global (outside) 1 133.0.0.1; remove the setting Pix525 (config) # nat (if_name) nat_id local_ip [netmark]
Pix525 (config) # nat (inside) 1 0 0
All Intranet hosts (0 represents 0.0.0.0) can access the Internet specified by global 1.
Pix525 (config) # nat (inside) 1 172.16.5.0 255.255.255.0.0
Hosts With CIDR blocks 172.16.5.0/16 can access the Internet specified by global 1. Pix525 (config) # route if_name 0 0 gateway_ip [metric]; Command Format
Pix525 (config) # route outside 0 0 133.0.0.1 1; example
Pix525 (config) # route inside 10.1.0.0 255.255.0.0 10.8.0.1 1; example: Pix525 (config) # static (inside, outside) 133.0.0.1 192.168.0.8
The internal IP address 192.168.0.8 is translated into a global address 133.0.0.1 during external access. Pix525 (config) # static (dmz, outside) 133.0.0.1 172.16.0.8
The IP address of the intermediate region 172.16.0.8 is translated into a global address 133.0.0.1 when accessing the external region.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.