Configuration and Troubleshooting Commands

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Basic Router Configuration Command

Naming the router


Router(config)# hostname <name>

Setting password
Router(config)# enable secret <password>

Router(config)# line console 0


Router(config-line) #password <password>
Router(config-line) # login

Router(config)# line vty 0 4


Router(config-line) #password <password>
Router(config-line) # login

Configuring an interface
Router(config)#interface <type> <number>
Router(config-if) # ip address <ip address> <subnet mask>
Router(config-if) # description < description>
Router(config-if) # no shutdown

Saving changing
Router # copy running-config startup-config

Router # show running-config


Router # show ip route
Router # show ip interface brief
Router # show interface

Router(config)# banner motd #message#

Static routes and redistribution

Static Routes
Router(config)# ip route <dest-network> <subnet mask> <next-hop-address>/<exit-interface>

Redistribution
Router(config)#ip default-network <network-address>
Router(config-router) #default-information originate
Router(config-router)#redistribute static

Routing Protocols

OSPF
Router(config)# router ospf <process-ID>
Router(config-router)# network <address> <wildcard-mask> area <area-ID>

Router(config-if)# ip ospf priority <number>


Router(config-if)# ip ospf cost <number>
Router(config-if)# ip ospf hello-interval <seconds>
Router(config-if)# ip ospf dead-interval <seconds>

Router(config-if)#ip ospf message-digest-key <key-id> md5 <encryption-type> <password>


Router(config-router)#area <area-ID> authentication <message-digest>

EIGRP
Router(config)# router eigrp <AS-number>
Router(config-router)# network <network-address>

Router(config-router)#no auto-summary
Access Control Lists (ACL)
Standard
Router(config)# access-list <1-99> permit/deny <source-address> <wildcard-mask>

Extended
Router(config)# access-list <100-199> <protocol> permit/deny <source-address> <wildcard-mask> <dest-
address> <wildcard-mask> <port>

Router(config-if)#ip access-group <number> in/out

Switch configuration

Management VLAN and default gateway


Switch(config)#interface VLAN1
Switch(config-if) #ip address <address> <subnet mask>

Switch(config)#ip default-gateway <address>

Switch(config)#mac-address-table static <mac-address> > vlan <vlan name> interface fastEthernet


<number

Switch(config-if)# switchport mode access


Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security mac-address sticky
Switch(config-if)# switchport port-security maximum <number>

Create VLANs
Switch#vlan database
Switch(vlan)#vlan <vlan-number> name <vlan-name>
Switch(vlan)#exit

Assigning ports to VLANs


Switch (config)#interface <type> <number>
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan <vlan-number>

VTP
Switch#vlan database
Switch(vlan)#vtp <server/client>
Switch(vlan)#vtp domain <domain-name>
Switch(vlan)#exit

Trunk
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk encapsulation <type>

Routing between VLANs


Router(config)#interface FastEthernet <number>
Router(config-if)#no shutdown
Router(config)#interface FastEthernet 0/0.<sub-interface number>
Router(config-subif)#encapsulation <type> <vlan-number>
Router(config-subif)#ip address <address> <subnet mask>

IP addressing

Network Address Translation (NAT)


Router(config)# ip nat inside source static <local address> <global address>
Router(config)# ip nat pool <name> <start address> <end address> netmask <subnetmask>
Router(config)# ip nat inside source list <acl number> pool <name>
Router(config-if)# ip nat inside/outside

Port Address Translation (PAT)


Router(config)# ip nat inside source list <acl number> interface <interface> <number> overload
Router(config)# ip nat inside source list <acl number> pool <name> overload
DHCP
Router(config)#ip dhcp pool <name>
Router(dhcp-config)#network <address> <subnet mask>
Router(dhcp-config)#default-router <address>
Router(dhcp-config)#domain-name <name>
Router(dhcp-config)#dns-server <address>
Router(dhcp-config)#netbios-name-server <address>

Router(config)#ip dhcp excluded-address <address> <end address-range>

Router(config-if)#ip helper-address <address>

Point-to-Point Protocol (PPP)


