Troubleshooting Network Problems
Troubleshooting Network Problems
Troubleshooting Network Problems
Trunk Creation
S1(config)# interface gi1/1 (select port for trunking)
S1(config-if)# switchport trunk encapsulation dot1q (NOTE: on Layer 3 switch only)
S1(config-if)# switchport mode trunk (set the port to be in trunk mode)
S1(config-if)# switchport trunk native vlan 99 (set VLAN 99 to carry native traffic)
S1(config-if)# switchport trunk allowed vlan 1,10,20,99 (optional – which VLANs are
permitted to go across this trunk. Don’t forget to include VLAN 1 and the native
VLAN)
Router-on-a-Stick Configuration
R1(config)# interface Fa0/0 (select the main interface)
R1(config-if)# no ip address (there should not be any IP Address on the main
interface)
R1(config-if)# interface Fa0/0.10 (create a sub-interface – the number can be
anything)
R1(config-if)# encapsulation dot1q 10 (use 802.1Q trunking; assign to this VLAN #)
R1(config-if)# ip address 172.16.10.1 255.255.255.255 (define the default-gateway
IP)
R1(config-if)# interface Fa0/0.99 (create another sub-interface - this one for native
traffic)
R1(config-if)# encapsulation dot1q 99 native (802.1Q trunking; VLAN #; and native)
(NOTE: No IP address unless workstations or management interfaces are on this
VLAN)
R1(config)# ip classless (classless routing behavior – default in IOS 11.3+)
R1(config)# no ip classless (classful routing behavior)
Etherchannel (PortChannel)
Spanning Tree
S1(config)# spanning-tree mode pvst (configure for PVST – Default)
S1(config)# spanning-tree mode rapid-pvst (configure this switch for rapid PVST)
S1(config)# spanning-tree vlan 10,20 root primary (make root bridge for these
VLANs)
S1(config)# spanning-tree vlan 10 root secondary (make secondary root bridge for
VLAN)
S1(config)# spanning-tree vlan 10 priority 8192 (set the BID priority to 8192 in this
VLAN)
S1(config)# spanning-tree portfast default (default Portfast on all interfaces in this
switch)
S1(config)# interface range fa0/10 – 20 (must be configured as Access ports for
Portfast)
S1(config-if)# spanning-tree portfast (set interfaces for Portfast)
S1(config-if)# spanning-tree bpduguard enable (disables interface if it receives a
BPDU)
S1(config)# interface fa0/1 (select a port to set STP port priority)
S1(config-if)# spanning-tree vlan 10 port-priority 16 (set port priority to 16; default
is 128)
S1# show spanning-tree (see spanning-tree status on a VLAN-by-VLAN basis)
S1# show spanning-tree vlan 10 (see detail spanning-tree information for VLAN 10)
S1# show spanning-tree summary (among other things, see if this is the root bridge)
S1# show spanning-tree blockedports (see which ports are in STP blocking status)
S1# show spanning-tree root (see which BID is root on a VLAN-by-VLAN basis)
Security Practices
Basics
R1(config)# service password-encryption (encrypt all passwords (except ‘secret’)
R1(config)# security password min-length 8 (set minimum 8 character passwords)
R1(config)# login block-for 120 attempts 3 within 60 (block for 2 minutes if more
than 3
failed logins within 60 seconds)
SSH Configuration
Router(config)# hostname R1 (must change the name of the device from the
default)
R1(config)# username Bob password Let-me-in! (configure a local user and
password)
R1(config)# ip domain-name ANYTHING.COM (must set for crypto-key generation)
R1(config)# crypto key generate rsa (make an encryption key - select 1024 bits)
R1(config)# ip ssh version 2 (configure for SSH version 2)
R1(config)# line vty 0 15 (change parameters for remote access)
R1(config-line)# login local (select to authenticate against usernames in this
device)
R1(config-line)# transport input ssh (only allow SSH for remote management)
IP DHCP Snooping
R1(config)# ip dhcp snooping (globally enable DHCP snooping)
R1(config-if)# ip dhcp snooping trust (interface with DHCP server)
> If PAP, the username and password must match the sent-username and password
from other router.
> If CHAP, the username must be the hostname of the other router and the
passwords
must be the same in each routers username configuration.
R1(config)# interface serial 0/0/0 (select the interface for ppp configuration)
R1(config-if)# encapsulation ppp (set interface to PPP)
R1(config-if)# compress [predictor / stac] (optional-configure data compression)
R1(config-if)# ppp quality [percentage] (optional-set a threshold of throughput
before the
R1(config-if)# ppp authentication pap (optional-configure for PAP authentication)
R1(config-if)# ppp pap sent-username R-1 password PASSWORD (if PAP is used, this
must be configured)
R1(config-if)# ppp authentication chap (optional-configure for CHAP
authentication)
R1(config-if)# ppp multilink (optional-combine multiple PPP links for more
bandwidth)
R1(config-if)# encapsulation hdlc (reset the interface to the default value of HDLC)
-There are two basic types of Frame-Relay configuration: Point-to-Point and Multi-
Point.
-A Point-to-Point link involves a single IP subnet and one DLCI. It may be configured
directly on the physical interface or may be done as a sub-interface.
Time-Based ACL
R-1(config)# time-range MON-WED-FRI
R-1(config-time-range)# periodic Monday Wednesday Friday 8:00 to 17:00
R-1(config)# access-list 133 permit tcp 192.168.20.0 0.0.0.255 any
eq telnet time-range MON-WED-FRI
R-1# show access-list (see access lists on this router and # of ‘matches’ per line)
R-1# show access-list NAME (see a specific access list and # of ‘matches’ per line)
-Dynamic NAT may use a pool of ‘outside addresses’. If you do not use a pool, you
will have to use the address on the outside interface. You can use ‘netmask’:
R-1(config)# ip nat inside source list NAT-ELIGIBLE interface serial 0/0/0 overload
R-1# show ip nat translations (current translations- dynamic and static)
R-1# show ip nat statistics (see # of active translations, role of interfaces, etc)