Cisco routing Cisco Router common command summary:

Summary of common commands for Cisco routers :

1. Router password setting:

  1. router>enable enter privileged mode
  2. router#config terminal Enter global configuration mode
  3. router(config)#hostname Set the hostname of the switch
  4. router(config)#enable secret xxx Set privileged encrypted password
  5. router(config)#enable password xxb Set privileged non-secret password
  6. router(config)#line console 0 Enter the console port
  7. router(config-line)#line vty 0 4 enter the virtual terminal
  8. router(config-line)#login requires password verification
  9. router(config-line)#password xx Set login password xx
  10. router(config)#(Ctrl+z) Return to privileged mode
  11. router#exit return command

2. Router configuration:

  1. router(config)#int s0/0 enter Serail interface
  2. router(config-if)#no shutdown activate current interface
  3. router(config-if)#clock rate 64000 set synchronous clock
  4. router(config-if)#ip address Set IP address
  5. router (config-if) #ip address second Set the second IP
  6. router(config-if)#int f0/0.1 enter subinterface
  7. router(config-subif.1)#ip address Set sub-interface IP
  8. router(config-subif.1)#encapsulation dot1q bind vlan trunk protocol
  9. router(config)#config-register 0x2142 skip configuration file
  10. router(config)#config-register 0x2102 normal use configuration file
  11. router#reload Reboot

3. Router file operation:

  1. router#copy running-config startup-config save-deployment
  2. router#copy running-config tftp save configuration to tftp
  3. router#copy startup-config tftp save startup configuration to tftp
  4. router#copy tftp flash: download files to flash
  5. router#copy tftp startup-config Download configuration file
  6. ROM status:
  7. Ctrl+Break Enter ROM monitoring state
  8. rommon>confreg 0x2142 skip configuration file
  9. rommon>confreg 0x2102 restore configuration file
  10. rommon>reset reboot
  11. rommon>copy xmodem: flash: transfer files from console
  12. rommon>IP_ADDRESS=10.65.1.2 Set router IP
  13. rommon>IP_SUBNET_MASK=255.255.0.0 Set router mask
  14. rommon>TFTP_SERVER=10.65.1.1 Specify TFTP server IP
  15. rommon>TFTP_FILE=c2600.bin specifies the downloaded file
  16. rommon>tftpdnld download from tftp
  17. rommon>dir flash: view flash contents
  18. rommon>boot guide IOS

4. Static routing:

  1. ip route command format
  2. router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 Static routing example
  3. router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 Example of default route

5. Dynamic routing:

  1. router(config)#ip routing start routing forwarding
  2. router(config)#router rip Start the RIP routing protocol.
  3. router(config-router)#network set the publishing route
  4. router(config-router)#negihbor For point-to-point frame relay.

6. Frame relay command:

  1. router(config)#frame-relay switching Enable frame relay switching
  2. router(config-s0)#encapsulation frame-relay enable frame relay
  3. router(config-s0)#fram-relay lmi-type cisco Set management type
  4. router (config-s0) #frame-relay intf-type DCE set to DCE
  5. router(config-s0)#frame-relay dlci 16
  6. router(config-s0)#frame-relay local-dlci 20 set virtual circuit number
  7. router(config-s0)#frame-relay interface-dlci 16
  8. router(config)#log-adjacency-changes record adjacency changes
  9. router(config)#int s0/0.1 point-to-point set sub-interface point-to-point
  10. router#show frame pvc show permanent virtual circuit
  11. router#show frame map show frame map

7. Basic access control list:

  1. router(config)#access-list permit|deny
  2. router(config)#interface ;default:deny any
  3. router(config-if)#ip access-group in|out ;defaultut

      Example 1:

  1. router(config)#access-list 1 deny host 10.65.1.1
  2. router(config)#access-list 1 permit any
  3. router(config)#int f0/0
  4. router(config-if)#ip access-group 4 in

       Example 2:

  1. router(config)#access-list 4 permit 10.8.1.1
  2. router(config)#access-list 4 deny 10.8.1.0 0.0.0.255
  3. router(config)#access-list 4 permit 10.8.0.0 0.0.255.255
  4. router(config)#access-list 4 deny 10.0.0.0 0.255.255.255
  5. router(config)#access-list 4 permit any
  6. router(config)#int f0/1
  7. router(config-if)#ip access-group 4 in
  8. Extended access control list:
  9. access-list permit|deny icmp [type]
  10. access-list permit|deny tcp [port]

      Example 1:

  1. router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
  2. router(config)#access-list 101 permit ip any any
  3. router(config)#int s0/0
  4. router(config-if)#ip access-group 101 in

       Example 2:

  1. router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
  2. router(config)#access-list 102 permit ip any any
  3. router(config)#interface s0/1
  4. router(config-if)#ip access-group 102 out
  5. Delete the access control example table:
  6. router(config)#no access-list 102
  7. router(config-if)#no ip access-group 101 in
  8. router nat configuration
  9. Router(config-if)#ip nat inside The current interface is designated as the internal interface
  10. Router(config-if)#ip nat outside The current interface is designated as the outside interface
  11. Router(config)#ip nat inside source static [p] <private IP>< public IP > [port]
  12. Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1
  13. Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80
  14. Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0
  15. Router(config)#ip nat inside source list 1 pool p1
  16. Router(config)#ip nat inside destination list 2 pool p2
  17. Router(config)#ip nat inside source list 2 interface s0/0 overload
  18. Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
  19. Router#show ip nat translation
  20. The rotary parameter means rotation, the IP in the address pool matches the address assigned by NAT in turn.
  21. The overload parameter is used for PAT to map the internal IP to a port with a different public IP.
  22. Exterior Gateway Protocol Configuration
  23. routerA(config)#router bgp 100
  24. routerA(config-router)#network 19.0.0.0
  25. routerA(config-router)#neighbor 8.1.1.2 remote-as 200
  26. Configure PPP authentication:
  27. RouterA(config)#username password
  28. RouterA(config)#int s0
  29. RouterA(config-if)#ppp authentication {chap|pap}

8. The sub-interface of the router is encapsulated as 8021Q (Supplementary)

Encapsulation .1Q,2是子接口号标识,这里是示范,可以随意设置。

Guess you like

Origin blog.csdn.net/hu5566798/article/details/130054587