Router(config-if)#encapsulation ppp
Router(config)#username <remote-router-name> password <password>
Router(config)#ppp authentication <type>
Troubleshooting commands OSPF
Show ip ospf border-routers
show interfaces Show ip route ospf
show interface status Show ip route
show ip interface brief Show ip route summary
Show int faE 0/0 Show ip route [ip-address]
Show interfaces description Show ip protocols
Show run | begin ospf
VTP Show ip ospf neighbor
Show vtp status To verify VTP Show ip ospf interface brief
Show ip ospf database
TRUNK and Etherchannel Debug ip ospf packets
Show interfaces trunk Debug ip ospf adjacencies
Show etherchannel summary Debug ip ospf events
Show etherchannel load-balance Show run | begin ospf 1
Show ip ospf int vlan [vlan-nbr]
VLAN Show ip ospf database external
Show vlan Show ip ospf database summary [subnet]
Show vlan [brief] Show ip ospf database asbr-summary [router-id]
Show vlan private-vlan Show ip ospf virtual-links
Show running-config int vlan [vlan nbr] Show ip ospf database router adv-router [ip-address]
Show vlan id [vlan nbr] Debug ip routing

STP RIP
Show spanning-tree Show ip rip database
Show spanning-tree summary Show ip protocols
Show spanning-tree vlan [vlan-nbr]
Show spanning-tree inconsistentports EIGRP
Show spanning-tree root Show ip route eigrp
Show run | include spanning-tree Show ip route
Show spanning-tree mst configuration Show ip eigrp interface
Debug eigrp packtes
Inter-VLAN routing Show ip eigrp topology
Show ip int brief Debug ip eigrp [AS/summary
Show vlans Show ip eigrp interface detail]
Show ip route Show ip eigrp neighbors
show ip cef Show ip eigrp detail
show ip int vlan [vlan-nbr] show run | begin key chain
show ip cef summary show key chain
show ip cef detail Show running-config | begin key
Show adjacency faE 0/0 detail
HSRP Debug eigrp packets hello
Show standby
Show standby brief BGP
Show standby vlan [vlan nbr] Show ip bgp
Show standby vlan [vlan nbr] brief show ip route
Debug standby packets show ip bgp summary
Show running-config | begin standby show ip bgp neighbors
debug ip bgp
Port Security show run | begin bgp
Show port-security int fa 0/0 show ip bgp [network address] [mask]
debug ip tcp transactions
QOS clear ip bgp *
Show mls qos int fa 0/0 show ip bgp neighbors [ip-address] routes
Show run int fa 0/0 show ip bgp neighbors [ip-address] advertised-
Show auto qos interfaces routes
Show mls qos int fa 0/0 show ip bgp regexp [reg-exp]
ACL SSH
Show access-lists Show line vty 0 4
Show vlan access-map Show ip ssh
Clear ip access-list counters Show ssh
Show vlan filter Show users
Show access-lists
NAT Show run | begin vty
Show ip nat translations Show run int fa 0/0
Debug ip nat Transport input telnet ssh
Debug ip icmp
Show run | include ip nat NTP
Show ip nat statistics Show ntp associations
Clear ip nat translation * Show ntp status
Clear ip nat statistics * Show clock
Clock set hh:mm:ss
DHCP Show ip inspect interfaces
Show ip dhcp snooping
Show ip int brief
Show ip dhcp bindings show ip inspect sessions
Show ip dhcp server statistics show ip inspect interfaces
Debug ip udp Clear arp-cache
Show ip int fa 0/0 Show arp
Show ip dhcp pool Show cdp neighbors
Debug ip dhcp server events Show cdp neighbor detail
Show run | begin dhcp pool Show mac address-table
Show ip dhcp conflict Show mac address-table address [mac-address]
Debug dhcp detail Show mac address-table interface [int id]
Clear ip dhcp server statistics Show ip cef
Clear ip dhcp conflict * Show ip cef [ip address]
Show ip sockets Ipconfig /release/renew
Debug ip dhcp packets Show logging | include ---

Router Performance IPv6


Show process cpu sorted Show ipv6 interface brief
Show memory statistics Show ipv6 ospf neighbor
Show int fa 0/0 stats Show ipv6 ospf interface
Show ip cef Show ipv6 eigrp neighbor
Show ip int fa 0/0 Show ipv6 route
Show access-list
Show ip protocols Show platform forward
Show ip bgp Show ip interface brief
Show processes cpu history Traceroute [ip address]
Show run | begin eigrp
SLA Show ip protocols
Show ip sla configuration [op-nbr] Debug ip packet
Show ip sla responder Show controllers s 0/0/0
Show ip sla statistics [op-nbr] Debug ip icmp
Show run | section eigrp
AAA
Show run | include aaa
Show radius server-group all
Show radius statistics
Show aaa servers
Debug radius authentication
Show run | include radius-server
Show radius statistics show
aaa method-lists all

You might also like