🦑.fun -

Networking

Networking and Cisco IOS

Table of Contents

Table of Contents        1

Intro        5

Sources        5

Key        5

Cisco Network Design Hierarchy        6

Layers        7

Network Design Fundamentals        8

Models: OSI vs TCP/IP        10

Structure: L3 IPv4 Packets and L2 Ethernet Frames        12

Encapsulation Order        12

L3 IPv4 Packet Header        14

L2 Ethernet Frame        14

IP: Internet Protocol        15

IPv4        15

Classful        15

Classless        15

IPv6        16

TCP: Transmission Control Protocol        19

IOS Software        20

General setup        22

Miscellaneous        23

Types of memory        26

Planes        26

Reset Script        26

Discovery Protocols        28

CDP: Cisco Discovery Protocol        28

LLDP: Link Layer Discovery Protocol        28

ISDP        29

Switching Process        29

L2 Switch Operation        29

L3 (Multiplayer) Switch Operation        30

Cisco Switching Methods        31

VLANs: Virtual Local Area Network        32

Native VLAN        35

PVLAN: Private VLAN        35

Protected Port: “PVLAN Edge”        37

Subinterfaces        38

DTP: Dynamic Trunking Protocol        39

VTP: VLAN Trunking Protocol        39

VTP Pruning        43

802.1D (STP) & 802.1W (RSTP)        43

802.1D/STP Port Costs        46

802.1W / RSTP        47

802.1W / RSTP: Port Roles        47

802.1W / RSTP: Port States        47

802.1W/ RSTP: Port Types        47

STP & RSTP        48

TO DO:        48

PortFast        49

BPDUguard & Filter        49

Port-Channel / EtherChannel        50

PO Creation        53

SPAN: SwitchPort ANalyzer        53

SVI / MLS / L3 switch        54

IP route vs IP Default-Gateway        55

Gateway of Last Resort        55

FHRP: First Hop Redundancy Protocol        55

HSRP: Hot Standby Router Protocol        56

VRRP: Virtual Router Redundancy Protocol        58

GLBP: Gateway Load Balancing Protocol        59

NetFlow        60

Logging        60

SYSLOG        61

KIWI        61

Time Protocols: NTP, SNTP, PTP        62

NTP:        62

SNTP:        66

PTP:        67

DHCP: Dynamic Host Configuration Protocol        67

DHCPv6: Stateless        68

DHCPv6: Stateful        68

IP Helper / Relay        68

End-User        69

DHCP Snooping        69

DNS: Domain Name System        71

DNS Relay        71

Loopback Interface        71

Routing Protocols        72

Bandwidth        73

DV: Split Horizon        74

Route Poisoning        74

RIP: Routing Information Protocol        74

RIPv2        74

RIPng        74

OSPF: Open Shortest Path First        74

OSPFv3: IPv6        81

EIGRP: Enhanced Interior Gateway Routing Protocol        82

EIGRPv6        83

EIGRP: Configure Bandwidth that EIGRP can use        83

EIGRP: Authentication w/ MD5        83

EIGRP: Create a Keychain & Key        84

EIGRP: Configure EIGRP auth using keychain & Key        84

BGP: Border Gateway Protocol        84

ACLs: Access Control Lists        85

ACL: Extended Named        87

ACL: Extended numbered        87

ACL: Standard Named        87

ACL: Standard numbered        87

MACL: MAC ACL        88

PACL        88

VLAM: VLAN Access Map / VACL        89

ACL: IPv6        90

Reflexive ACL        90

NAT : Network Address Translation        92

NAT [fromDoingLab]        92

PAT; from scratch        93

NAT?        93

NAT Static Setup        94

NAT Dynamic Setup        94

IP SLA: Service Level Agreement (and tracking)        94

IP Service Level Agreement        94

Tracking        95

SNMP: Simple Network Management Protocol        95

SNMPv2c        97

SNMPv3        97

GRE Tunnel: Generic Routing Encapsulation Tunnel        98

WANs: Point-to-point Wide Area Networks        100

PPP: Point-to-Point Protocol        103

PPP w/ PAP        104

PPP w/ CHAP        105

MLPPP: Multi-Link PPP        105

Dialer Interface        107

PPPoE: Point-to-Point Protocol over Ethernet        107

PPPoE w/ CHAP        109

WANs: Private        110

Private WANs w/ Ethernet & MPLS        110

Carrier Ethernet / “MetroE”: Metro Ethernet        111

WAN QoS        112

MPLS: Multi Protocol Label Switching VPNs        112

Private WANs w/ Internet VPN        113

Multipoint Internet VPNs using DMVPN        116

HA: High Availability        116

Switch Stacking        117

FlexStack (and FlexStack-Plus)        117

StackWise (and StackWise-Plus)        118

Chassis Aggregation / VSS: Virtual Switching System        119

Supervisor Redundancy Options        121

QoS: Quality of Service        122

QoS: WAN        125

QoS: VoIP        125

Wireless        126

AAA w/ RADIUS & TACACS+        126

IEEE 802.1X & EAPOL        131

Network Security        133

IPSG: IP Source Guard        138

DAI: Dynamic ARP Inspection        139

Port-Security        139

Storm-Control        141

SDN: Software Defined Networking        141

Cloud Computing        143

IOS Upgrade        144

Wireshark        145

TO BE ORGANIZED        145


Intro

I use this to take notes on networking stuff and Cisco things. It is far from perfect, including many formatting inconsistencies, but is a centralized location I can use to reference information, and I am making it better. I started this in early 2015, and moved it to Google Docs sometime after. Feel free to leave suggestions by editing, adding, or removing as you feel is best.

This whole thing is for educational purposes only. Some pictures were from the sourced books, other from the sourced websites. I don’t own them.

Sources

  1. The internet.
  2. https://*.cisco.com/*
  3. http://ciscopress.com/*
  4. https://*.netacad.com/*
  5. http://onfterminal.com/rom-ram-nvram-and-flash-memory-on-cisco-routers/
  6. http://ptgmedia.pearsoncmg.com/images/*
  7. http://apprize.info
  8. http://www.chris-tech.net
  9. https://www.freeccnaworkbook.com
  10. https://www.nesevo.com
  11. https://en.wikipedia.org/*
  12. School.
  13. Work.
  14. Odom, Wendell. CCENT/CCNA ICND1 100-105 official Cert guide. Indianapolis, IN, Cisco Press, 2016.
  15. Odom, Wendell, and Scott Hogg. CCNA Routing and Switching ICND2 200-105 Official Cert Guide. Indianapolis, IN, Cisco Press, 2017.
  16. Froom, Richard, and Erum Frahim. Implementing Cisco IP switched networks (SWITCH): foundation learning guide. Indianapolis, IN, Cisco Press, 2015.
  17. Hucaby, David. CCNP routing and switching SWITCH 300-115: official cert guide. Indianapolis, IN, Cisco Press, 2015.
  18. Other books.

Key


                                Cisco Network Design Hierarchy

Layers

Network Design Fundamentals

Service Type

Service (server) Location to user

Extent of Traffic Flow

Local

Same VLAN(segment) (as user)

Access

Remote

Different VLAN(segment) (as user)

Access > Distribution

Enterprise

Central to all campus (users)

Access > Distribution > Core


Models: OSI vs TCP/IP        

OSI

TCP/IP

Application

 

Application

Presentation

Session

Transport

Transport

Network

Internet

Data-Link

Network Access

Physical

_____

Merge this below information into the correct locations:

Layers

PDNTSPA

 

Allows interoperability between vendors

devices only need to be aware of their own layer

layer7webserver does not care if I used fiber or wireless to reach it

layer2Switch does not care what website I am on

 

UPPER:    Servicing and dealing with Application

LOWER:    Focus on end-to-end delivery (how through the network) FOCUS ON THIS

 

7 Application    UPPER    Host

6 Presentation    UPPER    Host

5 Session    UPPER    Host

4 Transport    LOW    Host    Segments

3 Network    LOW    Media    Packets

2 Data Link    LOW    Media    Frames

1 Physical    LOW    Media    Bits

 

 

 

 

 

7 Application UPPER

Provides Network services to the end host's Application

E.G. HTML, Email, FTP, Telnet

 

    Telnet: Remote programming of router without being physically there.

    SSH: ^ but encrypted

 

6 Presentation UPPER

Programming language HTML, Java, C, Python, etc

Deals with actual encoding of data. Ensures that data can be understood between two end hosts.

E.G. ASCII character encoding

how JPEG works vs PNG

turn image to JPEG e.g.

 

5 Session UPPER

Manage session between two end hosts

How end-hosts figure out who they are talking to.

 

4 Transport LOWER

 

Look at stuff and say "is this TCP Session or UDP session?""What is the protocol?"

 

TCP and UDP

 

    99% of applications use one of these two protocols

    Most are TCP

 

 

Breaks up data between sender/receiver to send (data segmentation)

Takes data from UPPER layers (Application,Presentation,Session) and breaks it up (data segmentation) in order to actually send it.

Use to establish End-To-End-connectivity

"Did you actually receive ma data?"

 

3 Network LOWER

 

"Is this my IP that the packet is destined for?"

PATH SELECTION

Layer 3 IP Routers (most routers)

Defines Logical Addressing (IPv4,IPv6 addressing)

 

 

2 Data Link LOWER

 

layer 2 Ethernet switch

Bridges,switches,Wireless Access Points (WPA), ethernet,frame relay, PPP(Point to Point Protocol)

 

^turns into electrical signal or optical signal

Physical addressing comes in here (MAC address(MediaAcessControl Address))

ethernet

ethernet uses physical/hardware address to communicate

uses (MAC)Media Access Control address to communicate

who can send data when(CSMA/CD)

typically has error detection

 

1 Physical LOWER

repeaters and hubs(obsolete devices?)

Copper or fiber or wireless(media is air or radio frequencies between them)

electrical functions

physical connectors

cable distances


Structure: L3 IPv4 Packets and L2 Ethernet Frames

Encapsulation Order

Data is encapsulated into a L4 TCP Segment, is encapsulated into a L3 IPv4 packet, is encapsulated into a L2 Ethernet frame, is converted into electrical binary signals and transmitted across a wire.

Once received, the same operation is done in reverse.

Application    |WWW|

Presentation

Session

Transport    |TCP|WWW|

Network            |IPv6|TCP|WWW|

Data Link    |B0-5F-56-E0-66-01|IPv6|TCP|WWW|

Physical    |011001010111010001101000...

 

these are just headers, also are trailers, so everything is samiched by what is below it

________________________________________

PDU-Protocol Data Units (Lower Layers)

Datagram:        Generic term for any single unit of a layer.

Transport Layer4- Segments

Network   Layer3- Packets    (aka internet layer3)

Data Link Layer2- Frames

Physical  Layer1- Bits

 

Transport Layer4- Segments (TCP Segments, UDP segments)

Network   Layer3- Packets (network packets)

Data Link Layer2- Frames (Ethernet Frames, frame relay frames, PPP frames)

Physical  Layer1- Bits (electrical signals, frequencies, how soon electrical signals, or light or frequencies of light, optical wavelengths)

___

Encapsulation and Decapsulation Process

 

 

Cheese in sandwich in plastic casing in package in box in pallet in truck.

 

WHEN TWO ADJACENT LAYERS TALK TO EACH OTHER

when touching layers talk

 

Layer1 asks Layer2 to send traffic upstairs

TCP at layer4 asks Layer3 (IP) to send traffic to this destination 176.153.7.xx

 

 

PDU- what data looks like at layerX

 

ENCAPSULATION

Sender to receiver Application Layer(1), then add formatting as move down towards Layer1 then can send data over the link (Copper,Fiber,wireless whatever)

 

Process of adding formatting data on the sending host to create a (PDU)Protocol Data Unit

 

DECAPSULATION

Process of removing data formating on the receiving host to expose a PDU.

 

removing formatting from lower layers as we move up towards Application Layer1

Ethernet switch receives physical bits from layer1 wire, takes that framing off, look at Layer2 information like (MAC)Media Access Control Address and figure out what to do with it (which ed host to send to). Once packet(s)get to end-host, end-host will look at layer3 information and say "is this my IP the Packet is destined for?" k "What is transport protocol?TCP Session or UDP Session?" k passes it upstairs to Presentation layer2 "k this is JPEG" tell your Layer1 application(WebbrowserFirefox or app like LoL) to make it appear as a picture."

L3 IPv4 Packet Header

L2 Ethernet Frame


                                IP: Internet Protocol

                                IPv4

Classful

(~1995 and prior)(OLD)

Class

Private IP Range

For...

Bits for Networks

Bits for Hosts-per-Network

A

0.0.0.0        -        127.255.255.255

(Large Organizations)

 8

24

B

128.0.0.0        -        191.255.255.255

Medium Organizations

16

16

C

192.0.0.0        -        223.255.255.255

Small Groups

24

8

D

224.0.0.0        -        239.255.255.255

Used Only Sparingly

32

0

E

240.0.0.0        -        255.255.255.255

Experimental. Don't use at all

Classless

(~1995 and after)(NEW) has Subnet Mask

VLSM (Variable Length Subnet Mask). The subnet mask will even between ip addresses in the same ‘classful class’, e.g. 10.0.255.254/16 and 10.1.0.1/24.

Example

Base10 (decimal)

210.88.239.22

255.255.240.0

Base2 (Binary)

11010010.01011000.11101111.00010110

11111111.11111111.11110000.00000000

Example 2:

192.168.1.1/8

10.0.0.1/16

172.16.1.1/24

These do not fallow the ‘classful’ rules, but rather have non-standard subnet masks from what the address range (e.g. Class C, Class A, & Class B respectively) would typically have had if it was classful.

 

                                IPv6

Nibble:                AF83

Byte:                84B6.C751

Hextet:                846D.187D.8A63.3597

 

Interface Identifier = new Host portion of layer 4 networking.

Now there is only the host portion of an IPv6 Address, and an Interface Identifier.

 

4x as long as IPv4 address

 

IPv6: 128 bits long = 32 nibbles = 8 hextets

 

1 HEX SYMBOL IS == TO 4 BITS (BINARY DIGITS)!

1 HEX SYMBOL REPS 4 BITS (BINARY DIGITS)!

Bases

Hex

Binary

Decimal

Hex

Base-15

Base-2

Base-10

Base-15

0

0000

0

0

1

0001

1

1

2

0010

2

2

3

0011

3

3

4

0100

4

4

5

0101

5

5

6

0110

6

6

7

0111

7

7

8

1000

8

8

9

1001

9

9

A

1010

10

A

B

1011

11

B

C

1100

12

C

D

1101

13

D

E

1110

14

E

F

1111

15

F

 

3 types of address'

 

Unicast

Multicast

Anycast

 

Unicast

Device to device

 

Multicast

device to DEVICES

e.g. ARP

 

Anycast

 

 

 

Loopback

::1 /128 (Hex shortened)

0000:0000:0000:0000:0000:0000:0000:0001 /128 (Hex Long)

(Bin)

00000000.00000000.00000000.00000000.

00000000.00000000.00000000.00000000.

00000000.00000000.00000000.00000000.

00000000.00000000.00000000.00000001

 

Currently no NAT in IPv6

NAt used to give some privacy from those we send packets back and forth to from being able to see how our private network is laid out.

 

Router Advertisement (RA)

Router send info to host (using their link local address) telling what network portion of IPv6 address we are using(Global/public unicast network prefix). Tells how it should create its Interface Identifier (host portion) of ip address. Tells how it can get IP address,  

Stateful DHCP address acquiring = admin configures everything (scope of IntIDs) and has database of who has what()similar to how we do it today,).  

Stateless DHCP = automatically let device determine IntID info, but DHCP server tells what it should use for DNS server and WIN server and that kind of info. DHCP server does NOT record who has what address. Modified-EUI-64 or Privacy (Random)

SLACC

    Modified EUI-64 (Linux, Mac, Cisco all use this)

For Interface Identifier portion of IPv6 Address, we take MAC address, split it in half, put FF:FE in the middle of it, then take the first 2 bits of hex (first two characters) translate that to binary, and invert the 7th bit. Then convert back to hex and BOOM you have Interface Identifier portion and now your own IPv6 address.

 

So take mac address of NIC

CB-30-9F-00-0C-29

Split in half (switch - to :)

CB-30-9F 00-0C-29

put FF:FE in the middle

CB30:9FFF:FE00:0C29

translate first 2 hex bits to Binary

CB ---> 1101 1100

invert 7th bin bit

0--->1

1101 1100 --->1101 1110

translate back to hex

1101 1110 ---> CE

now have IntID and IPv6 address

CE30:9FFF:FE00:0C29 = IntID

 

good for debugging.

downside = anyone who sees your IP address knows who made your NIC and what type of device you have HUGE SECURITY RISK (and privacy risk)

 

    Privacy (Win7 +later use this)

literally a random number.

Changes occasionally, more privacy, but harder for debugging, as you do not what address each dev has, no log, nothing.

___

IPv6 stuff...

Intra-site automatic tunnel addressing protocol

    emulates IPv6 link for use on an IPv4 network

    IPv6 on IPv4 network

Teredo

    IPv6 in UDP datagrams between 2 registered IPv4 nodes, to traverse IPv4 only net

    IPv6 on IPv4 network

   

    IPv4 to IPv6 transition tech, works through NAT IPv4 routers

6 to 4

    IPv4 address in IPv6 packet

    IPv4 wearing big IPv6 clothes

_

IPv6 address' to know

FF02::1            All hosts                224.0.0.1

FF02::2            All Routers            224.0.0.2

FF02::5            All OSPF Routers            224.0.0.5

FF02::6            All OSPF DRs            224.0.0.6

FF02::9            All RIPv2+ Routers            224.0.0.9

FF02::A            All EIGRP Routers            224.0.0.10

IPv6 link-local (unicast) address always begin with FE8, FE9, FEA, FEB.

R?(config)# ipv6 enable

S3(config)# sdm ?

S3(config)# sdm prefer dual-ipv4-and-ipv6 {default|routing}                ! (this on L3 switches) (sdm = switch database mgmt)

S3# reload                                                                        ! Do NOT save the running-config

R(config)# ipv6 unicast-routing                ! This is done on devices that support routing (i.e. Rs and L3Ss) to enable ipv6 unicast routing (sending ipv6)

        or

R(config)# ipv6 routing

stuff copied from Ross' notes

IPv6 Command Guide

IPv6 config:

 

Enable IPv6 routing

 

Router(config)# ipv6 unicast-routing

 

Interface config:

 

Router(config-if)# ipv6 address 2001:db8::X/64

 

Static Route: (note: you must use a next hop IPv6 address, and NOT an exit interface)

 

Router(config)# ipv6 Route <network address>/<mask> <next hop IP>

 

Default Route: (note: you must use a next hop IPv6 address, and NOT an exit interface)

 

Router(config)# ipv6 Route ::/0 <next hop IP>

 

 

OSPF Config (if you don’t know what this is, don’t use this):

 

Router(config)# ipv6 router ospf [process id]

Router(config-router)# router-id [router id number]

 

On the Interface(s) where you want OSPF to participate:

Router(config-if)# ipv6 ospf [process id] area 0

Other Commands:

 

Router# show ipv6 route

Router# show ipv6 int brief

Router# ping ipv6 [ipv6 address]

Router# show ipv6 protocols

 

Cisco 3750 (this is required to get IPv6 functionality on the switch)

Switch(config)# SDM prefer dual-ipv4-and-ipv6 default

 

On the PC:

C:\ Ping -6 [ipv6 address]

IPv6 Notes:

 

An IPv6 interface can have 5 or more IPv6 addresses configured at any one time.  It will always have at least 2.  The link local address is one (which is used for IPv6 to operate behind the scenes), and the Global Unicast Address.

 

On the Router, if you misconfigure an IPv6 address, use the ‘no’ command to erase the bad IPv6 address.

 

On the PC, if you see multiple IPv6 addresses on different networks, disable the interface, and enable it.

When configuring and IPv6 address on an interface, the mask should always be /64.


                                TCP: Transmission Control Protocol

Retransmit

    #packet lost/dropped/corrupted.

 

Speed

    #if congested, then slow down (in TCP)

 

SYN

    #Synchronization

    #starts with sequence number, to define starting point

    #not 0, actually large random number, Wireshark will display 0 for simplicity

 

SYN ACK

    #send own sequence number

    #acknowledges others syn number, by taking their number and adding 1

 

ACK

    #takes that new synch number and adds one

 

 

RST (Reset)

    #Reset, shut it down right now. Rude version of FIN, FIN ACK, ACK

    #ACK, RST ACK

            #"ready to end this convo", "Yup, bye"

    #Sending RST to server, servers sometimes keep convo open

    #sending a bunch of RST to server, can be a DoS

 

 

? Sequence number

    #packet + sequence number?

    #how we know what made it and what did not, receiver can tell how to reassemble, and what needs to be retransmitted.

 

How it should

FIN, FIN ACK, ACK,

 


                                IOS Software

See https://en.wikipedia.org/wiki/Cisco_IOS#Versioning


                                General setup

! Start from a clean slate / start from scratch.

>                                                                ! this shell-prompt means that one is in “User EXEC” mode. This is like having the “$” shell-prompt in BASH (aka Linux). This is like being a non-admin user.

> enable                                                        ! this attempts to elevate one’s session into “Privileged EXEC” mode, which is like the “#” shell-prompt in BASH. This is like trying to login as an admin.

# erase startup-config                                        ! Erases the saved config that is loaded at startup (not the current/running-config.)

# delete flash:/vlan.dat                                ! If dev is in ‘VTP Server’ mode (the default) or ‘VTP Client’ mode, VLAN info is saved in the file “vlan.dat”. This cmd deletes those. See VTP.

# reload

! Basic setup

(config)# no ip domain-lookup                        ! Prevents an accidental mistype of a cmd from causing dev to attempt dns name resolution on it (which may take ~30s)

(config)# hostname {SBlue}

(config)# enable secret class

(config)# service password-encryption                                 ! Encrypts passwords stored locally

(config)# spanning-tree mode rapid-pvst                                ! Enables fast per vlan spanning tree.

(config)# vtp mode transparent                                        ! This moves current and future vlans to save to running-config, rather than to “flash:/vlan.dat”.

                ! (SSH)

(config)# ip domain-name {eff.org}

(config)# username {class} [priv 15] secret {cisco}

(config)# crypto key generate rsa

(config)# {2048+}

(config)# ip ssh v 2

(config)# line vty 0 4                                ! non-admin virtual terminal interfaces. If attacker is attempting to brute-force, and they are using a non-admin username, they would use these.

(config-line)# transport input ssh

(config-line)# login local

(config-line)# logging synch                                ! Prevents SysLog msgs from interrupting cmds being typed.

(config)# line vty 5 15                                ! Admin virtual terminal interfaces. Believe that these are only accessed when an admin username is entered

(config-line)# transport input ssh

(config-line)# login local

(config-line)# logging synch                                ! Prevents SysLog msgs from interrupting cmds being typed.

NOTES ON VTY NUMBERS:

    If brute force attacks, the attacker will take up all non-admins and would not allow admins to get in (admins want to log in so they can stop the attack). with this setup, admins are able to still get in and prevent attacks.

The 0-4 (users) and 5-15 (admins) set up is the standard arrangement for cisco gear.

                ! (VLANs)

(config)# vlan {#}                                        ! Modifies or creates a vlan

(config-vlan)# name {Mgmt}

                ! (VLANs + IP, so can SSH, put on mgmt vlan maybe)

(config)# int vlan {#}

(config-if)# ip add {#.#.#.#} {#.#.#.#}

                ! (BlackHole)

(config)# Int range {f1/0/1 – 48, g1/0/1 – 4}

(config-if)# description unused

(config-if)# shutdown

(config-if)# switchport mode access

(config-if)# switchport access vlan 666

(config-if)# switchport nonegotiate

                ! (Access port)

(config-if)# switchport                                ! use this if on a L3S to configure this int as L2.

(config-if)# switchport host                                ! macro to set ‘sw mode access’ & ‘spanning-tree portfast’ & disables channel groups..

(config-if)# switchport mode access

(config-if)# switchport access vlan {vlan ID}

(config-if)# auto qos voip trust                        ! configures AutoQoS default policy, also makes config changes in other parts of config

(config-if)# switchport nonegotiate

(config-if)# spanning-tree portfast

                ! (Access port security)

(config-if)# switchport port-security mac-address {mac}

(config-if)# switchport port-security mac-address sticky

(config-if)# switchport port-security max 2

(config-if)# switchport port-security violation {shutdown | ...}

(config-if)# switchport port-security                

                ! (Setup trunk)

(config)# int [gig 0/1]

(config-if)# switchport trunk encapsulation dot1q

(config-if)# switchport mode trunk

(config-if)# switchport trunk allowed vlan {10-20,22}

(config-if)# switchport trunk native vlan {#}                        ! Frames with this VLAN will NOT be tagged with 802.1Q header.

(config-if)# switchport nonegotiate                                        ! Disabled DTP, will not send any DTP info across this int. Reduces convergence time.

# show ip int brief                                                ! “OK?” column lists L1-line-status, while “Status” lists L2-line-protocol status.

# show int descriptions                                        ! “Status” column lists L1-line-status, while “Protocol” lists L2-line-protocol status

CTRL^                (CTRL+SHIFT+6)                                ! This is the escape sequence. The escape sequence is used to stop a command while it is in the process of running, e.g. a traceroute that is in a loop.

Do not put 'spanning-tree portfast' on trunk ports

                

>Also, the ports on the router need to speak the same language as

>the ports on the switch - they do not at this point!

>That language is the 802.1q protocol.

>On each router port connected to a network, the following command must be issued:

R# vlan-id dot1q [vlan number]

>(e.g. for vlan 10, do the below command)

R# Vlan-id dot1q 10


Miscellaneous

Dev# reload in 15                ! this tells the dev to reload in 15 minutes. Do this before running risky cmds.

Dev# reload cancel                ! this cancels a pending reload. Use this if the risky cmds did not break the running-config.

# alias exec s show                        ! creates alias (just in exec mode?) of “s” for “show”

# ping      

# traceroute {ip} ?

# show tech-support          ! returns “show running-config” and a bunch of other stuff but redacts all passwords and password hashes.

R1(config)#username cisco password cisco

R1(config)#do show run | include password 7

username cisco password 7 05080F1C2243

password 7 ****

R1(config)#key chain CRACK

R1(config-keychain)#key 1

R1(config-keychain-key)#key-string 7 05080F1C2243        ! Enter the hash

R1# show key chain

Key-chain CRACK:

key 1 — text “cisco”                                        ! Here it tells us the plain-text password is “cisco”.

...

Types of memory

Planes

The Management Plane is used to control the Control Plane. The Control Plan is used to control the Data Plane.

TCL Scripting

Dev# tclsh                                                ! This literally opens a different shell, tclsh. If this place one into “+>”, one must enter the following cmds “}”, & “tclquit”, then “dir” and verify no files are now present that shouldn’t be, and start over.

Dev(tcl)# puts [ open "flash:BASE.CFG" w+ ] {        ! This opens a new file (in RAM), and will write it to flash once finished.

+>hostname CHANGEME

+>ip domain-name EFF.LOCAL

+>int range f0/1-24 , g0/1-2

+>shutdown

+>exit

+>vtp mode transparent

+>line con 0

+>logging synchronous

+>exit

+>end

+>}

Dev(tcl)# tclquit

Dev# tclsh

puts [ open "flash:reset.tcl" w+ ] {

typeahead “\n”

copy running-config startup-config

typeahead “\n”

erase startup-config

delete /force vlan.dat

delete /force multiple-fs

typeahead “\n”

puts “Reloading the switch in 1 minutes, type reload cancel to halt”

typeahead “\n”

reload in 1 RESET.TCL SCRIPT RUN

}

tclquit

Dev# tclsh reset.tcl

! optionally you can specify the sdm template by adding ‘ ios_config “sdm prefer dual-ipv4-and-ipv6 routing” ‘. Place after the deletes.

Switch#more reset.tcl

typeahead "\n"

copy running-config startup-config

typeahead "\n"

puts [exec "write erase"]

ios_config "sdm prefer lanbase routing"

typeahead "\n"

puts "Reloading the switch in 1 minute, type reload cancel to halt"

typeahead "\n"

reload in 1 RESET.TCL SCRIPT RUN

Switch#

# tclsh

foreach address {

10.0.0.1

10.0.0.2

10.0.0.3

} {

ping $address  }

Web Interface

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/configuration/15mt/fundamentals-15-mt-book/cf-web-based-cfg.html#GUID-19C30A64-2A00-4E8C-8BB2-1758D4C67B6E

(config)# ip http server [secure]                        ! Secure enables the HTTPS version rather than HTTP. This is highly recommended. Some use ‘secure-server’

(config)# ip http authentication {aaa | local | tacacs | enable}                        ! If AAA, see AAA

(config)# ip http access-class Acl-Name

(config)# ip http port Port#                                ! optional.


Power


Discovery Protocols

Neighbor Discovery Protocols are L2 protocols to discover connected devices, and info about them.

CDP: Cisco Discovery Protocol

(config)# cdp run                        ! Enables CDP (is on by default, only shows the “no cdp run” version in running-config)

# show cdp neighbors [detail]                ! [details] shows all info sent via CDP ads.

(config)# cdp timer 60                        ! set cdp refresh timer.

(config)# cdp holdtime 180

(config-if)# [no] cdp enable                ! Do this to prevent CDP ads from being Tx’ed on this interface. Best to do this on all ints that do not go to trusted Cisco Networking devices. (do this on access ints that go to users without Cisco IP phones)

LLDP: Link Layer Discovery Protocol

(config)# [no] lldp run                                ! Enables LLDP

(config-if)# [no] lldp {receive|transmit}        ! Can be used to enable/disable lldp on a specific int.

(config-if)# lldp timer seconds                ! Configures the LLDP hello timer.

(config-if)# lldp holdtime seconds                ! Configures holdtime on an int.

# show lldp [neighbors [int] [detail] ]                ! Will list LLDP-MED info at bottom

ISDP


Switching Process

L2 Switch Operation

When a S receives a frame, it first looks at the SA (Source mac add) to see if it can add that SA to its CAM MAC address-table (if it has not already done so). Then it will either filter (i.e. drop), forward, or broadcast the frame.

S# show mac address-table [dynamic] [address mac] [interface int] [vlan vlan]

L3 (Multiplayer) Switch Operation

L3S(config)# ip routing                                ! Enables routing between vlans.

L3S(config-if)# [no] switchport                        ! Use this on a L3S to configure this particular int as L2, or use the ‘no’ parameter to make it L3.

Cisco Switching Methods


VLAN: Virtual Local Area Network

S(config)# vlan 999

S(config-vlan)# state {active | suspend}        ! Declares a vlan’s operational state. While the “shutdown” cmd here is local, the cmd “state suspend” cmd is propagated throughout the VTP domain.

S(config-vlan)# shutdown                        ! locally shuts down vlan. (may only take effect after ‘exit’ing, See )

S(config)# shutdown vlan ####                ! locally shuts down vlan.

S(config)# shutdown vlan 1                ! only this method is capable of working while in VTP Cx mode.

! or…

S(config)# vlan 1

S(config-vlan)# shutdown                ! this method cannot be done while a VTP Cx.

# show vlan

VLAN Role

VID

Reason for mapping this VID to vlan role

Default

1

Unable to be changed.

Voice

9 | 411

Most organizations require dialing 9 to dial-out. 411 is to speak to telephone operator.

Data

80

Port 80 is port used for HTTP.

Native

471 | 413

NATIVE = N471VE/N4T1V3 = 471/413 (without Letters). 667 = almost evil (666).

Blackhole

666

666 is biblical mark of the beast, ie evil. Send evil to black hole to remove/contain it.

Management

999

Separate from most other things. No real reason.

Native VLAN

S(config)# vlan 80

S(config-vln)# name NATIVE                        ! not required, just for documentation purposes, and ease of mgmt.

S(config)# int fa0/1

S(config)# desc A_TRUNK_LINK

S(config-if)# switchport trunk native vlan 80

S(config)# int fa0/2

S(config-if)# desc AN_ACCESS_LINK

S(config-if)# switchport access vlan 80

S(config-if)# switchport voice vlan 9

_________

How to prevent untagged trunk traffic?

(config)# vlan dot1q tag native            ! does NOT strip the tag off of the native vlan traffic, AND drops untagged traffic.

! See  https://www.cisco.com/c/m/en_us/techdoc/dc/reference/cli/nxos/commands/l2/vlan-dot1q-tag-native.html

Attacks: See “Network Security” section for “Double-tagging VLAN Hop Attack”.

PVLAN: Private VLAN


Isolated

Community

Promiscuous

What type of private VLAN is it in?

Secondary

Secondary

Primary

Can communicate with promiscuous ints?

Yes

Yes

Yes

If another host and I are in the exact same secondary-vlan, can we talk?

No

Yes

N/A

Can I talk w/ secondary-vlans (regardless of type) that I’m not a member of?

No

No

Yes

S(config)# VTP mode {off | transparent}

S# show vtp status | include mode

S(config)# vlan vid-isolated0

S(config-vlan)# private-vlan isolated

S(config)# vlan vid-community0

S(config-vlan)# private-vlan community

S(config)# vlan vid-community1

S(config-vlan)# private-vlan community

S(config)# vlan vid-primary0

S(config-vlan)# private-vlan primary

S(config-vlan)# private-vlan association vid-isolated0,vid-community0,vid-community1

S(config-if)# description UPLINK_TO_DEFAULT_GATEWAY

S(config-if)# switchport mode private-vlan promiscuous

S(config-if)# switchport private-vlan mapping vid-primary0 [add|remove] vid-isolated0,vid-community0,vid-community1

S(config-if)# description TO_USER

S(config-if)# switchport mode private-vlan host

S(config-if)# switchport private-vlan host-association vid-primary0  {vid-isolated0 | vid-community0 | vid-community1}

S# show vlan private-vlan

! This is a pre-requirement that must be done before configuring private vlans.

! Verify that VTP is either off or transparent.

! This makes it a private secondary isolated vlan.

! This makes it a private secondary community vlan.

! This makes it a private secondary community vlan.

! This makes it a private primary  vlan.

! Associates vid-primary0 as the primary vlan for all of the specified private secondary vlans.

! This cmd says that this int is a promiscuous int.

! Declares the primary vlan first, then lists the range (separated by commas) of secondary vlans. If [add|remove] is omitted, add is assumed.

! This cmd says that this int is for a host in a secondary vlan.

! Sets the private primary vlan, and then the private secondary vlan.

Primary

---------------

vid-primary0

vid-primary0

vid-primary0

Secondary

------------------

vid-isolated0

vid-community0

vid-community1

Type

---------------------

isolated

community

community

Ports

---------------------------------

promiscuous-int0, host-int0, host-int1, …

promiscuous-int0, host-int2, host-int3, …

promiscuous-int0, host-int4, host-int5, …

S# show int int switchport | include private-vlan

Protected Port: “PVLAN Edge”

(config-if)# switchport protected


Subinterfaces

R(config)# interface g0/0.10

R(config-if)# encapsulation dot1q {10} [native]                ! encap dot1q [x] says that this subint speaks dot1q, and tags traffic as vlan 10.

R(config-if)# ip address 10.0.0.1 255.255.255.0

subint numbers are best to be the same as the vlan, for easy mgmt. but the encap cmd is what actually determines the vlan used.

two ways to pick native vlan

either pick one sub-int and append native the the encap cmd. eg

R(config)# encap dot1q 666 native

or

on the physical int, add an ip address and IOS will assume that as the native. But the first option is preferred.

Verification:

show ip route        ! should list the sub ints.

show vlans        ! ROAS us for multiple VLANs on one int.this cmd will show which vlans are on which subint and int. also tells what is native.

do those vlans exist, or have they been pruned by VTP? STP blocked?

(subinterfaces are only available on Rs, not on L3S’es)

        


DTP: Dynamic Trunking Protocol

S(config-if)# switchport mode {trunk | access | dynamic-auto | dynamic-desirable}                ! Sets “Administrative Mode” of the int.

! If Administrative mode is “access” or “trunk” this causes a static “Operation Mode”.

                                ! If Administrative mode is “dynamic-*” its “Operational Mode” will change depending on what it is connected to.

S(config-if)# switchport mode trunk                                ! Sets administrative mode to “trunk”, which causes a static operational mode of trunk.

S(config-if)# sw trunk encap {negotiate | dot1q | idl}        ! Default = negotiate, if “sw trunk encap negotiate” Cisco switches try use IDL, else they use whatever both S support.

S(config-if)# switchport nonegotiate


VTP: VLAN Trunking Protocol

Compatibility

v3 Server

v2 Server

v1 Server

v3 Client

Yes

No

No

v2 Client

Yes*

Yes

Yes

v1 Client

No

No

Yes

        * VTPv3 Servers can be compatible with VTPv2 clients/transparents, but only if not using private-vlans or extended-vlans (because VTPv2 does not support those), by sending scale-down version of VTP ads in addition to the regular VTPv3 ads, however these VTPv3 ads will not be forwarded.

S(config)# vtp domain {null}                        ! Set the case-sensitive domain name for vtp

S(config)# vtp mode {server | client | transparent | off}                ! Set the mode, default is server. Typically CoreS=Server, Distribution/AccessS=Client.

S# show vtp status                                        ! (will show info, mode, pruning, etc.)

S(config)# vtp pruning                                ! Enables vtp pruning. Default is disabled.

S(config)# vtp version {1|2|3}                        ! But transparent won’t forward if different version, else v1 server & v2 client are fine

S(config)# vtp password {null} [hidden | secret]        ! Sets password. Recommended to avoid “VTP bombs”. VTPv3 encrypts this with MD5 if using [hidden?]. Length must be 8 - 64 chars.

S# vtp primary {vlan|mst|force}                        

! THIS IS CONFIGURED IN EXEC MODE! NOT CONFIG MODE! (default=vlan , if omitted) A separate primary server can exist, 1 for vlan & 1 for mst. force=skips checking for other primary servers (avoid this, causes multiple primary servers causing VLAN DB inconsistencies) becoming primary server increments config revision number.  Will check for conflicting VTP3 devices, then ask to confirm before becoming primary server.

S# show vtp status | i primary                ! Shows MAC & desc of current VTPv3 Primary Server (if 0000.0000.0000 then none exists)

S# show vtp password                        ! Shows vtp password in plain text (v3 can prevent this).

S# show vlan [brief]                                    ! (Verify revision is >~2, Number of existing VLANs >~1)

S# show int trunk                                

                    ! Use to verify VTP Pruning removes ‘sw tr allowed vlan’ s from a trunk link that does not need it on other end of trunk or downstream via that trunk. Shows Encap, native vlan, allowed vlans.

See https://en.wikipedia.org/wiki/VTP

VTP Pruning

Enabled on vtp server, and then this change is propagated throughout trunks in vtp domain to make vtp pruning enabled on all servers & clients (heard is best not to use if you have transparent switches in your vtp domain.)

S(config)# vtp pruning

 S# show int trunk

 S# show vtp status

 S# show vtp status                                 ! Look at ‘Config last modified by {ip}’ with timestamp(NTP would help here), ‘Local updater ID is {ip}’, and ‘Config Revision {#}. …

                                                        ! MD5 Digest: MD5 hash of VTP Domain Name + VTP Password. If these are not identical across S, they will NOT synch.

NOTE: PVST still runs for the vlan even if that vlan has been pruned from the switch, because a S will still know of the vlan. Pruned =/= forgotten.


802.1D (STP) & 802.1W (RSTP)

  1. In a network with redundant L2 links.
  1. When a broadcasted frame causes exponentially more broadcasted frames, which cause exponentially more broadcasted frames…. etc. etc.
  2. E.g. S1 broadcasts a frame out of ints G0/1 - 2 (both of which connect to S2). S2 gets the first broadcast frame, via G0/1, and broadcasts that out both ints (G0/1 & G0/2), then receives the original broadcast frame again on G0/2 and repeats it actions. Now S1 will receive the same broadcast frame 4 times. This causes an exponential loop of broadcasts, and is called a “Broadcast Storm”.
  1. Same example as above, but each time a S receives one of those frames from the other S’es, it will update its MAC add table to list ‘the link it receives the frame on’ as the int that connects this S to the other S. This continues and in situations with more S’es it will end up with a MAC add table that lists the wrong ints as connecting to the wrong devices.
  1. Same example as Broadcast storms, where the same frame is received by a host multiple times. E.g. in a multi-host game, player tells S to move character 1 unit forward may result in the character moving multiple units forward due to the S receiving the same “move forward 1 unit” frame multiple times.
  1. A range between 0 and 61440 where lower is better. Rises from 0, in increments of 4096 (because the priority is combined with the VLAN when creating the BID, & there are 4096 total VLANs). Default = 32768. You can change this. As noted in the “BID” definition, if tie, S with the lowest MAC address is better.
  1. The S with the lowest BID (the best/most desirable BID) becomes the RB through the STP Election process.
  1. All RB ports are DP (Designated Ports / not blocked by STP).
  1. Best the make the most upstream S (i.e. the S logically closest to the core layer) be the RB, if tie then the most powerful S (the S that can forward the most amount of packets).
  1. The * Current ACTUAL speed * of an int. Not the max speed of an int, the current ACTUAL speed, look for manually configured speeds.
  2. Lowest PC is more desirable.

Current Actual Ethernet Speed *

(Cisco default)

IEEE 1998 Cost:

IEEE 2004+ Cost

10 Mbps

100

2,000,000

100 Mbps

19

200,000

1 Gbps

4

20,000

10 Gbps

2

2,000

100 Gbps

N/A

200

1 Tbps

N/A

20

  1. Default is 128? Need more info on this.
  1. (e.g. Assuming same Port Priority, Fa0/1 is lower, and therefore better, than Fa0/99)
  1. The most common BPDU. Listing many details including the sender’s: RB timers, RBID, RC, BID, and Port ID.
  2. Superior Hello BPDU:        A Hello BPDU listing a (numerically) lower/better RBID. A BPDU is superior if it has:

1. Lower RBID;        if tie ...

2. Lower RC;        if tie ...

3. Lower BID;        if tie ...

4. Lower Port ID

  1. Inferior Hello BPDU:        A Hello BPDU listing a (numerically) higher RBID.

S(config)# spanning-tree mode {rapid-pvst | pvst}                ! Configures the STP mode. Default = ”pvst” (per-VLAN Spanning Tree).

                                                                                ! identify which mode, RSTP/MST = rapid, ieee = STP.

S(config)# spanning-tree vlan # priority 32768                ! Configures the priority (and subsequently the BID) of the switch for this vlan. This can be 0 - 61440 (default = 32768).

S(config)# spanning-tree vlan # root {primary | secondary}        ! this sets pri to become RB, now  ,, not continuous changes, just now,

                                                                                                ! LOGIC: what RB pri? if RB pri >24576, set my pri 24576.

                                                                                                !  if RB pri <=24567, set my pri JUST low enough to become RB

! If “... root secondary” then configures the S with the 2nd lowest priority.

                        ! Enabling PortFast = enabling RSTP point-to-point edge ports (bypassing listening & learning states)

                        ! BID = (Priority + VLAN) + MAC

                        ! How S picks RP?                Lowest RC, BID, port-pri, port#

S# debug spanning-tree events                                                ! Lists port and role changes

S# sh spanning-tree int F0/1 detail                                ! tons of stuff, if portfast, if BPDUGUARD, BLDUs Tx/Rx

S# sh spanning-tree int F0/1 portfast                                ! lists vlans w/ portfast on that int

S(config)# spanning-tree vlan # priority 32768                ! set pri of S

S(config)# spanning-tree vlan # root primary                        ! this sets pri to become RB, now  ,, not continuous changes just now,

                                                                        ! LOGIC: what RB pri? if RB pri >24567, set my pri 24576.

                                                                        !  if RB pri <=24567, set my pri JUST low enough to become RB

S(config)# spanning-tree vlan # root secondary                ! becomes 2nd lowest pri

S# debug spanning-tree events                                ! shows when ports change states, & more

S# sh spanning-tree [vlan 99] bridge                        ! BID breakdown :) + timers        OR sh spanning-tree bridge

S# sh spanning-tree [vlan 99] root                                ! per vlan, show RID, MAC, RC, timers, RP ,,  or sh spanning

S# sh spanning-tree [vlan 99]                                ! sh RB pri, mac, timers, & same for this S & this S's ints

S# S(config-if)# spanning-tree pri 32768                        ! Set priority of int all vlans (not configured  with the "if)# spanning-tree [vlan 99] priority 32768"

S(config-if)# spanning-tree [vlan 99] priority 32768        ! set priority value of int in vlan

                ! BID = (Priority + VLAN) + MAC

                ! There are 2 types of etherchannel, L2 & L3

S# show etherchannel summary                                 ! to determine if L2 or L3 etherchannel.

                ! Enabling Portfast = enabling RSTP point-to-point edge ports (bypassing the listening & learning states)

802.1D/STP Port Costs

Ethernet Speed *

IEEE Cost: 1998

IEEE Cost: 2004

10 Mbps

100

2,000,000

100 Mbps

19

200,000

1 Gbps

4

20,000

10 Gbps

2

2,000

100 Gbps

N/A

200

1 Tbps

N/A

20

* Current ACTUAL speed, not the max speed, the current ACTUALLY CONFIGURED speed, look for manually configured speeds.

(Timers)

Hello Timer: How often Tx BPDUs (by default 2s)

Forward Delay: Delay to move forward from LISTEN/LEARN port states

MaxAge: How long til ‘not hear from RB’ til begin reconverge

DEFAULTS

Hello Timer

Forward Delay

Max Age

802.1D / STP

2s

15

10 * Hello (=20s)

802.1W / RSTP

2s

?

3 * Hello (=6s)

These are the default timers

In network, they are determined by the RB.

RB tells other Ss, what timers to use.

802.1W / RSTP

Adds a new mechanism to replace the root port,  without any waiting to reach a forwarding state (in some conditions)

Adds a new mechanism to replace a designated port, without any waiting to reach a forwarding state (in some conditions)

Lowers waiting times for cases in which 802.1W/RSTP must wait

RSTP is backwards compatible with STP.

How do I change to RSTP?

go to all S’s and do:

spanning-tree rapid per vlan ???

802.1W / RSTP: Port Roles

Alternate port:

Alternative RP         (Must be receiving ‘BPDUs w/ same RB’ as RP) Moves immediately to Forwarding-State/RP when RP hits MaxAge.

Backup port:

(rare) Backup DPs

802.1W / RSTP: Port States

802.1D

802.1W

Function

Disabled

Discarding

Port is Administratively-down

Blocking

Discarding

Control traffic only (CDP, LACP, DTP, etc)

Listening

(not used)

Tx/Rx BPDUs, STP participation, flushes MACs

Learning

Learning

Learning MACs to add to MAC-add-table

Forwarding

Forwarding

all (also learns MACs)

802.1W/ RSTP: Port Types

if Full Duplex -> Point-to-Point (P2p)

if Half Duplex -> Shared (Shr)

then if PortFast enable -> Edge

eg if Full Duplex & Portfast -> P2p Edge

Shared ports: rare, but used when shared ethernet/collision domain, eg connecting to hubs. Converges slower compared to P2p

Warning: Cisco recommends AGAINST Shared-Edge ports, as it may cause loops!

S# sh spanning-tree

! will list what type each port WILL BE IF RSTP IS ENABLED. ie will list (eg shr) even if configured as pvst

                                                        (PortFast)

S(config-if)# spanning-tree portfast disable        ! PortFast statically: off                , this overrides the default

S(config-if)# spanning-tree portfast                        ! PortFast statically: on                (to set to default, just prefix w/ no)

S(config-if)# spanning-tree portfast disable        ! PortFast statically: off                , this overrides the default

S## sh spanning-tree int F0/1 portfast                ! if int is up, will tell if portfast is active

S# sh spanning-tree int F0/1 detail                        ! much info, if portfast enabled

S(config)# spanning-tree portfast default                ! All ints enable portfast by default, go to trunks and disable w/ "spanning-tree portfast disable"

??????

STP & RSTP

S(config)# spanning-tree mode [rapid-pvst | pvst]                        ! choose stp mode, default=pvst

                                                                        ! identify which mode, RSTP/MST = rapid, ieee = STP.

                        ! Enabling PortFast = enabling RSTP point-to-point edge ports (bypassing listening & learning states)

                        ! BID = (Priority + VLAN) + MAC

S# debug spanning-tree events                                                !

S# sh spanning-tree int F0/1 detail                        ! tons of stuff, if portfast, if BPDUGUARD, BLDUs Tx/Rx

S# sh spanning-tree int F0/1 portfast                        ! lists vlans w/ portfast on that int

S(config)# spanning-tree vlan # priority 32768                        ! set pri of S (32768 is default)

S(config)# spanning-tree vlan # root primary                        ! this sets pri to become RB, now  ,, not continuous changes just now,

                                                        ! LOGIC: what RB pri? if RB pri >24567, set my pri 24576.

                                                        !  if RB pri <=24567, set my pri JUST low enough to become RB

S# debug spanning-tree events                                ! shows when prorts change states, & more

S# sh spanning-tree [vlan 99] bridge                        ! BID breakdown :) + timers        OR sh spanning-tree bridge

S# sh spanning-tree [vlan 99] root                                ! per vlan, show RID, MAC, RC, timers, RP ,,  or sh spanning

S# sh spanning-tree [vlan 99]                                ! sh RB pri, mac, timers, & same for this S & this S's ints

S# S(config-if)# spanning-tree pri 32768                        ! Set priority of int all vlans (not configured  with the "if)# spanning-tree [vlan 99] priority 32768"

S(config-if)# spanning-tree [vlan 99] priority 32768        ! set priority value of int in vlan

                ! BID = (Priority + VLAN) + MAC

                ! There are 2 types of etherchannel, L2 & L3

                ! Enabling Portfast = enabling RSTP point-to-point edge ports (bypassing the listening & learning states)


TO DO:

COMPARE OUTPUT FROM ALL LISTED SHOW COMMANDS ON PG 95-96

ADD IMAGES OF SHOW OUTPUTS

Commands to verify exist

S(config)# spanning-tree mode [rapid-pvst | pvst]                        ! set STP mode

S(config)# spanning-tree [vlan #] root primary                                ! changes S to RB, P changed to the lower of either 24576 or 4096 less than the priority of the current RB when the command was issued

S(config)# spanning-tree [vlan #] root secondary                        ! Sets this S’s STP base pri to 28672 (verify this with other notes)

S(config)# spanning-tree [vlan #] {pri #}                                ! Sets bridge pri of this S for the specified VLAN

S(config-if)# spanning-tree [vlan #] cost #                                ! Sets STP cost

S(config-if)# spanning-tree [vlan #] port-priority #                        ! Sets STP port pri in that VLAN (0-240, in increments of 16(lower=better))(used for RP tiebreaker if cost,&BID are same)

S(config)# spanning-tree bpduguard default                                ! Sets all ints (not statically overwritten) to enable bpduguard

S# show spanning-tree                                                        ! Lists details about the state of STP on the switch, including the state of each port

S# show spanning-tree int [x]                                                ! Lists STP info just for that int

S# show spanning-tree int [x] portfast                                        ! 1-liner, if portfast enabled

S# show spanning-tree vlan #                                                

S# show spanning-tree vlan # bridge

S# show spanning-tree vlan # root

S# show spanning-tree summary                                                ! Default portfast/bpduguard settings, which vlan this S is RB


PortFast

S(config-if)# spanning-tree portfast                        ! PortFast statically: on                (to set to default, just prefix w/ no)

S(config-if)# spanning-tree portfast disable                ! PortFast statically: off                , this overrides the default

S# sh spanning-tree int F0/1 portfast                        ! if int is up, will tell if portfast is active

S# sh spanning-tree int F0/1 detail                        ! much info, if portfast enabled

S(config)# spanning-tree portfast default                ! All ints enable portfast by default, go to trunks and disable w/ "spanning-tree portfast disable"

__

only for edge ports/connected to end devices. Best paired with bpduguard.


BPDUguard & Filter

S(config-if)# spanning-tree bpduguard enable                ! overrides default, statically enabling BPDUguard on int

S(config-if)# errdisable recovery cause bpduguard        ! automatically recovers from bpduguard-caused-errdisable state

S(config-if)# errdisable recovery interval 400                ! ^... after this amount of s.

S(config-if)# spanning-tree bpduguard disable                ! overrides default, statically disabling BPDUguard on int

S# sh spanning-tree int F0/1 detail                                ! much info, if bpduguard enabled, BPDUs Tx/Rx

S(config)# spanning-tree portfast bpduguard default                ! all ints, that arn't statically configured, enable bpduguard

S# sh spanning-tree summary                                                ! much info, if portfast is default, if BPDUguard default


     

Port-Channel / EtherChannel

  1. Verify that the ints (without being in an etherchannel) are working properly (‘show ip int brief’ UP/UP)
  2. Shutdown the ints to be put into an etherchannel first before you begin configuring them.
  3. Reset the ints to default settings via “default int range Fa0/1 - 2”. But then add descriptions to the individual ints beforehand.
  4. Keep the locally significant ‘channel-group #’ numbers to the same on both ends of the link, for ease of mgmt/troubleshooting.

S# show etherchannel summary                        ! (I) = stand-alone. Means other side of PO is not in etherchannel.

S# test etherchannel load-balance int port-channel <po #><mac/ip> <src add> <dest add>        ! Returns the RBH hex value, like “Computed RBH: 0x5”. Some IOS’s also list what int it maps to.

S# show int port-channel <po#>  etherchannel                                        ! See the below output example.

S# show int port-channel 1 etherchannel

...

Index

Load

Port

EC state

No of bits

-----------+---------+----------+-------------+-----------

0

49

Gi3/1

Active

3

1

92

Gi3/2

Active

3

2

24

Gi3/3

Active

2

Look at the "Load" column corresponding to a physical interface. Convert those two separate hex values (e.g. 49 = 0x4 0x9) to the 1-byte bin value (e.g. 01001001). Do this for all ints.

                                        = 76543210        (decimal? places for the RBH True Values below. This part is tricky so check this field often)

Load; Hex;        =        Binary;        = RBH True value;

49 = 0x4 0x9 =        0100 1001        = 01001001                Here this byte’s 0,3, & 6 bits are set/flipped.        So RBH values of 0x0,0x3, & 0x6 will Tx via this physical int in the po.

92 = 0x9 0x2 =        1001 0010        = 10010010.                Here this byte’s 1,4, & 7 bits are set/flipped.        So RBH values of 0x1,0x4, & 0x7 will Tx via this physical int in the po.

24 = 0x2 0x4 =        0010 0100        = 00100100.                Here this byte’s 2, & 5 bits are set/flipped.                So RBH values of 0x2, & 0x5 will Tx via this physical int in the po.

Notice the pattern of where the set/flipped (1)s are in the “RBH true value” field above. It revolves from int index to int index. (in the above example it goes int indexes 1,0,2,1,0,2, etc.)

This is where the “PO LB/int by # of Ints” table below comes in handy.

The “No of bits” field corresponds to the load-balancing table below, with regards to which ints receive what portion of the traffic.

        

PO LB/int by # of Ints

po ints

LB (No of bits)

8

1:1:1:1:1:1:1:1

7

2:1:1:1:1:1:1

6

2:2:1:1:1:1

5

2:2:2:1:1

4

2:2:2:2

3

3:3:2

2

4:4

S# show etherchannel load-balance                        ! Returns the current LBHA per L3 protocol (IPv4, IPv6, non-IP, etc)

S(config)# port-channel load-balance ?                ! to see all LBHAs available on the S.

S# clear counters                ! One will be prompted by IOS to confirm this action.

S# ping                        ! Find some way to send traffic across the po.

S# show int Fa 1/38 | i packets output                ! Returns the packets Tx’ed and their total byte size. Compare this with the other ints in the po.

S# show int Fa 1/39 | i packets output                ! Returns the packets Tx’ed and their total byte size. Compare this with the other ints in the po.

                                ! Clear counters again and test in another fashion, such as to a different IP, or form a different MAC, or using a different port. A way to test how the load balancing operates.

S(config)# port-channel load-balance {src/dst/src-dst-mac | src/dst/src-dst-ip | src/dst/src-dst-port | mpls}                        ! Configure the device-wide LBHA.p

S(config)# spanning-tree etherchannel guard misconfig                ! (default) Enable EtherChannel MisConfig Guard

S# show spanning-tree summary | i EtherChannel misconfig guard

S# show etherchannel summary                                 ! to determine if L2 or L3 etherchannel.

PO Creation

!

S(config)# default int range Fa0/11 - 12                                ! Best to do this to remove any pre-existing configs, even if one believes there aren't any.

S(config)# int range Fa0/11 - 12

S(config-if)# description {Po1_TO_otherDevice}                ! Descriptions are nice when reading the config. Descriptions on the po do not duplicate to the individual ints.

! if L3-PO do “no switchport”.                                                ! This also adds to “no ip address” cmd.

S(config-if)# channel-protocol {LACP|PAgP}                        ! (Optional) limits ‘channel-group # mode’ cmds to only the protocol you enter here in this cmd (eg pagp blocks ACTIVE/PASSIVE).

S(config-if)# channel-group {po#} mode {on|active|passive|auto|desirable}                ! Adds the int(s) to the specified po (creating the po if nonexistent), using the specified EtherChannel protocol.

S(config)# int port-channel {po#}

S(config-if)# description {TO_otherDevice}

! if L3-PO do “no switchport”.                                                ! This may automatically be added by doing the “no sw” on the individual ints.

S# show int trunk              (notice port name)

S# show int [fast 0/11]        (^if any are err-disable'ed, finish config then shut; no shut)

S# show int port-channel 1

S# show int etherchannel

S# show etherchannel [#]                                                        ! [#] is optional but will display only that specified po instead of all

S# show etherchannel [po1] [summary | detail | brief]

S# show etherchannel summary                                        ! If LACP or PAgP, if L2 or L3, which ports in which po, if po is down or not`

S# show etherchannel 1 port-channel                                        ! which protocol, which ints. Seems to be ^ but po specific.

S# show spanning-vlan 1

S# show etherchannel [#] [summary]                ! [#] is optional but will display only that specified po instead of all        


SPAN: SwitchPort ANalyzer

! RSPAN PRE-SETUP

S1&2(config)# vlan remote-span-vlan#

S1&2(config-vlan)# name remote-span-instance

S1&2(config-vlan)# remote-span
!

! SPAN/RSPAN SETUP

S1(config)# monitor session {instance} source { {int G1/0/1 - 3 } | {vlan vlan#} } {rx|tx|both}

S1(config)# monitor session {instance} destination { {int int} | {remote vlan remote-span-vlan#} }

!

!

! VERIFICATION

S1# show monitor

S1# show monitor session all

S1# show monitor detail

S1# show vlan remote-span

! only need to do this section if configuring RSPAN. If so, does this need to be done only on the sender or both?

! WARNING: If sourcing “both”, & S has 2 local ints in this same VLAN, & they send a frame between themselves, you will receive it twice (ie G1/0/1 Tx & G1/0/99 Rx).


SVI / MLS / L3 switch

                                                                ! By default, L3 switches do not allocate any memory to the IP routing table. Use the cmds below to change that. This requires a reboot.

S(config)# sdm prefer lanbase-routing                ! Does not take effect until reload.

S# reload                                                ! Do NOT save the running-config.

S# show sdm prefer                                !  Returns the currently running SDM template, what that template is generally used for, and how the device has allocated system memory to certain features. And template after reboot.

S(config)# ip routing                        ! Enabled IP routing in general on the device. (if above is not done, IOS will say “% Invalid input detected at ‘^’ marker.”.

S(config)# int X

S(config-if)# no switchport                ! Changes this particular int to a ‘routed port’ which enables IP routing on it.

S(config-if)# ip add {x} {x}

S(config)# int vlan {#}                        ! Creates a virtual int that can be reached by any physical interface (just like a loopback interface) but only from devices within that same VLAN (which is different from a loopback int) (also, the vlan must be active. e.g. int vlan 99 only go’s up/up if vlan99 is active on the S).

S(config)# int g0/1

S(config-if)# switchport autostate exclude        ! This makes an int (typically a SPAN, or other kind of monitoring int) no count for if the ‘int vlan’ is up. I.e. a vlan int ewill only be up if atleast one int in that vlan is up, but this cmd makes this particular int not count towards that requirement.

! Verification:

S# show ip route                                ! This should only work if routing (L3) is enabled on the device.


                IP route vs IP Default-Gateway

S(config)# ip route 0.0.0.0 0.0.0.0 x.x.x.x [1]                        ! This is installing a L3 route, used for [L3 / MLS, this is the address it sends host traffic to. 1 at end = AD. (think: this same cmd you’d use on R)

S(config)# ip default-gateway x.x.x.x                                ! This is for a L2 S, setting the S’ default gateway, as in the MGMT traffic

Gateway of Last Resort

(config)# ip route 0.0.0.0 0.0.0.0 172.19.26.254 [254]                                        ! 254 at end = manually setting AD for this route. This is example of floating static route.

                  ! this adds static route saying if going 0.0.0.0/0 (i.e anywhere) send it to 172.19.26.254, but only if there are no other routes to it (because of the crazy high AD).

                ! ie if there is some other routing protocol that knows how to get to this net, use that instead, this is a floating static route (a backup route) in case nothing else is available.


FHRP: First Hop Redundancy Protocol

Name

Full Name

Origin

Redundancy

Load Balancing

Default Hello interval

Default Hold interval

Preemption is default?

Built-in Int Tracking?

Authentication?

HSRP

Hot Standby Router Protocol

Cisco

Active/standby

Per subnet

3s

10s

No

Yes

MD5

VRRP

Virtual Router Redundancy Protocol

RFC 5798

Active/standby

Per subnet

1s

3s

Yes

No

No1

GLBP

Gateway Load Balancing Protocol

Cisco

Active/Active

Per host

3s

10s

No

No

MD5

1Cisco Devices disobey the RFC and allow VRRP MD5 authentication to be configured.

HSRP: Hot Standby Router Protocol

v1 HSRP

v2 HSRP`

Feature

No

Yes

IPv6 support

Second

Millisecond

Smallest unit for hello timer

0 - 255

0 - 4095

Range of group numbers

0000.0C07.ACxx

0000.0C9F.Fxxx

Mac Add used (xx / xxx is the hex group #)

UDP port 1985

UDP port 1985

Communication style

224.0.0.2

224.0.0.102

IPv4 multicast address used

No

Yes

Unique identifier for each R?

! SETUP

(config)# standby version {1 | 2}

(config)# int VLAN80

(config-if)# ip add 192.168.1.5

(config-if)# standby 0 ip {vip}                                ! (host's default gateway set to this) (0=stanbyGroup in this case)

(config-if)# standby 0 name NETWORK_ONE

(config-if)# standby 0 priority {200}                        ! (higher=better, default=100, determines who is active R)

(config-if)# standby 0 preempt                                ! (if R1 fail & R2 become activeR, R1 now regain activeR when back online)

(config-if)# standby 0 preempt delay minimum {10}                ! (seconds required before R can preempt / re-become activeR)

(config-if)# standby 0 timer {1} {3}                        ! (default. 1: how often send hello. 3:missed hellos before change)

! AUTHENTICATION

(config-if)# standby 1 authentication md5 key-string [0 | 7] {passPhrase}        ! this will: use the MD5 digest/hash of passPhrase for authentication of all HSRP msgs of this HSRP instance.

(config)# key chain {keyChainName}                        ! Create key chain. One might name this key chain “HSRP”.

(config-keychain)# key {key#}                                ! Create a key on the key chain

(config-keychain-key)# key-string {passPhrase}        ! Create the key string (the ‘grooves’) of the key. Enter here the plaintext passphrase.

(config)# int VLAN80

(config-if)# standby 0 authentication md5 key-chain {keyChainName}        ! References the keychain rather than creating a key-string.

! HSRP INT TRACKING

(config-if)# standby [standby#] track {int} [priorityCut]                ! in this example, if int goes down, priority decrements by “priorityCut

! if priorityCut omitted, 10 is assumed.

! if standby# is omitted, 0 is assumed.

! HSRP OBJECT TRACKING

(config-if)# standby {standby#} track {track#} decrement {10}        ! Once “track#” has already been created, this Makes HSRP instance use the tracker “track#”. If “track#” fails, decrements by 10.

! See IP SLA SECTION to create the tracking instance (the track#)

! VERIFICATION AND TROUBLESHOOTING

# show standby [brief]                                        ! Returns HSRP status. “active router:local” = this is the HSRP active device.

# show standby [authentication]                                ! Use this for troubleshooting authentication.

# debug standby [events | errors]

VRRP: Virtual Router Redundancy Protocol

(config-if)# ip address x.x.x.x 255.255.255.0

(config-if)# vrrp {group#} ip {vip}                                ! group# can range from 0 - 255.

(config-if)# vrrp {group#} priority {0 - 255}

(config-if)# vrrp {group#} authentication md5 key-string {passphrase}

(config-if)# vrrp {group#} track track# decrement {20}                ! See IP SLA SECTION to create the tracking instance (the track#)

# show vrrp [brief]                                                ! for the non-brief output Notice that 0000.5e00.01XX where XX = hexadecimal version of the group#

GLBP: Gateway Load Balancing Protocol

https://www.youtube.com/watch?v=ujApoqozzsE

(config-if)# ip address x.x.x.x 255.255.255.0

(config-if)# glbp {group#} ip {vip}                                ! GLBP group# can range between 0 - 1023. non-AVGs do not need this cmd for the vip specified as they can learn it from the AVG.

(config-if)# glbp {group#} priority {0 - 255}                        ! Priority defaults to 100.

(config-if)# glbp {group#} preempt

(config-if)# glbp forwarder preempt delay minimum {30}                ! Default 30

(config-if)# glbp {group#} load-balancing [round-robin  | weighted | host-dependant]        ! Default is round-robin.

(config-if)# glbp {group#} authentication md5 key-string {passphrase}

(config-if)# glbp {group#} track track# decrement {20}                ! See IP SLA SECTION to create the tracking instance (the track#)

(config-if)# glbp {group#} weighting 110 lower 20 upper 50

(config-if)# glbp {group#} weighting track track# decrement {50}                !                 !

# show glbp


NetFlow

Netflow consumes additional memory

netflow netflow con only be used in a unidirectional flow

R1(config)# int g0/0

R1(config-if)# ip flow ingress                        (captures data incoming on g0/0)

R1(config-if)# ip flow egress                        (captures data outgoing on g0/0)

R1(config-if)# exit

R1(config)# ip flow-export destination 192.168.1.3 [2055]                (UDP socket to "collector", 2055=port)

R1(config)# ip flow-export source g0/1                                        (which int to use to connect to "collector")

R1(config)# ip flow-export version 5                                        (higher version = more versatile but not backwards compat.)

R3# show ip cache flow

R3# show ip verbose flow

R3# show ip flow interface                (shows if ingress/egress on which port)

R3# show ip flow export


Logging

r(config)# logging on

r(config)# logging host [ip]

! can also append 'log' to acls, so that IOS knows if there are any specific packets to send to syslog server.

! Create ACLs and append the “log” keyword at the end to log things that match it.

SYSLOG

        https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/esm/command/esm-cr-book/esm-cr-a1.html

! Example of a syslog msg (status messages from networking devices that they create):

00:00:46: %LINK-3-UPDOWN: Interface po1, changed state to up

        ! Breakdown of the above syslog example and what each part means:

        ????????        Sequence#        config)# service sequence-number

        00:00:46        TimeStamp        config)# service timestamps                ! (if you do this you will need to set clock. See the "NTP/time" section)

        LINK                Facility                                                        !what part sent it?

        -3-                Security LvL

        UPDOWN                MNEMONIC        

        "Inter...."        Detail                                                                ! The actual msg

[0 | emergencies]—System is unusable                                                                         

[1 | alerts]—Immediate action needed                                                                         

[2 | critical]—Critical conditions                                         

[3 | errors]—Error conditions                                         

[4 | warnings]—Warning conditions                                         

[5 | notifications]—Normal but significant conditions                                         

[6 | informational]—Informational messages                                         

[7 | debugging]—Debugging messages                                         

(config)# int lo 0

(config-if)# ip add [x] [x]                                ! (loopback so even if int's go's down, will still try to tell SyslogSrvr via other ints

(config)# logging source-interface lo 0                ! send syslog logs via this int

(config)# logging host 10.0.0.2  [ transport { tcp | udp } [ port port# ] ]                                 ! (sets syslog server to send to).

# show logging

(config)# logging console [severity]                                ! (send logs to the console port e.g. line con 0)

(config)# logging vty                                ! (so can see logs when SSH'ed)

# show logging                

(config)# logging buffered                        ! buffers logs

# show logging | begin Jun 12 22:15                ! sort

(config)# logging trap 4                        ! Specifies where the line is between syslogs worth sending, and syslogs not worth sending. sends level 4 & below (not 5+)

(config)# logging trap warning                ! just a different way of above but using string vs int

# show logging | include changed state to up

# show log                                        ! a ton of logs.

KIWI

! Kiwi Syslog Server Setup

file

setup

inputs                                ! ports / things above udp & tcp

[ip] (loopback + int to log)        ! enter ip add to accept syslogs from

add

ok                                        ! Then should be accepting those log msgs


Time Protocols: NTP, SNTP, PTP

The system clock keeps track of time internally based on UTC (Coordinated Universal Time). Accurate time is important for logging and certificates (since they are only valid for a certain amount time).

! MANUALLY SETTING TIME/DATE

!

(config)# clock set 23:59:59 25 December 2016        ! Manually set the clock in 24hr UTC format.

(config)# calendar set hh:mm:ss day month year        ! Manually set the hardware “calendar” of the device, (see “Cisco calendar” above) this survives reboots.

! CONFIGURE TIME-ZONE & SUMMER/DAYLIGHT-SAVINGS TIME

!

(config)# clock timezone [CST/CDT] -6 [minutes-offset]

! -6 0 = exactly 6 hours & 0 mins back from UTC. Difference between CST & CDT? D= Daylight Savings; S= Standard (not Daylight Savings). Default timezone is UTC.

(config)# clock summer-time CDT recurring [week day month hh:mm week day month hh:mm [offset]]

! recurring=use fancy equation for when daylight savings starts & ends. “week” = 1 - 5 or last. “Day” = e.g. Monday. “Date” = 1 - 31. “offset” = minutes to add during summertime (60 default)

! if parameters are not set, fallows United States summer time rules. (can vary wildly from city to city and country to country)

(config)# clock summer-time zone date date month year hh:mm date month year hh:mm [offset]                        ! Manually set time change. 1st date = summertime start; 2nd date = summertime end.

! NTP GENERAL

!

(config)# ntp source {int | ipAddr}                        ! Uses this for NTP. Recommend interface loopback.

(config)# ntp enable                                        ! Enables NTP. This is the default but I does not show in the running-config.

! NTP ACL

!

! configure the ACL first. See ACL for how.

(config)# ntp access-group {peer|serve|serve-only|query-only} {acl#}                                ! applies an acl to ntp

! NTP (SERVER) AUTHENTICATION

!

(config)# ntp authenticate                                ! Enables NTP authentication.

(config)# ntp authentication-key {key#} md5 passPhrase                ! Define a passphrase/MD5-hash, and identify it with key#.

(config)# ntp authentication-key {key#} md5 passPhrase                ! Define another

(config)# ntp trusted-key {key#} [- key#]        ! Trust NTP messages authenticated with key {key#}. If many, can use a range by appending  [- key#], specifying the last key.

! NTP CX

!

(config)# ntp server svrIp [prefer] [key key]        ! Syncs time from svrIp”. ‘prefer’ if 1< svr, use this 1. [key key] is MD5 authentication of a svr, must match svr’s key. Same cmd for authenticated peers.

(config)# ntp server svrIpv6 version 4                ! “client mode”. This is for version 4 only.

(config-if)# ntp multicast client v6add                ! configures ints to Rx NTPv4 multicasts on the int for v6add.

(config)# ntp update-calendar                        ! Only available on some Cisco devs. This changes the config from the default to now make NTP also update the hardware calendar.

! NTP PEER

! this is actually just

(config)# ntp peer peerIp        [source int] [version {1-4}] [key key#] [prefer]                ! Configures dev to attempt to peer with peerIp.

(config)# ntp peer peerIpv6 version 4                ! Configures dev to attempt to peer with peerIpv6 using NTPv4. “symmetric active mode”.

(config)# ntp server peerIp [prefer] [key key]        ! Reportedly to authenticate a peer, use this cmd, the same cmd used in the NTP CX section above.

! NTP SVR

!

(config)# ntp master stratum                        ! Makes dev an authoritative NTP svr. Do if no other NTP svr available, use high stratum (e.g. 10) so others use better (lower stratum) NTP if available.

(config)# ntp {max | max-associations} 3                        ! Limits the number of NTP associations that a device can have. This helps svrs not get overwhelmed.

(config)# ntp multicast v6add                        ! configures this dev to Tx NTPv4 multicast updates. Recipients will need to be configured with “ntp multicast client …” cmd.

(config-if)# ntp disable                                 ! Svrs use this on ints to other nets to prevent serving them, but can still act as a cx on those ints.

(config-if)# ntp server v6add version 4                 ! Configures dev as NTPv4 server.

! VERIFICATION

!

# show ntp access-groups

# show calendar

23:59:59 UTC Sun Oct 8 2017

# show clock detail                                        ! optional [detail] parameter was used for the returned data below. [detail] adds timezone and summertime info.

23:59:59.999  UTC  Sun  Oct  8  2017

Time  source  is  user  configuration                        ! source may also be “hardware clock” and more

Summer time starts 02:00:00 CDT Sun Mar 8 2017

Summer time ends 02:00:00 CDT Sun Nov 1 2017

# show ntp status

Clock is synchronized, stratum 2, reference is 172.18.0.42

nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**10

ntp uptime is 1500 (1/100 of seconds), resolution is 4000

reference time is D67E670B.0B020C68 (05:22:19:043 PST Mon Jan 13 2017)

clock offset is 0.0000 msec, root delay is 0.00 msec

root dispersion is 630.22 msec, peer dispersion is 189.47 msec

loopfilter status is ‘CTRL’ (Normal Controlled Loop), drift is 0.000000000  s/S

system poll interval is 64, last update was 7 sec ago.

        ! Notice that “stratum 2” means that this dev associates with a stratum 1 svr.

        ! Should say “clock is synchronized” && say stratum && reference.

# show ntp associations [detail]                                                        ! [detail] parameter not used for the returned data shown below.

address        ref clock        st        when        poll        reach        delay        offset                disp

*~1.1.1.1          .LOCL.        1        24        64        17        1.000        ~0.500        2.820

+~2.2.2.2  1.1.1.1        2        21        64        16        0.0        -1.00                0.0

* sys.peer,        # selected,        + candidate,        - outlier,        x falseticker,        ~ configured

        ! “*” means we’re associated with this. Other show “+” meaning those are alternative/backups.

        ! Notice 1.1.1.1 is a svr but not a client, i.e. it uses its own hardware clock as a source.

        ! Notice 2.2.2.2 is both our peer and a client of svr “1.1.1.1”.

(config)# sntp authenticate

(config)# sntp authentication-key {key#} md5 passPhrase                ! Define a passphrase/MD5-hash, and identify it with key#.

(config)# sntp server x.x.x.x

! VERIFICATION

!

# show sntp

! DEBUG

!

# debug sntp select

# debug sntp packets [detail]


DHCP: Dynamic Host Configuration Protocol

R(config)# ip dhcp excluded-address [start] [end]                        ! do this for addresses that, although are in the part of the “network i.i.i.i s.s.s.s” command, but should not be leased out.

R(config)# ip dhcp pool [PoolName]

R(dhcp-config)# network 172.16.0.0 255.255.0.0

R(dhcp-config)# domain-name eff.org

R(dhcp-config)# default-router 172.16.0.1                                ! can specify multiple ip addresses for multiple gateways.

R(dhcp-config)# dns-server [10.0.0.2]

R(dhcp-config)# lease {infinite | days [hours] [minutes] }                ! Default is 1 day.

R(dhcp-config)# host ip subnetMask                                        ! to configure a static /reserved binding, specify the IP and subnet mask… then use the “hardware-address mac” command

R(dhcp-config)# hardware-address mac

R# show ip dhcp binding [ipAdd]

R# show ip dhcp pool

R# debug ip dhcp server packet

R# clear ip dhcp binding {ipAdd}

-

! Now to make router R get DHCP from ISP (or whatever device this int is connected to).

R(config-if) ip add dhcp                                ! to make this int re-request the DHCP info, just shut no shut it.

-

DHCPv6: Stateless

See IPv6‘s RA definition and other information.

R(config)# ipv6 dhcp pool POOLNAME

R(config-dhcpv6)# dns-server <DNS-SERVER-ADD>

R(config)# int vlan 80

R(config-if)# ipv6 dhcp server POOLNAME                ! This associates the dhcp pool “POOLNAME” to int vlan 80.

R(config-if)# ipv6 nd other-config-flag                        ! nd = NDP. This cmd says ‘hosts should use DHCP for non-address config’, e.g. for DNS?

DHCPv6: Stateful

See IPv6‘s RA definition and other information.

R(config)# ipv6 dhcp pool POOLNAME

R(config-dhcpv6)# prefix 2001:db8:3115:120::/64

R(config-dhcpv6)# dns-server <DNS-SERVER-ADD>

R(config-dhcpv6)# domain-name switch.ccnp

R(config)# int po1

R(config-if)# ipv6 dhcp server POOLNAME                ! This associates the dhcp pool “POOLNAME” to int vlan 80.

R2(config)# int fa0/2

R2(config-if)# ipv6 dhcp relay destination <add> <int>

R2(config)# int vlan 80

R2(config-if)# ipv6 nd prefix 2001:db8:3115:120::/64 no-autoconfig

R2(config-if)# ipv6 nd managed-config-flag                        ! nd = NDP. This cmd says ?

IP Helper / Relay

R(config-if)# ip helper-address {ip}

R(config-if)# ipv6 dhcp relay destination <add> <int>

! Sets R as helper for {ip}. This will forward broadcast to 255.255.255.255 to {ip} for things like DHCP.

! e.g. DHCP server on different subnet=broadcast won’t reach it

! But now with helper, the helper will take that DHCP discover packet, change the source to R and the dest to {ip} (forwarding it).

End-User

C:\> ipconfig /renew && ipconfig /renew6                ! Attempts to fetch an IPv4 and IPv6 address via DHCP.

        IPv6 address …                : 2001:db8:3115:99:a940:91fe:38dd:da0c        ! “Permanent Address” Used for DNS registration and when acting as a server.

        Temporary IPv6 Address …        : 2001:db8:3115:99:75b4:31b7:6c26:50ad        ! “Temporary Address” Auto-generated since “privacy extension” are enabled. Used when acting as a client. Valid/active/prefered for 1day then “deprecated” for 7days.

Link-Local IPv6 Address ...         : fe80::a940:91fe:38dd:da0c%10

C:\> route print -6

GET A LINUX ONE TOO!!

DHCP Snooping

Enabled on the device that sits between devs in the same VLAN (typically access layer L2 switches).

Normal DHCP: DORA Discover Offer Request Ack. In legit DHCP, a device should receive two of these (Discover&Requset or Offer&Ack) BUT NOT BOTH.

DHCP Snooping: When S receives incoming OFFER or ACK (msgs legit DHCP server sends) destined for elsewhere, it check if port trusted or untrusted.

                If Trusted = forwards as normal

                If Untrusted = drops/filters.

DHCP Snooping: S action performed on “DORA” messages per type of port Rx’ed on

Port type DORA msgs Rx’ed on

DISCOVER

OFFER

REQUEST

ACK / NAK

Trusted

FWD

FWD

FWD

FWD

Untrusted

FWD1

DROP

FWD1

DROP

1. “DHCP Snooping”-enabled S will keep track of IP’s and MACs used across untrusted ports and record this in its DHCP Binding Table. See “Untrusted Ports” part above.

S(config)# ip dhcp snooping

S(config)# ip dhcp snooping vlan 1,9,80,666-667

S(config)# ip dhcp snooping information option

S(config-if)# ip dhcp snooping trust

S(config-if)# ip dhcp snooping limit rate 25

S# show ip dhcp snooping [binding]

S(config)# ip dhcp snooping database flash:/snooping.db

! Initiates DHCP Snooping. (like turning on the car but not actually going anywhere yet)

! Enables DHCP Snooping on vlans 1,9,80, & 666 through 667.

! DHCP option 82; Allows insertion of DHCP Relay Agent information into the packets. (enables by default)

! Define an int as trusted/not-monitored (default is untrusted).

! Optional; Limits the DHCP pps (packets per second) that an int can Rx. Where 25 = 25-DHCP-pps max. Typically done on untrusted ints.

! Returns where it’s enabled, trusted ints, rate limits. Binding parameter returns the DHCP Binding table.

Configures where the DHCP snooping database is located??

S# show ip dhcp snooping

Switch DHCP snooping is enabled

DHCP snooping is configured on following VLANs:

80

DHCP snooping is operational on following VLANs:

80

DHCP snooping is configured on the following L3 Interfaces:

Insertion of option 82 is enabled

circuit-id format:

vlan-mod-port

remote-id format:

MAC

Option 82 on untrusted port is not allowed

Verification of hwaddr field is enabled

Verification of giaddr field is enabled

DHCP snooping trust/rate is configured on the following Interfaces:

Interface

Trusted

Rate limit (pps)

-------------------------------------------------------

-----------

----------------

FastEthernet0/5

no

25

FastEthernet0/39

yes

unlimited

S# show ip dhcp snooping binding

MacAddress

IpAddress

Lease(sec)

Type

VLAN

Interface

------------------------------

--------------------

-----------------

------------------------

---------

---------------------------

29:CB:AF:5W:9D:13

192.168.1.3

81930

dhcp-snooping

80

FastEthernet0/5

00:9A:00:00:C2:AA

192.169.1.4

80000

dhcp-snooping

80

FastEthernet0/9

Total number of bindings: 2


DNS: Domain Name System

(config)# ip dns server

(config)# ip domain-lookup                                                                ! Enables this device (e.g. R1) to perform DNS Lookups for itself. Enabled by default.

(config)# ip name-server 8.8.8.8 8.8.4.4                                                ! Defines two IP adds to be used as DNS servers for name resolution on this dev .

DNS Relay

(config)# ip dhcp pool 10

(dhcp-config)# no dns-server 8.8.8.8                                ! Remove any previous dns servers that were being delivered to DHCP clients

(dhcp-config)# dns-server 10.0.0.1                                ! Provide DHCP clients with 10.0.0.1 as a DNS server.


Loopback Interface

Loopback is a virtual interface

     Benefit?

Can give this virt int an ip add that is NOT connected to any particular physical int.

This virt int, in a way, gives the entire device an IP add.

     Benefit?

With something like OSPF, you would be able to contact a specific device even if one of it's interfaces is down.

e.g. a normal ip add is attached to a specific physical int. If that int go's down, so does the IP

     so if you were trying to SSH to a specific device, and you used the IP add of

e.g. R1 has 3 ints. g0/0 , g0/1, loopback0.

     g0/0 = 192.168.2.1

     g0/1 = 192.168.3.1

     l0   = 192.168.4.1

if you try SSH to 2.1, g0/0 must be up, if it is down then SSH fail.

but if you try 4.1 (l0), and have OSPF, then you will be able SSH even if one of the ints is down!

Also something something use loopback ints for OSPF so it never goes down? see other notes...

>Router ID chosen like this...

>if: explicitly configured

>else: ipv4 loopback

>else: highest active ipv4 add


Routing Protocols

Metrics        

Metric

IGP

Description

Hop Count

RIPv2

Hops from R to Dest

Cost

OSPF

Sum of all int costs in route to dest, based on int bw

BW + Delay

EIGRP

Calculated by slowest link in route to dest, and sum of delay with each int in route to dest.

RIPv2

EIGRP

OSPFv2

Feature

Hop count

BW + Delay

Cost

Metric based on

Yes

No

No

Sends periodic Full-updates

No

Yes

Yes

Sends periodic Hello-msgs

Yes

Yes

Yes

Uses route poisoning for failed routes

16

(2^32)-1

(2^24)-1

Metric considered to be infinite

224.0.0.9

224.0.0.10

225.0.0.5-6

Address to which msgs are sent

Yes

Yes

No

Uses split horizon to limit updated about working routes

Feature

RIPv1

RIPv2

EIGRP

OSPF

IS-IS

Classless/sends mask in updates/supports VLSM

No

Yes

Yes

Yes

Yes

Algorithm (DV, adv-DV, LS)

DV

DV

Adv-DV

LS

LS

Supports manual summarization

No

Yes

Yes

Yes

Yes

Cisco-proprietary

No

No

Yes*

No

No

Routing updates sent to a multicast IP add

No

Yes

Yes

Yes

-

Convergence

Slow

Slow

Fast

Fast

Fast

                *EIGRP was released in an informational RFC in 2013 allowing other vendors to implement EIGRP while Cisco still holds the rights.

                Route redistribution: eg R does both EIGRP and OSPF (R connects two dif orgs, each uses diff IGP). This R redistributes routes learned by one IGP into the other!

                

                But what happens if R has routes to same network learned from more than one routing protocol? If the routing protocols use different metrics?

                        Answer: R chooses the routing protocol with the lower ‘administrative distance’ (AD).

AD

Route Type

0

Connected

1

Static

20

eBGP (external)

90

iEIGRP (internal)

100

IGRP

110

OSPF

115

IS-IS

120

RIP

170

eEIGRP (external)

200

iBGP (internal)

254

DHCP default route

255

Unusable

# show ip route                                        ! AD = First # in brackets, Metric = 2nd # in brackets

R(config-router)# redistribute static                                                ! Advertisers static routes into whatever routing protocol we are currently configuring.

R(config-router)# redistribute ospf 2                                                ! Advertisers routes learned from the 2nd OSPF instance into whatever routing protocol we are currently configuring.


Bandwidth

R(config-if)# bandwidth 512        ! this would set reported bandwidth to 512Kb/s, not the actual physical BW of the link, but tells IOS (& EIGRP by extension of IOS) what speed to assume it is using.


DV: Split Horizon


Route Poisoning

Method used by routing protocols (OSPF, EIGRP) to adv a failed route.

R1 has it’s int G0/1 die. It will use its routing protocol to adv to others that everything R1 learned from that int now has a metric of 'infinity’ and therefore cannot be used by R1.

Other Rs will save that to their routing table for a while (replacing the previous entry learned from R1) to see if there is another route to that network, if not, it will remove the network from its routing table (removing the infinity-metric route).

Each routing protocol has a different number to represent infinity metric. OSPFv2 uses 2^24-1, while EIGRP uses 2^32-1 (~4billion).


RIP: Routing Information Protocol

RIP uses ONLY hop-count (no cares for speed / AD.)

RIPv2

uses UDP port 520 (while OSPF and EIGRP do not use UDP or TCP)

RIPng

supports IPv6


OSPF: Open Shortest Path First

3 steps:

  1. Become neighbors
  1. To become neighbors, requires each R has the same:
  2. OSPF area
  3. hello timer intervals
  4. dead timer intervals
  5. (if authentication:) passwords must match between routers
  1. Build & flood LSAs (so all Rs in the area share the same LSDB)
  2. Each runs Dijkstra's Shortest Path First (SPF) algorithm to calculate routes

R(config)# router ospf {instance#}                                        ! Instance number can be 1 - 65535

R(config-router)# auto-cost reference-bandwidth 10000                ! (same all Rs, in mb/s, default=100, use 10,000 if 10 gig ports in future)

R(config-router)# router-id {15.1.1.1}

R(config-router)# default-information originate [always]                        ! this R advs it’s default route via OSPF;(even if learned static/DHCP/eBGP); {always}=adv default-route even if it’s down/nonexistent

R(config-router)# network {ip} {wc} area {#}                                        

R(config-router)# passive-int {int}                        ! (NO Tx/Rx OSPF Hello-msgs. Subsequently no neighbor relationships. OSPF CAN STILL ADV THIS THOUGH!

R(config-router)# maximum-paths {#}          ! Max paths for load balancing to 1 network. if costs are same, load balance the setting controls how many equal cost paths can be put into routing table.

R(config)# int {loopback 0}                                ! If not using ‘router-id’, then this will determine RID (as long as up w/ IP add)

R(config-if)# ip ospf {#} area {0}

R(config-if)# ip ospf priority {128}                        ! Default:128; 255=DR; 0=neverDR

R(config-if)# ip ospf cost {#}                        ! This directly controls the int’s OSPF cost. COmpared to changing either the Ref_BW or Int_BW, setting cost is more direct & better.

                                                                Dijkstra’s SPF interface cost: ‘Reference_BW’ / ‘Int_BW’

                                                                        (Reference_BW divided by Int_BW)

                                                                        (

R# clear ip ospf process                                ! ‘shut no shut’s the ospf process. Will re-pick RID and more.

                Alternatively

R(config-router)# passive-interface default                ! default now becomes that all interfaces are passive-interfaces

R(config-router)# no passive-interface {g0/0}                ! NOTE: this cmd is still used in OSPF configuration mode.

R# show ip ospf interface [g0/0]                                ! append_[g0/0]_optional;  look for line saying “No Hellos (Passive interface)”                                        !

Config > OSPF int > OSPF neighbor > OSPF database > route OSPF

(this is order: enabled ospf on an interface, then they become neighbor        rs, then exchange LSDB containing LSAs, then each use dijkstra's SPF to calculate routes)

(int > neigh > db > route)

# show ip ospf interface {brief}                         ! WILL SHOW WHO DR

# show ip ospf neighbor                         ! lists all neighbors INCLUDING DR

                

# show ip ospf database                         ! Lists contents of LSDB, here you can see the LSAs

                

# show ip route {ospf}                                                ! Notice if “O IA” meaning INTER-area, meaning route from to OSPF area

                

# show ip protocols

                ! RID:                                 

if: configured by “R(config-router)# router-id {15.1.1.1}”

else: Highest active loopback int IP                (ie largest IP of active Loopback ints. With int status code up/down or up/up status)

Else: Highest active int I

                        !        “R# show ip ospf” to see RID

when two R try become neighbors, they go through the neighbor requirements.

to check, use

R# show ip ospf int

! to check hello and dead timers, same area, and authentication

also check if RIDs are unique with

R# show ip ospf

alternatively

R# debug ip ospf [hello | adj]

if multiple commands are telling an int to use different areas. Such as multiple network statements and an interface osf statement. The order of preference is:

Interface command (ip ospf 1 area 0),

then the first network statement (one closer to the top of the running-config)

finally any other statements.

EVEN IF ONE NETWORK STATEMENT IS MORE SPECIFIC, DOESN'T MATTER. THE FIRST ONE.

show ip ospf int

ospf-

Router w/ highest RID = DR

Router w/ 2nd highest RID = BDR

show ip ospf neighbor

    FULL = full neighbor

show ip protocols

    OSPF process ID

    RID

    nets advertized

    neighbors

    default admin distance

            (for OSPF: 110)

show ip ospf  

    OSPF process ID

    RID

    OSPF SPF

    OSPF area info

show ip ospf interface

    list of OSPF-eabled ints

    if 'Network' statements correct

show ip ospf interface brief

    summary & status of OSPF ints

 

 Open Shortest Path First

OSPF

 

Neighbor Table

Link State Database (LSD)

Routing Table

 

Neighbor Table:  

    used to store data about adjacent neighboring Routers

Use Hello messages to discovery OSPF routers, add their info to neighbor table (and to LSD)

 

Link State Database:

    Database of all different networks in environments, and all possible paths to reach those networks.

Uses "Link State Advertizements" (LSAs) to to fill LSD

 

Run Shortest Path First Algorithm against LSD, which then populates the OSPF routes in the Routing Table.

__

For two Routers to become Neighbors:

must be directly connected

Same Subnet/Mask (AKA same network)

Hello-Interval & Dead-interval must match

    (timers for OSPF)

Area ID (usually Area ID: Zero)

Authentication (is used)

Stub Area Flag

MTU Size must match

 

 

all connect to DR & BDR, if DR down than BDR becomes DR and new BDR is chosen.

If original DR comes online again, no change/aka original DR does not become DR again.

 

You would have to reset the new DR and BDR but that would cause interruptions.

 

chosen by higher"Router ID", if not ID than Address (?) and then by interfaces (even those not used)

 

Neighbor States

Down    -    no hello received

Init    -    Hello received, yet to respond

2-way    -    hello messages exchanged

ExStart    -    Master router/slave router selected

Exchange-    Database descriptor packets exchanged, to build LSD

Loading    -    Link state requests/link state advertisements exchanged (when Net changes)

Full    -    once synced, Neighbor relationship established

 

LSA: Link State ad

LSA Type            Function

1    Router            Used to advertise Point to Point Nets

2    Network            Used to advertise Ethernet Networks

3    Network Summary    Used between areas

mote types as well

 

wild card mask = inverse of Subnet Mask

-------------

more ofps, that needs to be merged w/ main OSPF category

ospf

224.0.0.5:        All OSPF Rs

224.0.0.6:        All OSPF DRs

OSPFv3: IPv6

do above first^

R(config)# ipv6 unicast-routing                        (this on Rs, do SDM on L3S'es)

R(config)# ipv6 router ospf [#]

ipv6 ospf, must do on the ints.

can check that it is there with Show run

and look for "ipv6 ospf [#] area [0]"

if not there, then go to int and put there

R(config-if)# ipv6 ospf [#] area [0]"

no ospf network cmds for OSPFv3.

ospfv3 is tweak to allow ipv6 on ints (not networks)

-

>^Then on each active int that you want OSPF...

>(passive int= no send ospf out this int, will advertize the int/net though)

>(passive int= will advertize the int to other NON-PASSIVES, but will not send hello msgs to this int. ie tell others of this but don't tell it of others)

-

>Router ID chosen like this...

>if: explicitly configured

>else: ipv4 loopback

>else: highest active ipv4 add

# show ipv6 route ospf

R(config)# ipv6 router ospf 10

R(config-router)# router-id 2.2.2.2                                        ! The RID may need to be different from the OSPFv2 RID, but this may or may not be true.

R(config-router)# auto-cost reference-bandwidth 1000

R(config)# interface G0/0

R(config-if)# bandwidth 1000000

R(config-if)# ipv6 ospf 10 area 0


EIGRP: Enhanced Interior Gateway Routing Protocol

(config)# router eigrp [1]                                        #= AS# / Process ID #, must match on devs

(config-router)# eigrp router-id x.x.x.x

(config-router)# no auto-summary                                ! auto-summary automatically assumes classful subnetting; Only works on classful adds / non VLSM

(config-router)# network [10.0.10.0] [0.0.0.255]                ! Net & WC to advertise

(config-router)# passive-interface F0/0                        ! says IF "rtr# network ..." exists, don't form adj but adv (drops tx’ed and rx’ed eigrp hellos)

(config)# int g0/0

(config-if)# ip hello-interval eigrp [1] [5]                        ! AS#=1, 5=how often send hello in s. 5=default

(config-if)# ip hold-time eigrp [1] [15]                        ! AS=1, 15=long until no hello = dead? 15 default

(config)# int g0/1                                                ! send summary ad out this int; must do on all ints want to send to)

(config-if)# ip summary-address eigrp [1] [summary-add] [SubMask]  ! this tells all devs across g0/1 that we have a route to summary-add.

(config-if)# bandwidth 512                (this would set bandwidth to 512Kb/s. This does not change the actual physical BW of the link, but tells IOS (& EIGRP by extension of IOS) what speed to assume it is using)

(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.7 [1]                        ! 1 at end = manually setting the AD of this route

(config)# router eigrp 1

(config-router)# redistribute static

# show ip protocols | i redistributing static

# show ip route | i 0.0.0.0                        (should be "D*EX"; D=DUAL, *=possible Default Route, ED=External EIGRP, AD = Admin distance of 170

# show ip eigrp neighbors                ! lists EIGRP neighbors (ip, int, uptime)

# show ip route eigrp                        ! learned by D = learned by DUAL.Lists metric

# show ip eigrp topology                ! TopDB w/ metrics

R# show ip protocols

! what nets adv

EIGRP sends occasional ‘EIGRP-Hello’ msgs to multicast 224.0.0.10 (and the IPv6 variant) to let others know that R is still up and running.

When two eigrp Rs try to form relationship and become neighbors, they must pass these steps

  1. can communicate                ! show ip int brief && ping
  2. pass EIGRP auth                ! debug eigrp packets
  3. same ASN                         ! show ip protocols
  4. same subnet used by ints        ! Each int must be ‘directly connected’ to other int
  5. same K values                ! show ip protocols

Then added to neighbor-table.

        # show ip eigrp neighbors                ! lists EIGRP neighbors (ip, int, uptime)

Once in neighbor table, neighbors exchange full-updates (containing all known routes; this is the only time full-updates are sent), by sending via RTP unicast if to one R, or RTP multicast 224.0.0.10 (or IPv6 variant) if more updating more than 1 R in subnet. that information is used to create the “Topology-table”.

        # show ip eigrp topology                ! TopDB w/ metrics

FInally each R uses their own “Topology-table” to calculate their lowest metric route to each learned subnet. The best ones are added to their “Routing-Table”.

        # show ip route [eigrp?]

EIGRP update use ‘reliable transport protocol’ instead of TCP or UDP.

EIGRP only sends partial updates when something changes. And only full updates once, after becoming neighbors.

EIGRP sends ‘update’ messages when something in topology changes. these messages are sent to either: 1. the unicast address of 1 device 2. the multicast address of ‘224.0.0.10’. These updates are sent (not with TCP or UDP) but Reliable Transport Protocol (RTP), not to be confused with Real-time Transport Protocol (VoIP).

Full update = all known routes

Partial update = only info about recently changed routes

https://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/13681-eigrpfaq.html

EIGRPv6

(config)# ipv6 unicast-routing                (this on Rs, do SDM on L3S'es)

(config)# router eigrp {2}                (must be diff AS# then v4)

(config-rtr)# eigrp router-id {2.2.2.2}

(config-rtr)# passive-interface F0/0        (says IF "int# ipv6 eigrp 2" exists, don't form adj but adv

(config-rtr)# no shutdown                (THIS IS REQUIRED FOR v6!)

(config)# int g0/0

(config-if)# ipv6 add FE80::1 link-local

(config-if)# ipv6 add 2001:ACAD::1/64

(config-if)# ipv6 eigrp 2                (2=AS#)

(config-if)# ipv6 hello-interval eigrp [1] [5]                (AS#=1, 5=how often send hello in s. 5=default

(config-if)# ipv6 hold-time eigrp [1] [15]                (AS=1, 15=long until no hello = dead? 15 default

(config-if)# ipv6 summary-address eigrp [1] [summary-add] [SubMask]  

# show ipv6 eigrp neighbors            lists EIGRP neighbors (ip, int, uptime)

# show ipv6 route eigrp                learned by D = learned by DUAL.Lists metric

# show ipv6 eigrp topology             TopDB w/ metrics

EIGRP: Configure Bandwidth that EIGRP can use

(config)# int s0/0/0

(config-if)# ip bandwidth-percent eigrp 1 50                ! (50=50% is max percentage of bandwidth that EIGRP can use)

EIGRP: Authentication w/ MD5

                                //uses a pre-shared key

                                //multiple keys can be configure

                                //IPv6 is same but use "ipv6" instead of "ip"

EIGRP: Create a Keychain & Key

R(config)# key chain {name-of-chain}                                                //^Created key chain

R(config-keychain)# key {key-ID}                                        //# used to ID key; best for Rs to use same #

R(config-keychain-key)# key-string {key-string-text}        //keyString is the pre-shared key;ie password

EIGRP: Configure EIGRP auth using keychain & Key

                                        //Do this on all EIGRP enabled ints

R(config)# int {G0/0}

R(config-if)# ip authentication mode eigrp [AS#] md5

R(config-if)# ip authentication key-chain eigrp [AS#] [name-of-chain]

____

Below info needs to be merged into the above main section:

EIGRP (ex proprietary protocol by Cisco)

Metric Calculation:

*Bandwidth    Configured

*Delay of Line    Configured

Reliability    Measured

Load    -    Measured

* = Default

Measured Values are bad because then you as NetSpec Do not know exactly how your Network is operating.


BGP: Border Gateway Protocol

R(config)# router bgp {AS#}                                        ! enables BGP, defines AS# to use

R(config-router)# bgp router-id {RID}                                ! Just like OSPF, if not manually defined uses largest active loopback add, else uses largest active int add.

R(config-router)# neighbor {ip} remote-as {AS#}                        ! add neighbors; enter info of peer)

R(config-router)# neighbor {ip} update-source {Loopback0}        ! use a loopback int because: if multiple links between this R and neighbor, will load-balance + redundancy, also

R(config-router)# neighbor {ip} ebgp-multihop {1}                                ! Think this is required when using ‘update-source Loopback#’ since eBGP usually requires hop-count 0 (aka directly connected) this cmd changes that.

R(config-router)# neighbor {ip} password {pass123}                ! Optional, but adds MD5 authentication.

R(config-router)# neighbor {ip} shutdown                                ! Puts neighbor relationship into “Administratively down / Idle”. Idle if looking at ‘show ip bgp summary’

R(config-router)# network {net-add} mask {sub}                        ! internal nets to adv, list all nets in AS, not just directly connected)

! (this commands adds the NLRI, which contains prefix/length info + PA, to its BGP table if there is an exact same match in the IP routing table)

! omitting ‘mak {sub}’ causes IOS to assume classful addressing. Explicit > implicit, therefore avoid this.

                                        (share these routes via internal routing protocol e.g. OSPF [default-information originate], EIGRP)

R# show ip route

R# show ip bgp

R# show ip bgp summary                                                ! This also lists neighbors/peers.

!In “State/PfxRcd” column of peers:

‘idle’=shutdown/waiting to retry,

‘connect’=attempting but not completed,

’Active’=tcpComplete but no BGP msgs,

‘Opensent’=tcp complete and we sent BGP open msgs, we sent first message used to create BGP neighborship

‘Openconfirm’= TCP complete, received BGP-open message attempting to build neighborship

‘Established’= Rs are now neighbors/peers, and can exchange BGP update msgs.

R# show ip bgp neighbors

Is Exterior gateway Protocol; for routing between AS's

Advertises ‘network prefixes’ and prefix length (like summarized routes) (formally ‘NLRI’s : Network Layer Reachability Information) and instead of individual subnets. I.e. route summarization.

BGP uses ‘route attributes’ in comparison to a single metric.

Uses ‘update’ messages to send “NLRI”s to peers (which contain prefix/length info) and “PA”s (Path Attributes)

TCP port 179 used to share BGP info

two types; Internal BGP (iBGP ; used between R's in same AS) & External BGP (eBGP) for inter-AS.

Never use BGP when only one route out of AS(use static default route), or when limited knowledge of BGP since misconfigurations can impact entire internet

Ways BGP is implemented:

        Default route only

                ISPs send only default route to org, sub optimal routing if org uses ISP 1 as default route but destination net is on ISP2

        Default route & ISP routes

                ^Like default route but ISP also adv their nets

        All internet routes

                ISP adv routes and metrics to both their AS nets AND OUTSIDE NETS; always optimal routing but adds >600,000 routes to

        (BGP Home Terminology)

How many redundant connections (to each ISP) | How many different ISPS

Links/ISP

1 ISP

 Multiple ISPs

1 link

Single Homed

Single Multihomed

2 links

Dual Homed

Dual Multihomed

3 links

Triple Homed

Triple Multihomed


ACLs: Access Control Lists

(e.g. “access-list 1 permit 1.0.0.0 0.255.255.255” “access-list 2 deny 1.1.1.0 0.0.0.255” then a packet with add 1.1.1.1 came, it would match the first one before even reaching the 2nd)

There are different types of ACLs. They be standard or extended, and each may be either numbered or named.

Extended: Matching -Source & Dest. IP -Source & Dest. Port -Others

Standard: Matching -Source IP

Named:

-ID with Name -Subcommands

Extended Named

Standard Named

Numbered:

-ID with Number -Global Commands

Extended Numbered

Standard Numbered

# show access-lists                        ! will show both IPv4 ACLs and IPv6 ACLs

# show ip access-lists                        ! will show only IPv4 ACLs (because “ip” is IPv4 and “ipv6” is IPv6).

# show ip interface g1/0/1                ! you will see “outgoing access list is x” and “inbound access list is x”.

R(config)# access-list … log                ! “log” will generate syslog msgs occasionally, w/ something like “Feb  4 18:30:24.082: %SEC-6-IPACCESSLOGNP: list 7 permitted 0 10.2.2.1 -> 10.2.9.9, 1 packet”

eq = equals

neq = not equal to

lt = less than

gt = greater than

range = range (x to y ?)

ACL: Extended Named

R(config)# ip access-list extended aclname

R(config-ext-nacl)# [sq#] permit [tcp|udp] source wc dest wc [eq|neq|lt|gt] [port] [established] (log)

! if tcp or udp, can also match against ports by appending something like “eq 80”. (ios will recognise and convert some. e.g. 80 to www). see below for those and “established” in reflexive acl. you can put these after both the source wc and also after the dest wc.

R(config-ext-nacl)# [sq#] deny ip any any

ACL: Extended numbered

Place standard ACLs as close to the source as possible to conserve bandwidth, this is in contrast to standard acls (which should be as close to the dest as possible because they cannot filter the dest).

R(config)# ip access-list extended {name}

R(config)# access-list {100-199 | 2000 - 2699} permit [tcp] source wc dest wc eq [port] [established] (log)              ! if tcp or udp, can also match against ports by appending something like “eq 80”. (ios will recognise and convert some. e.g. 80 to www). see below for those and “established” in reflexive acl. you can put these after both the source wc and also after the dest wc.

R(config)# access-list {100-199 | 2000-2699} permit udp host 10.1.1.1 {dest} {wc}                 ! extended acls must use host keyword when specifying /0 wc, in comparison to standard acls which may just list the ip (w/o “host”)

R(config)# access-list {100-199 | 2000-2699} deny ip any any

R(config-if)# ip access-group {acl-name/num}

ACL: Standard Named

R(config)# ip access-list standard aclname      ! note: we now use “ip access-list …”, with “ip”.

R(config-ext-nacl)# [sq#] permit 1.1.1.1

R(config-ext-nacl)# [sq#] permit 2.2.2.2

R(config-ext-nacl)# [sq#] deny any [log]

R# show access-list     ! shows sequence numbers

R(config-ext-nacl)# no sequence#         ! removes an acl entry (e.g. no 30)

ACL: Standard numbered

R(config)# access-list {1-99 | 1300-1999} {permit | deny} 10.1.1.1 [wildcard]           ! If you do not specify a wildcard mask, it is treated as “0.0.0.0”. i.e. the entry would only match that specific IP add.

R(config)# access-list {1-99 | 1300-1999} permit [add] [wildcard]

R(config)# access-list {1-99 | 1300-1999} remark blah blah blah                        ! notes

R(config)# access-list {1-99 | 1300-1999} deny any [log]                                ! This is redundant, but allows you to see the packet match counter via show cmds (while the implicit version of this does not).

R(config)# int {g1/0/1}

R(config-if)# ip access-group {acl-name/num} {in | out}                                        ! This applies the already created ACL (either a named or numbered) to this particular interface, and in the specified direction.

MACL: MAC ACL

! MAC ACL CREATION

(config)# mac access-list extended macl-name 

(config-ext-macl)# {permit|deny} host [sourceMac | any]  [destMac | any]

(config-ext-macl)# {permit|deny} any any                                                        ! Explicit “any any” cmds are typically appended to all ACLs.

! VERIFICATION

# show [mac] access-lists

PACL

! IP PACL

 !

(config-if)# access-group mode {merge | prefer port} 

(config-if)# ip access-group aclName in                        ! This applies an existing (preferably named-extended) access-list to a L2 int, making it an IP PACL.

!  MAC ACL  (MAC ACL becoming a MAC PACL)

(config-if)# access-group mode {merge | prefer port}

(config-if)# mac access-group aclName in                        ! This applies an existing (named-extended) mac access-list to a L2 int, making it a (named-extended) MAC PACL.

! VERIFICATION

# show access-list

VLAM: VLAN Access Map / VACL

! VLAM

!

!  create a mac/L2 access list. See MAC ACL

(config)# mac access-list extended mac-acl-name

(config-ext-macl)# permit host [sourceMac | any] [destMac | any]

!  create a ip/L3 access list. See ACL: Extended Named

(config)# ip access-list extended ip-acl-name

(config-ext-nacl)# permit [protocol] [sourceIp | any] [destIp | any]

!  create a VLAM which uses the mac and IP access lists.

(config)# vlan access-map vlam-name [sq#]

(config-access-map)# action {forward [capture] | drop | redirect int} [log]

(config-access-map)# match mac address mac-acl-name

(config-access-map)# match ip address ip-acl-name

(config)# vlan access-map vlam-name [sq# +10]

(config-access-map)# action forward

!  Apply the created VLAM to the desired VLAN(s)

(config)# vlan filter vlam-name vlan-list 2-10

! protocol is typically IP.

! If a datagram matches any of the match statements for this sequence, this action will be taken to said datagram.

! Create a new sequence in the VLAM, the datagram will be evaluated against this after all lower sequenced entries.

! if no match statements, everything matches. Here we drop all traffic (that did not match the above sequence).


! This applies the VLAM to the specified VLANs.

ACL: IPv6

R(config-if)# ipv6 traffic-filter {acl-name/num} {in | out}                                ! Use this, after creating the ipv6 acl, to apply it to the specified interface.

Reflexive ACL                

(https://drive.google.com/file/d/0BzTH5IWRQhLYblpPei04VmlOaWM/view)

(http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/sec_data_acl/configuration/15-mt/sec-data-acl-15-mt-book/sec-cfg-ip-filter.html)

(config)# ip access-list extended [TxFilter]                                                ! Create acl named “TxFilter”.

(config-ext-nacp)# permit tcp any any reflect TcpTxTraffic [timeout seconds]                ! Any traffic matching this rule (ie tcp) will be temporarily added to the “TcpTxTraffic” list. You can specify for how long w/ “timeout”.

(config-ext-nacp)# permit udp any any reflect UdpTxTraffic [timeout seconds]        ! Any traffic matching this rule (ie udp) will be temporarily added to the “UdpTxTraffic” list. You can specify for how long w/ “timeout”.                                                                                                        ! You could replace the above 2 rules with “permit ip any any reflect Xtraffic”, but this would also include traffic types ICMP, EIGRP, GRE, etc.

                                                                                                ! You could also replace the two separate UdpTxTraffic and TcpTxTraffic, with a single TxTraffic, and not have to have two separate “eval” cmds.

                                                                                                ! You can also append (not prepend cuz  prepend could match before being reflected) other Tx rules for ICMP, EIGRP, GRE, etc.

(config)# ip access-list extended {RxFilter}                        ! create acl named RxFilter

(config-ext-nacp)# evaluate TcpTxTraffic                        ! Anything in “TcpTxTraffic” will be matched. This is nesting the above ACL into this ACL.

(config-ext-nacp)# evaluate UdpTxTraffic                        ! Anything in “UdpTxTraffic” will be matched. This is nesting the above ACL into this ACL.

(config)# int [internet-facing-int]

(config-if)# ip access-group RxFilter in                        ! apply "TxFilter" to egress traffic

(config-if)# ip access-group TxFilter out                        ! apply "RxFilter" to ingress traffic

(config)# ip reflexive-list timeout seconds                        ! Default is 300s. This will apply to each reflection that does not manually specify its own timeout value.

# show access-list                                                ! This will only show the TcpTxTraffic & UdpTxTraffic acls, but only if they have entries in them. Else, if empty, they will not be listed via this show cmd.

! If you are configuring reflexive access lists for an internal interface, the extended named IP access list should be one that is applied to inbound traffic. Furthermore, in this situation, you may also flip the names for “RxFilter” and “TxFilter”

routing protocols exceptions

allow these if needed

ripv2: 224.0.0.9 UDP (port 520)

OSPF: 224.0.0.5 & 224.0.0.6 ospf

EIGRP:224.0.0.10 eigrp

R(config)# ip access-list extended aclname      ! note: we now use “ip access-list …”, with “ip”.

R(config-ext-nacl)# [sq#] permit icmp any any echo-reply                        ! allows ICMP echo-reply msgs (not echo requests)

access-list 12 permit udp any any eq domain                 ! DNS
access-list 12 permit udp any eq domain any                 ! DNS
access-list 12 permit tcp any any eq domain                  ! DNS
access-list 12 permit tcp any eq domain any                 ! DNS

access-list 12 permit udp any any eq rip                ! To permit Routing Information Protocol “RIP”

access-list 12 permit igrp any any                        ! To permit Interior Gateway Routing Protocol “IGRP”

access-list 12 permit eigrp any any                        ! To permit Enhanced IGRP “EIGRP”

access-list 12 permit ospf any any                        ! To permit Open Shortest Path First “OSPF”

access-list 12 permit tcp any any eq 179                 ! To permit Border Gateway Protocol “BGP”
access-list 12 permit tcp any eq 179 any

R(config-ext-nacl)# [sq#] permit 2.2.2.2

R(config-ext-nacl)# [sq#] deny any [log]

R# show access-list     ! shows sequence numbers

(ACl: Troubleshooting)

show ip access-list

show access-list

show interfaces

show ip interfaces

! “self-pings” are pings out and in your own int. that won’t test outbound acls (since the own dev created it) but it will test inbound acls. on serial ints, it will actually be transmitted across the medium.

________

<Applying ACLs>

    line vty 0 15

            access-class 10 in

 

    int g0/0

            ip access-group {number | name} {in|out}

</Applying ACLs>


NAT        : Network Address Translation                

show ip nat translate

Changing the destination address can be an option if you are expecting many incoming connections, and want to distribute the load across multiple sources. (have 2 servers serving the same thing, and load balance beween then)

inside-global inside-local outside-global outside-local

global = from perspective of the globe

local = from perspective of within our local network

inside = to our inside interface

outside = to the outside interface

inside-global = our inside interface/net from the perspective of the globe.

inside-local = out inside interface/net from the perspective of within our net.

outside-global =

outside-local =

NAT [fromDoingLab]

can do either "prefix-length 24" or "netmask 255.255.255.0"

                        (NAT: static)

R1(config)# ip nat pool [NAT-R1] 10.65.111.10  10.65.111.14 netmask 255.255.255.0        

        (^make pool of outside adds)

R1(config)#  access-list [1] permit [172.16.0.0] [0.0.255.255] *******

        (^make ACL of inside adds)

R1(config)#interface serial 0/0/0        *******

R1(config-if)#ip nat outside                *******

R1(config-if)#interface fa0/0                *******

R1(config-if)#ip nat inside                *******

R1(config)#ip nat inside source [list 1] pool [NAT-R1]                

        (^apply NAT; turn [these] into [these])

        (^apply NAT; turn [ACL] into [pool])

        (think pool as pool of available global adds)

>^NAT now implemented for packets permitted through ACL 1, and received...

>... on the inside int. The packets get translated to an address from [pool NAT-R1]

                        (PAT; convert from NAT)

acl stays same

nat inside and outside stay same

but the nat pool and the command to enable NAT are REMOVED!

R1(config)# no ip nat pool [NAT-R1] 10.65.111.10 10.65.111.14        

R1(config)# no ip nat inside source list 1 pool NAT-R1                

R1(config)# ip nat inside source [list 1] interface serial  0/0/0 overload ********

        ^[list 1] = acl #

PAT: Port Address Translation - from scratch

int g0/0

ip nat inside

int g0/1

ip nat outside

R1(config)# ip access-list standard NAT_THESE_ADS

        permit 192.168.1.0 0.0.0.255

        deny any

        exit

ip nat inside source list NAT_THESE_ADS int g0/1 overload

                        (^

NAT?

R(config)# ip nat pool [PoolName] [startAdd]  [endAdd] prefix-length 24

R(config)# ip nat pool [PoolName] 10.65.111.15  10.65.111.19 prefix-length 24

R(config)# access-list 1 permit 172.16.0.0 0.0.255.255

R(config)#interface serial 0/0/0

R(config-if)#ip nat outside

-

R(config-if)#interface fa0/0

R(config-if)#ip nat inside

R(config)#ip nat inside source list 1 pool NAT-R1

-

R# show ip nat translation

R# show ip nat translation verbose

        # ^Will show when entry created & when used.

R# clear ip nat statistics

R# show ip nat statistics

R(config)#no ip nat inside source list 1 pool NAT-R1

R(config)#no ip nat pool NAT-R1 10.65.111.10 10.65.111.14

R(config)# ip nat inside source list 1 interface serial  0/0/0 overload

R?# show ip nat translation

        # default translation timeout: 24hrs. Can change with...

R2(config)# ip nat translation timeout [s]

        # to clear all dynamic translations before translation timeout...

R2# clear ip nat translation *

        # to clear specific dynamic translation before translation timeout...

        # can also specify last part i.e. outside local+global

R2# clear ip nat translation inside [global-ip] [local-ip] (outside [local-ip] [global-ip])

        # to clear extended dynamic translation entry...

        # last part is optional ()

R2# clear ip nat translation [protocol] inside [global-ip] [global-port] [local-ip] [local port] (outside [local-ip] [local port] [global-ip] [global-port])

NAT Static Setup

R(config)# ip nat inside source static [IL IP] [IG IP]

R(config)# int [IL int]

R(config-if)# ip nat inside

R(config)# int [IG int]

R(config-if)# ip nat outside

                        (NAT Static removal)

R(config)# no ip nat inside source static [IL add] [IG add]

                or

R(config)# no ip nat inside source static

NAT Dynamic Setup

        # 1. Define a pool fo global addresses to be used for translation.

        # 2. Configure a standard acl permitting the addresses that should be translated.

        # 3. Establish dynamic source translation, specifying acl & pool defined in prior steps.

        # 4. Identify inside int.

        # 5. Identify outside int.

R2(config)# ip nat pool [pool-name] [start-ip] [end-ip] netmask [netmask]

R2(config)# access-list [ACL#] permit [source] [wildCard]

R2(config)# ip nat inside source list [ACL#] pool [pool name]

R2(config)# int [type number]

R2(config-if)# ip nat inside

R2(config)# int [type number]

R2(config-if)# ip nat outside


IP SLA: Service Level Agreement (and tracking)

IP Service Level Agreement

        IOS feature that allows analysis of IP service levels.

        used to measure network performance

        measures: jitter, latency, packet loss, etc

        accessed w/ either CLI or SNMP

(how configure IP SLA ICMP Echo operation)

R# show ip sla application                                        ! (lists supported operation types, verify that icmpEcho is supported)

R(config)# ip sla [sla#]

R(config-ip-sla)# icmp-echo [destIp] [ source-ip x.x.x.x | source-interface g0/0 ]

R(config-ip-sla-echo)# frequency 60                                ! (optional; set rate that operation repeats in seconds; default=60)

R(config)# ip sla schedule [sla#] start-time now life forever        ! (e.g. [sla#]; optional ...

                                                                 ... "start-time now" starts right away other: "after hh:mm:ss"

                                                                 ... "hh:mm:ss <dayOfMonth>" to set exact time to start; dayOfMonth null = assumes this month month

                                                                 ... "pending" = does not start until start time is manually specified

                                                                 "life <forever>" last forever, or specify exact # of seconds; defaults 3600 s      i.e. 1hr )

                                                                 optional: "recurring"                auto runs every day)

R(config)# no ip sla schedule [sla#]                                ! (stops sla operation from occurring anymore)

R# show ip sla configuration [sla#]                                ! Verify correct parameters

R# show ip sla statistics [sla#]                                        ! Shows stats of operations

R# show ip sla application                                                ! Returns the types of IP SLAs that are available.

Tracking

There are at least 2 kinds of tracking: Interface tracking and object tracking.

Note: HSRP can use its own interface tracking. See HSRP.

! Interface tracking

(config)# track {track#} int [g0/1] line-protocol                        ! This creates a tracker which tracks said int.

! OBJECT TRACKING

(config)# track {track#} ip sla {sla#}                                        ! This creates a tracker which tracks sla#. There are most likely more items to track besides ‘ip slas’.

(config)# track {track#} ?


SNMP: Simple Network Management Protocol

SNMPv2c

SNMPv3

! SNMP Configuration
!

(config)# snmp-server ifindex persist                                ! Optional & recommended; SNMP uses “ifIndexes” to ID ints, but these can change on reboot. Use this to prevent them from changing.

(config)# snmp-server location string                                                                                                ! Optional; Defines a location string.

(config)# snmp-server contact string                                                                                                ! Optional; Defines a contract string.

(config)# snmp-server enable traps                                                                                                ! Optional; Enables sending notifications (informs and traps).

(config-if)# snmp trap link-status                                                                                                        ! Optional; Tx a trap if link status changes.

(config)# snmp-server engineID {local|remote} newEngineID                                                                ! Optional; Manually configure engineID.

! SNMPv3 Configuration
!

(config)# snmp-server group group v3 {noauth|auth|priv} [{read|write} viewName] [access [ipv6] aclName]                ! Defines Security level, write access, & filtering ACL

(config)# snmp-server user user group v3 [auth {sha|md5} 1wayPass] [priv AES {256} symmetricPass ] [{read|write|notify} viewName] [access aclName]

                ! (if auth/priv) password hashing style and password, (if priv) encryption key & algorithm

(config)# snmp-server host {ip} [traps|informs] version 3 {noauth|auth|priv}                                ! Optional; Enables traps|informs. Security level must match user’s & user’s group’s sec-model.

(config)# snmp-server view [viewName] [oid-tree] {included|excluded}                                                ! Optional; Creates custom MIB view.

# setup snmp view                                                                                                                        ! Optional; Creates custom MIB view.

! SNMPv2c Configuration

!

(config)# snmp-server community cString {RO | RW} [acl] [ipv6 acl]                                                 ! acls are optional, but recommended, especially for RW. ACLs are referred to either by name | number.

(config)# snmp-server host {ip} {traps | informs} version 2c notification-community                        ! Optional; used to configure sending informs or traps, [informs] specifies if sending informs.

! SNMP verification

!

# show snmp                        ! lists counters and status’ rather than config. lists contact, location, # of SNMP Tx & Rx packets, # of get & set requests, # of OIDs altered by sets, traps sent, ... 

# show snmp host                ! lists host being notified, UDP port, trap|inform, notification-community-string (listed as “used:”), & security model (e.g. v2c). notification-community = user.

# show snmp location                ! (could just use ‘show snmp’) lists location.

# show snmp contact                ! (could just use ‘show snmp’) lists contact.

# show snmp group                ! Lists groups, their auth/priv setting, read & write view, and ACL (no acl = no entry). DO THIS! If create v2c cString, will also make duplicate v1 cString, that should die.

# show snmp engineID        ! Returns current local system engineID.

! SNMPv3 verification

!

# show snmp user                ! Lists usernames, their auth & priv settings, and groups.

# show snmp view                ! Lists the configured views, and what those views cna view (what they have access to).

# show snmp host                ! Lists host socket (IP + port), inform|trap, user & sec-model.

! SNMPv2c verification

!

# show snmp community        ! lists cStrings and ACLs


GRE Tunnel: Generic Routing Encapsulation Tunnel

RFC 2784

sec-ip:                “Secure IP address”; typically a private IP address / non-publicly-routable

insec-up:                “Insecure IP address”; typically a publically routable ip address

What is a "Generic Routing Encapsulation" tunnel?

Like a VPN connection, but without the encryption. IPsec configuration can be added afterwards to encrypt the traffic.

GRE is not a TCP or UDP application. Rather, GRE acts like another L4 transport protocol (see section “IP Header” at top of this document) and within a GRE segment is another (potentially encrypted) IP packet header. (this complicates ACLs )

network:

        host1 > R1 > tunnel through internet > R2 > host2

host1 sends packet destined for host 2

packet originally has correct to & from info

when R1 is to send it through the tunnel, it will stuff that entire packet...

into the data field of a new packet

the new packet has:

        source ip add:        R1

        des ip add:        R2

once R2 has received it, it will unpack the original packet with the correct ip to/from info & send to host2.

This kind of creates a virtual tunnel through the internet / through the tunnel. A virtual PPP connection.

Benefit of this:

        do not need to add the routes for devices that the tunnel go's through, e.g. the devices on internet.

As you know R1 & R2 have ints that are connected. E.g. s0/0/0 & s0/0/1.

But the endpoints of the tunnel have THEIR OWN ip adds. Most likely a /30 (255.255.255.252).

Notes from book__

GRE Tunnels exist between two routers, and operate similar to a serial link or a point-to-point connection with regard to packet forwarding.

Routers use virtual interfaces called tunnel interfaces. These tunnels each have an IP address in the same subnet. Packet that are to go across the tunnel are encapsulated and slapped with a GRE  Tunnel header, which is then slapped with a new complete 20-byte IP header (called the delivery header) on top of that with the new IP addresses used in the connection between the two Rs, e.g. public IP address to traverse the internet. (this process is similar to VPNs but without encrypting the original IP header and the data within the original packet). Routers will have routes that list the tunnel interface as the outgoing interface, as you would expect. There are GRE tunnels with only two ends, this is called a point-to-point GRE tunnel. There is also GRE tunnels with more than two ends, these are called multipoint GRE tunnels or Dynamic multipoint VPN tunnels (DMVPN).

While traversing the internet (or whatever network is between the two routers), the devices in the internet will use the IP addresses (to and from) of the outer IP header (not the potentially encrypted ones within the GRE header) to router the packet.

R1# configure terminal

        int tunnel [0]                                                                ! LOCAL TO DEVICE; any number, in case multiple tunnels. This command creates the virtual tunnel interface on the local R.

                ip add [10.0.0.1] [255.255.255.252]                                ! Secure(private) IP address used within the org, these are not seen by the internet.

tunnel mode gre [ip | ipv6 | multipoint]                        ! OPTIONAL: (default = ip) tells IOS to use IPv4 GRE encapsulation on the tunnel (this is the default setting, and not required to be declared like this)

                tunnel source [insec-ip add | int]                                ! Set the insecure IP add of the this end of the GRE tunnel either directly by declaring it, or indirectly by referencing the physical int.

                tunnel destination [insec-ip add of dest]                        ! IP add of dest’s insec tunnel int. NOTE: can enter hostname instead of dest insec-ip, R immediately attempts resolution, success=stores the ip not hostname, fail=reject cmd.

        router ospf [1]                                                                ! Add routes that sue the tunnel by enabling a dynamic routing protocol on the tunnel  or by configuring static IP routes.

                network 10.0.0.0 0.0.0.3 area 0                                ! advertize the secure ip add (not the insecure/public ip add)

                network 172.16.10.0 0.0.0.255 area o                        ! advertize connection to host1

                                                                                ! THIS means ospf info will go to host1, & R2 through tunnel, BUT NOT TO DEVS ON INTERNET!

R2# configure terminal

        interface tunnel [0]

                ip address [10.0.0.2] [255.255.255.252]                ! secure ip add of tunnel

                tunnel source [insec ip add | int]                        ! insecure add of tunnel (or int)

                tunnel destination [insec ip add of dest]                ! i.e. R1’s tunnel int 0’s tunnel source ip add (insecure add of R1’s tunnel 0)

        router ospf [1]                                                        ! Add routes that sue the tunnel by enabling a dynamic routing protocol on the tunnel  or by configuring static IP routes.

                network 10.0.0.0 0.0.0.3 area 0

                network 192.168.100.0 0.0.0.255 area 0

R# show run interface Tunnel 0                                                ! lists cmds

R# show ip int brief | include Tunnel                                        ! verify that Tunnel0 is present, and that ‘IP-Address’ = the secure ip add. that it is UP and UP,

R# show interfaces tunnel0                                        ! notice “Tunnel0 is up, line protocol is up”,

! … “Internet address is [secure IP]”                (THIS IS CONFUSING, IT MEANS ‘IP-ADD’ NOT ‘PUBLIC-IP-ADD’, JUST LOOK LOWER AT ‘Tunnel source’ for understanding.

                                                                                ! Also notice “Tunnel source [insecure IP] (physical int), destination [insecure tunnel dest]”

                                                                                ! Also notice “Tunnel protocol/transport [GRE/IP]” this tells us the “tunnel mode gre [ip | ipv6 | multipoint]” command in

R# show ip route [secure ip beyond dest’s sec-ip]                ! notice “[sec ip beyond dest’s sec-ip] … via [our secure ip] … Tunnel0”

R# ping [dest sec-ip]                                                ! this important, because this tunnel’s UP/UP state is only for local config, does not test if other end of tunnel is working.

R# traceroute        (protocol ip, target [some dest sec-ip], source add [some sec-ip]                ! notice the traceroute does not list any insecure ip adds as hops.

Set default route to send everything through the GRE tunnel interface

        ipv6 e.g. "ipv6 route ::/0 {ip/int}"

        https://drive.google.com/file/d/0BzTH5IWRQhLYb1ZVeWpybW1WRlU/view


WANs: Point-to-point Wide Area Networks

Today many leased lines have an integrated CSU/DSU. I.E. the WIC interface card has a CSU built into the add-in card, so an external one is not needed.

R(config)# int s0/0/0

        ip address [x.x.x.x] [x.x.x.x]

        encapsulation [hdlc]                                ! OPTIONAL: default is hdlc, and therefore this cmd is usually optional. could be ppp or maybe others.

        bandwidth [kbps]                                ! OPTIONAL: use this to document the speed so that it matches the actual clock rate of the link. This does not change the actual speed!

show controllers serial [number]                        ! Lists DCE or DTE end, cable used, & clock rate

        clock rate [bits/s]                                ! NOTE: Only do this on the DCE (CSU/DSU) end !                (e.g. SP or lab environment, not a Cx environment) (speed is in bits per second)

show interfaces s0/0/0                                ! BW configured, encapsulation being used (e.g. HDLC/PPP)

        

Names of Line

Bit Rate

DS0

64 Kb/s

Fractional T1

Multiples 64 Kb/s (up to 24X)

DS1 (T1)

1.544 Mb/s (24 DS0s, for 1.536 Mb/s + 8 Kb/s overhead)

E1 (Europe)

2.048 Mb/s (32 DS0s)

Fractional T3

Multiples of 1.536 Mb/s (up to 28X)

DS3 (T3)

44.736 (28 DS1s, plus mgmt overhead)

E3 (Europe)

Approx. 34 Mb/s (16 E1s, plus mgmt overhead)


        PPP: Point-to-Point Protocol

Function

LCP Feature

Description

Looped link detection

Magic number

Detects if the link is looped, and disables the int, allowing rerouting over a working route

Error detection

Link-quality monitoring (LQM)

Disables an int that exceeds an error percentage threshold, allowing rerouting over better routes

Multilink support

MLPPP

Load balances traffic over multiple parallel links

Authentication

CHAP (or alternatively PAP)

Exchanges names and passwords so that each dev can verify the ID of the other.

                                        ! config is same near identical to HDLC

R(config)# int s0/0/0

        ip address [x.x.x.x] [x.x.x.x]                        ! OPTIONAL: with PPP, this is actually optional.

        encapsulation [ppp]                                ! default is hdlc, and therefore this cmd is required

        bandwidth [kbps]                                ! OPTIONAL: use this to document the speed so that it matches the actual clock rate of the link. This does not change the actual speed!

show controllers serial 0/0/0                                ! Lists DCE or DTE end, cable used, & clock rate

        clock rate [bits/s]                                ! NOTE: Only do this on the DCE (CSU/DSU) end !                (e.g. SP or lab environment, not a Cx environment) (speed is in bits per second)

show interfaces serial 0/0/0                                ! BW configured, encapsulation being used (e.g. HDLC/PPP). Should see “Encap PPP, LCP Open” meaning LCP has successfully completed.

        PPP w/ PAP

        Point-to-Point Protocol with Password Authentication Protocol

        Initiator needs to be authenticated, and is performed by the initiator sending the pre-shared plain-text password and their hostname. If the one being authenticated has sent the correct pre-shared plain-text password, the authenticator sends an ACK.

        R1(config)#

                int s0/0/0

encap ppp

                        ppp auth pap

ppp pap sent-username R2 password Pa$$     ! other R must do “username R2 password Pa$$

do show interfaces serial 0/0/0

do show ppp all

          PPP w/ CHAP

Point-to-Point Protocol with Challenge Handshake Authentication Protocol

R1 sends R2 a random number in a challenge, R2 uses MD5 to hash that random number & the suspected password, & sends that MD5 hash to R1. R1 hashes the same random number & the correct locally (or stored on AAA server) stored pre-shared plain-text password via MD5 & compares that with what it received from R2. Next time R1 uses a different number.

R1(config)# hostname R1                                                        ! Hostname is required because CHAP authentication uses hostname as the username.

R1(config)# username [peer’s HN] password [peer’s PW]                ! Defines an accepted UN/PW pair on this R. Both the username and password are case-sensitive. In this example, the “peer’s hostname” should be R2.

R1(config)# int s0/0/0

R1(config-if)# ip add [10.0.0.1] [255.0.0.0]                                ! In (non MLPPP) PPP environments the IP add is optional.

R1(config-if)# encap ppp

R1(config-if)# ppp authentication chap

R2(config)#

hostname R2                                                                ! Hostname is required because CHAP authentication uses hostname as the username.

username [peer’s HN] password [peer’s PW]                                ! Defines an accepted UN/PW pair on this R. Both the username and password are case-sensitive. In this example, the “peer’s hostname” should be R1.

int s0/0/0

     ip add [x]                                                                ! In (non MLPPP) PPP environments the IP add is optional.

     encap ppp

     ppp auth chap

#debug PPP auth

#debug PPP negotiation

show interfaces serial 0/0/0” || “show interfaces status” to see if L2 line-protocol is up, if it is not, CHAP auth may have failed.

R(config-int)# ppp auth chap pap      ! this tries chap first, but will failover to pap. can also reverse this

MLPPP: Multi-Link PPP

WITHOUT MLPPP:

R1 has 2 ints connected to R2, bother serial connections using PPP and each has its own IP. With EIGRp R2 would form two neighbor relationships with R2, and twice the routes. by default IOS would by destination basis, eg all packets to 10.0.2.2 go over the first link, and all packets for 10.0.2.3 over the bottom link. could also change to a packet by packet basis.

WITH MLPPP:

Acts like just one connection. one neighbor, one route, etc. creates a virtual int called a 'multilink int’. the L3 cmds (IPv4 & IPv6) are applied to the multilink int. this virtual int withh fragment packets going to it, into smaller fragments and send those across both physical ppp wires. eg break a packet in half, then re-encapsulate it into Ip packet and a PpP frame (to each half) and send one across each connection. (with a few extra header bytes to account for the fragmentation process). as you would expect if there were 3 links it would be broken into thirds.

to do, configure matchings multilink ints on both Rs, with int subcommands(ipv4 ipv6 routing protocol etc) on the multilink int, not the physical serial ints. configure the physical serial ints w/ all L1&2 cmds like “clock rate …” and “ppp auth …”. configure some ppp cmds on both the virtual ppp multilink int and on the physical serial ints (to associate them)

See also the regular serial interface config so to also put the “bandwidth” and “clock-rate” commands on the correct ints.

R1(config)# int multilink 7                ! creates this virtual int. NOTE the number, in this case #7, MUST BE USED ON ALL PHYSICAL SERIAL INTS AND ON THE CONNECTED ROUTER AND ITS VIRTUAL AND PHYSICAL INTS.

R1(config-if)# encap ppp

R1(config-if)# ppp multilink

R1(config-if)# ip add x.x.x.x z.z.z.z        ! where x.x.x.x is the ip address, and z.z.z.z is the subnet mask.

R1(config-if)# ppp multilink group 7

! Optional: Add ppp authentication config here (e.g. ppp auth chap), but not on the serial ints.

R1(config)# int s0/0/0                        ! and every other serial int for this multilink

R1(config-if)# encap ppp

R1(config-if)# ppp multilink

R1(config-if)# no ip add

R1(config-if)# ppp multilink group 7

! once again that 7 must be the number used on the R1’s virt ppp multilink, ALL of R1’s physical serial ints, R2’s virt ppp multilink, and ALL of R2’s phy serial ints.

! VERIFICATION

! verify, should see Mu7 or Multilink 7 instead of s0/0/0. show ip route, show ip int brief (sho ip int brief will list Mu7 w/ an IP but the serial ints without one, this is good). show ip int brief, if up/up means this IOS believes that at least one of the phy serial ints in the virt multilink is working, i.e. if 3 phy ints exist in multilink and 2 are down and 1 is up, show ip int brief will still list the multilink as up/up.

# show interfaces multilink 7                        ! notice 1st line, multilink7 is up, line protocol is up. …. multilink open (on right side).

! which phy serial ints working?

# show ppp multilink                                ! notice memberlinks: 3 active, 0 inactive. and it will list which ones.

Ping from one serial int to the other. Success=Check Routing Protocol. Failure=Show ip int brief (on both devs) and fallow table below.

        Ping from one serial int to the other. Success=Check Routing Protocol. Failure=Show ip int brief (on both devs) and fallow table below.

Serial Link Troubleshooting

Lines Status

Protocol Status

Likely Issued Layer

Possible reasons

cmd to verify/fix

Down

Down

L1

int shutdown or hw issue¹

no shut

Up

Down (1 end)

L2

UP end’s keepalive disabled2 (HDLC)

no no keepalive

Up

Down (both)

L2

PAP/CHAP auth failure

“debug ppp auth”, shut no shut int

Up

Down (1+flip3)

L2

Mismatched encap cmds

show running-config

Up

Up

L3

IP or Routing protocols

same subnet?4

Dialer Interface

Dialer ints have been in IOS for a long time. Originally used when a R  used dial-up tech to make a phone call to another dev to setup a physical link. Today they are used as logical ints that bind to another int to cooperate to perform a certain task. For example, pppoe.

        PPPoE: Point-to-Point Protocol over Ethernet

PPP normally on serial ints (including those links created w/ dial-up analog and ISDN modems). But PPP can be transported over ethernet frames with the same benefits, such as different control protocols, & ppp authentication. ISPs use PPP because: can assign an IP to a customer, support CHAP (which ISPs often want to use). PPP was hot stuff in the 90s and early 2000s with the analog modems, until DSL (via the phone line) and its faster speeds started becoming the norm, so a new RFC was created for PPPoE. PPPoE was needed because Cx computer ethernet NICs and Cx router ethernet ints did not understand PPP, only ethernet frames, so PPPoE is a way to tunnel PPP inside of L2 Ethernet frames. PPPoE creates a PPPoE session rather than a PPP point-to-point physical link. ([L3 IP packet] within [L2 PPP frame] within [L2 PPPoE frame] within [L2 Ethernet frame]. Each with a header)

Configuration:

NOTE: PPPoE is more difficult to setup than other things (so the book says at this point). You configure PPPoE from a couple different configuration modes, then PPPoE automatically adds some other important config. These PPPoE config concepts work on both a crossover ethernet link or a DSL link (from the customer’s end). The logical/virtual dialer interface will use the physical g0/0 interface in the example. The dialer interface will have all of the L3 configuration but just use int g0/0 as a media to communicate.

! Client / Customer Router Config:

Cx-R(config)# int dialer 2                                        ! The dialer interface holds the PPP information used to create the PPPoE session.

  ! L3 details below

Cx-R(config-if)# ip address negotiated                        ! PPP uses IPCP (IPv4 control protocol)

Cx-R(config-if)# mtu 1492                                ! Default=1500 , but PPPoE header adds 8 bytes, so we reduce it to prevent IOS from doing unneeded work to fragment packets.

  ! L2 details below

Cx-R(config-if)# encap ppp

Cx-R(config-if)# ppp chap hostname USER1

Cx-R(config-if)# ppp chap password PASS1

  ! L1 details below

Cx-R(config-if)# dialer pool 1                        ! This cmd attaches this int to dial-pool 1, which is attached to int g0/0 below, therefore this attaches dialer 2 to g0/0. This is a pool of ethernet ints that PPPoE can use.

Cx-R(config)# int g0/0                                ! Physical interface - the one connected towards the ISP

Cx-R(config-if)# no ip address                        ! physical link has no L3 address (L3 command)

Cx-R(config-if)# pppoe-client dial-pool-number 1                                ! puts this int in dial-pool 1, and that it is available to be used by dialer ints wanting to do pppoe. (L1 command)

Cx-R(config-if)# pppoe enable                        ! auto generated by “pppoe-client dial-pool-number 1” (L2 command)

Cx-R(config-if)# no shut

                                        ! You could also add a default static route with “ip route 0.0.0.0 0.0.0.0 dialer 2”. (sending to dialer 2 will use dialer 2’s config, which will forward via g0/0.)

! ISP Router Config:

ISP-R(config)# ip local pool WOPool 10.1.3.2 10.1.3.254

ISP-R(config)# bba-group pppoe WOGroup

ISP-R(config-???)# Virtual-template 1

ISP-R(config)# Username USERA password PASS1

ISP-R(config)# int virtual-template 1

ISP-R(config-if)# ip add 10.1.3.1 255.255.255.0

ISP-R(config-if)# peer default ip address pool WOPool

ISP-R(config-if)# ppp auth chap callin

ISP-R(config)# int g0/2

ISP-R(config-if)# no ip add

ISP-R(config-if)# pppoe enable group WOGroup

ISP-R(config-if)# no shutdown

! (PPPoE Verification)

Theory: Both the dialer int, and the Ethernet int are enabled and used to setup the PPPoE session, if the configs are relatively correct, the PPPoE session will create a “Virtual-Access” interface. This Virtual-Access interface will bind to both the dialer interface and bind to the Ethernet interface. The Ethernet interface is used to send frames; the Virtual-Access interface is used to send PPPoE frames using the ethernet interface; The Dialer interface (L3) is used to send actual packets using the Virtual-access interface (responsible for adding the PPPoE header) and the Virtual-access interface  forwards it to the ethernet interface which actually sends the frame.

show interfaces dialer                        ! Lists output for two interfaces; one group of ~20 output lines for the dialer int, and another set for the virtual-access int to which it is bound. (both will mention being bound to the other)

Dialer = L3

Virtual-access = L2                (config wise that is. It is bound to the Ethernet int.)

show interfaces dialer [2]

Verifying Virtual-Access Interface Config:

show interfaces virtual-access 2 configuration                ! or “show int vi2 conf” for short

Verifying PPPoE Session Status:

Concept:        When PPPoE starts on Cx R it Tx & Rx PPPoE msgs, (including those for LCP), to decide if PPP session can work. Each R tracks the status of the PPPoE state, shown w/ “show pppoe session”.

show pppoe session

show ip int brief     ! should see a route to PPPoE int add via dialer int learned from IPCP.

show IP route      ! should see host route (/32) to own PpPoE intvia dialer int and another to device on other end of dialer int(also directly connected, a /32, and via the same dialer int).

PPPoE troubleshooting:

Best to work from L1 upwards.

Dialer int: created with”int dialer [2]”

    even when misconfigured, or even with no config at all,  state

          PPPoE w/ CHAP

! Cx side

int G0/1

     no ip add

     pppoe enable                                                ! auto-generated by “pppoe-client dial-pool-number [7]”

     pppoe-client dial-pool-number [7]

     IP TCP Adjust-mms 1452

int DIALER 1

     encap PPP

     ip add negotiated

     PPP CHAP hostname {ISP side hostname}

     PPP CHAP password [ISP side password]

     IP MTU 1492

     dialer pool [7]

! ISP side

int G0/0

     no ip add

     PPPoE enable group [GLOBAL]

     IP tcp adjust-mms 1452

bba-group PPPoE [GLOBAL]

     virtual-template 1

int virtual-template 1

     ip add 10.0.0.254 /24

     MTU 1492

     peer default ip address pool [PPPoEPool]

IP local pool [PPPoEPool] 10.0.0.1 10.0.0.10

username [ISP side hostname] password [ISP side password]

__________

The below information needs to be merged with the rest of the PPP/PPPoE information.

What technology provides service providers the capability to use authentication, accounting, and link management features to customers over Ethernet networks?

    PPPoE

 

What are two characteristics of a PPPoE configuration on a Cisco customer router?

    PPP configured on "dialer" int

    Ethernet int: no ip add

 

PPPoE config that must be same on Customer Router:

    dialer pool 2

    pppoe-client dial-pool-number 2


WANs: Private

Private WANs w/ Ethernet & MPLS

Carrier Ethernet / “MetroE”: Metro Ethernet

Name

Speed

Distance (Km)

100Base-LX10

0.1 Gb/s

10

1000Base-LX

1 Gb/s

5

1000Base-LX10

1 Gb/s

10

1000Base-ZX

1 Gb/s

100

10GBase-LR

10 Gb/s

10

10GBase-ER

10 Gb/s

40

MEF Service Name

MEF Short Name

Topology Terms

Descriptions

If SP internally uses EoMPLS

Ethernet Line Service

E-Line

Point-to-point

Two CPE devs can exchange frames, like a leased line.

Virtual Private Wire Service (VPWS)

or (generic) EoMPLS

Ethernet LAN Service

E-LAN

Full mech

Like a LAN, all devs can forward frames directly to one another.

Virtual Private LAN Service (VPLS)

or (generic) EoMPLS

Ethernet Tree Service

E-Tree

Hub-and-spoke; point-to-multipoint; partial mesh;

Central hub / root can communicate to all leaves, but leaves can only talk to root/hub. non-hub = leaves

(generic) EoMPLS

Scenario: 3 Rs, each has only 1 int. R1 connected to R2 via MetroE. R2 connected to R3 over MetroE.

 Can R3 and R1 directly talk?

 How many subnets are there?

Answers depend on if E-Lines or E-LAN; E-LAN has virtual switch in ‘the cloud’, which E-Lines are virtually P2P / direct.

 If E-Lines then R3 & R1 cannot talk directly to one another, must go via R2. There would be 2 subnets, one for each E-Line. (E-Tree = 1 subnet; 2 E-Lines = 2 subnets)

 If E-LAN then R3 & R1 can talk directly (through WAN) to one another. There would be 1 subnet.

WAN QoS

MPLS: Multi Protocol Label Switching VPNs

MPLS can be used for other things besides MPLS VPNs, but the book only talks about them in this context.

Private WANs w/ Internet VPN

Tunnel:

Any protocol’s packet that is being sent by encapsulating that into another packet. May or may not use encryption, although in production is usually is.

IPsec:

IP Security (RFC 4301 Security Architecture for the Internet Protocol). A framework for security service for IP nets, defining how two devices can communicate over the internet securlly.

Encryption Key:

AKA session key, shared key, shared session key.

ASA:

Cisco Adaptive Security Appliance (a line of Cisco firewalls)

Multipoint Internet VPNs using DMVPN

Next Hop Resolution Protocol


HA: High Availability

                

Modular

Switch Stacking

Initially More expensive

Initially Less expensive

Initial cost (if stacking 2 switches)

Less expensive

More expensive (e.g. multiple non-redundant supervisors)

If stacking ~4+ switches

Switch Stacking

! StackWise VERIFICATION:

S1# show switch

Switch/Stack Mac Address: ABCD.EF12.3456

Switch#

Role

Mac Address

Priority H/W

Version

Current State

*1

Master

ABCD.EF12.3456

1

0

Ready

2

Member

ABCD.EF12.3457

1

0

Ready

S1# show switch stack-ports

Switch#

Port 1

Port 2

-----------------

----------

----------

1

Ok

Ok

2

Ok

Ok

S1# show platform stack manager all                        ! in-depth view into StackWise

                

FlexStack

FlexStack-Plus

StackWise(+)

2010

2013

?

Introduced

2960-S, 2960-X

2960-X, 2960-XR

?

Switch Model series

10 Gbps

20 Gbps

32/64 Gbps

Full Duplex Speed of single stack link

4

8

9

Max S in one stack

Stack QoS applied...

Chassis Aggregation / VSS: Virtual Switching System

                        Active/Active Data Plane                eg user data

                        Active/Standby Control Plane                eg CDP, VTP, DTP, STP, etc

                        Active/Standby? Mgmt Plane:                eg SSH, SNMP

                                (Mgmt Plane: you SSH to the Active S, and config is synced to standby S)

! VSS VERIFICATION

S# show switch virtual

S# show switch virtual role

S# show switch virtual link

S# show switch virtual link port-channel

Supervisor Redundancy Options

(config)# redundancy

(config-red)# mode {rpr | rpr-plus | sso}                                ! do this on both SVs. All cmds afterwards should be done on active SV (which will sync those changes to the standby S).

(config)# router {ospf pid | eigrp as#}

(config-router)# nsf                                                        ! This configures the dev to become nsf aware for the IGP (do this on all {ospf | eigrp} devices).

(config)# router bgp as#

(config-router)# bgp graceful-restart                                        ! This configures the dev to become nsf aware for the EGP (do this on all EGP devices).

# show redundancy states


        QoS: Quality of Service

X-axis:

   Drop Priority / Probability

(more = worse)

EF

(46)

Y-Axis:

How desirable the queue (more = better)

AF41 (34)

AF42 (36)

AF43 (38)

AF31 (26)

AF32 (28)

AF33 (30)

AF21 (18)

AF22 (20)

AF23 (22)

AF11 (10)

AF12 (12)

AF13 (14)

QoS: WAN

CIR = Committed information rate                (bandwidth that WAN SP guarantees)

CIR is met via two QoS means. Shaping and Policing.

Shaping = Customer reduces bandwidth of link to match CIR.

Policing = SP drops datagrams if customer is sending more than CIR.

QoS: VoIP

S(config)# int fa0/1

S(config-if)# auto qos voip trust                        ! configures AutoQoS default policy, also makes config changes in other parts of config

S# sh run int fa0/1                                        ! notice many changes

R(config)# int g0/0

R(config-if)# auto discovery                                ! monitors int over extended period of time to create custom AutoQoS policy, which can be applied or ignored.

R(config-if)# auto qos voip trust                        ! implements default AutoQoS policy

R# sh run int g0/0                                        ! notice “auto qos voip”, “ppp …”?, “service-policy output AutoQoS-Policy-trust”, maybe more?


Wireless


AAA w/ RADIUS & TACACS+

                

TACACS+

RADIUS

Features

Networking Devices

Network Access

(Typically) Which protected resource is access being requested to with this protocol:

TCP

UDP

L4 Transport Protocol:

49

1812 & 1813

Authentication port numbers:

Yes

Yes

Protocol encrypts the password:

Yes

No

Protocol encrypts the entire packet:

Yes

No

Supports function to authorize each user to a subset of CLI commands:

Cisco (proprietary 1)

RFC 2865/2866

Defined by:

bidirectional

unidirectional

Single (1-way) vs multiple (2-way) Challenge response(s):

Cx/Svr

Cx/Svr

Model (Client/Server vs P2P):

1Cisco has published the TACACS+ specification as a draft RFC.

                

 

See: https://www.cisco.com/c/en/us/td/docs/ios/12_2/security/command/reference/fsecur_r/srfathen.html

! INITIAL SETUP

(config)# username {USER} privilege 15 secret {SECRET}                ! Set a local login to be used as a backup in case comms to RADIUS/TACACS+ servers fail. Highly recommended.

(config)# ip {tacacs|radius} source-interface {int}        ! Declare which int (& subsequent ip add) is used for comms w/ the TACACS/RADIUS svrs. Loopback ints are recommended.

(config)# aaa new-model                                ! Enables many new AAA cmds. Immediately applies local authentication (via the default list) to all lines & ints (except line con0).

! DEFINE THE TACACS+ SERVERS

(config)# tacacs server {server-name}                                ! The new way to define a TACACS+ svr(s). Server-name is only locally significant.

(config-tacacs-server)# address ipv4 {x.x.x.x}

(config-tacacs-server)# key {key_value}                        ! This is the pre-shared key used to authenticate this device to, and encrypt comms to the TACACS+ svr.

(config-tacacs-server)# port {49}                                ! Optional. Configures the TCP port to use. Default is 49.

! (config)# tacacs-server host svrIP [key key]                ! Old way of configuring tacacs svrs. don’t do this.

! (config)# tacacs-server key key                                ! Old way of configuring tacacs svrs. don’t do this.

! DEFINE THE RADIUS SERVERS

(config)# radius server {server-name}                        ! The new way to define a RADIUS svr(s). Server-name is only locally significant, & is used to reference this svr in future cmds.

(config-radius-server)# address ipv4 {x.x.x.x} [auth-port 1812] [acct-port 1813]                        ! One may manually specify the ports. In this example the defaults were used.

(config-radius-server)# key {key_value}                        ! Defines the pre-shared secret used to authenticate the NAS.

! (config)# radius-server host svrIP [key key]                ! Old way of configuring radius svrs. don’t do this.

! (config)# radius-server key key                                ! Old way of configuring radius svrs. don’t do this.

! DEFINE A GROUP OF SERVERS INTO A SERVER GROUP TO FORM A METHOD

(config)# aaa group server {radius|tacacs+} {method-name}                ! Define a AAA Group of (radius or tacacs+) servers to create a method. This group-name/method is what is referenced in future cmds.

(config-sg-method)# ip tacacs source-interface int        ! This is usually available if global cmd “tacacs source-interface int” is not.

(config-sg-method)# server name {server-name}                ! List each server-name to be placed into this server group. If this isn’t accepted try “server ip”.

(config-sg-method)# server name {server-name}                ! In the prompt “config-sg-method”, sg = server group. method will change to your method (radius|tacacs).

! DEFINE AN AUTHENTICATION LIST (a list of ordered methods)

(config)# aaa authentication dot1x {list-name} {method1 [method2...]}        ! Configures list used for dot1x port-based authentication. Method’s typically ‘group group-name’. See “IEEE 802.1X & EAPOL”.

(config)# aaa authentication login {list-name} {method1 [method2...]}

! Adds AAA authentication at login. If list-name omitted, list-name of “default” is assumed, configuring the default list. See “Authentication Methods”.

(config)# aaa authentication enable {list-name} {method1 [method2...]}        ! Enables user ID and password checking for users requesting privileged EXEC level. List-name =?= enable (idk)

! DEFINE AN AUTHORIZATION LIST

(config)# aaa authorization {authorization-type} list-name {method1 [method2...]}                ! Configure authorization. If the list-name omitted, list name “default” is assumed.

! DEFINE AN ACCOUNTING LIST

(config)# aaa accounting {accounting-type} list-name {start-stop | stop-only | none} {method1 [method2...]}        ! See “Accounting-type”. If list-name omitted, “default” assumed.

! APPLYING THE LISTS TO THE LINES/INTS  (except for the ‘default’ method list, which is already applied, by default; see “The default list” above)

(config)# line {aux|console|tty|vty} line-number [ending-line-number]

(config-line)# login authentication list-name                        ! authenticate logins against list-name. Without this cmd, implicit “login authentication default” exists if “aaa new-model” entered.

(config-line)# timeout login response seconds                        ! How long to wait for login credentials before ending session. Default is 30s. Range is 1 - 300 seconds.

(config-line)# authorization {authorization-type} list-name                         

(config-line)# accounting {commands cmdLvl | connection | exec} list-name                        ! there are many more things for accounting but they are not understood at this time.

! BANNERS & PROMPTS (in order of potential viewing by a user)

!

(config)# aaa authentication banner *string*                        ! Here “*” is used as the delimiter but any char will work. This is displayed before the username-prompt. 2996 char max.

(config)# aaa authentication username-prompt string                ! Changes the string used to prompt for the username. Reachable TACACS+ servers override this. Default is “Username:”.

(config)# aaa authentication password-prompt string                ! changes the string used to prompt for the passphrase. Reachable TACACS+ servers override this. Default is “Password:”.

(config)# aaa authentication fail-message *string*                ! Displayed after failed login. Here “*” is used as a delimiter, but can use any char. 2996 char max.

(config)# banner motd ^ organizations moto here ^                ! Displayed before login banner and before username prompt.

(config)# banner login ^ Authorized access only.   ^                ! Displayed after MOTD banner, but before username prompt.

(config)# banner exec ^ Connected to $(hostname).$(domain) via line $(line). ^        ! Displayed after successful login.

! OTHER

(config)# aaa authentication suppress null-username                        ! Does not forward RADIUS authentication requests to the RADIUS server if the username is blank.

! OTHER - LOCKOUT

(config)# aaa local authentication attempts max-fail {max-failed-attempts}

! non priv-15 users accounts will lock after max-failed-attempts. They will still see the same login prompts but all attempts will then fail. Require priv-15 user to unlock

# clear aaa local user lockout {username username}                        ! unlocks acct.

# clear aaa local user fail-attempts {username username}                ! Reset login-fail counter if not already locked.

# show aaa local user lockout                                                ! Shows users that are locked out.


! DEBUG & TESTING

!

# test aaa group tacacs+ username password legacy                ! test that dev can authenticate the username and password against the AAA server (via tacacs+). IDK what legacy does.

# debug tacacs

# debug aaa authentication                                                

! notice “authentication start packet for 3(username)” meaning it received the username from the user, “Received authen response status GET_PASSWORD”, meaning it received the PW from the user, “Received authen response status PASS”, meaning the AAA server authenticated it.


IEEE 802.1X & EAPOL

S(config)# aaa new-method

! Define the radius server group. See “AAA w/ RADIUS & TACACS+”

S(config)# aaa authentication dot1x default group RadiusGroupName        ! (see AAA w/ RADIUS & TACACS+)

S(config)# dot1x system-auth-control                                                        ! enables dot1x globally on this dev (i.e. all access ints. Changing as ints change to/from access mode).

S(config)# dot1x host-mode multi-host                                                ! Optional; enables more the ability for more than 1 mac/host to exist on a single port (e.g. a host has a VM, or is using a hub)

S(config)# !

S(config)# int g0/1

S(config-if)# switchport mode access                                                                                ! The int must be in access mode else this others cmds will fail.

S(config-if)# dotqx port-control {auto|force-authorized|force-unauthorized}                        ! enables dot1x on an individual int.

S# show dot1x all

See https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750x_3560x/software/release/15-0_1_se/configuration/guide/3750xcg/sw8021x.html


Network Security

(config)# vlan dot1q tag native            ! does NOT strip the tag off of (egress) native vlan traffic, AND drops trunk data-plane ingress untagged traffic. Do this on all ends of trunks.

For DHCP Snooping see DHCP Snooping.

IPSG: IP Source Guard

S(config-if)# ip verify source

S(config-if)# ip verify source port-security

S# show ip verify source

! (required) Enables IPSG on the int.

! (optional) after doing the above cmd, this cmd will cause the S to also verify the MAC.

! Verification

DAI: Dynamic ARP Inspection

                https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst6500/ios/12-2SX/configuration/guide/book/dynarp.html

Once DHCP Snooping has been configured…

S(config)# ip arp inspection vlan 1,9,80,666-667

S(config-if)# ip arp inspection trust

S# show ip arp inspection [log | ...]

! Enables DAI on vlans 1,9,80, & 666 through 667.  Typically mimics the vlans used in the cmd “ip dhcp snooping vlan ...”.

! Typically done on the ints that also have “ip dhcp snooping trust”. By default all ints are untrusted, this cmd makes them trusted.

! Verification

Port-Security

(config-if)# switchport port-security                                                                ! enables port security on the int.

(config-if)# switchport port-security aging time mins                                                ! after mins removes the secure mac address.

(config-if)# switchport port-security aging type {absolute | inactivity}                                ! sets if time is absolute / since creation (the default), or inactivity / last used.

(config-if)# switchport port-security max max [ vlan vlan|vlan-list ]                                ! limits the max number of active (i.e. non aged-out) MACs allowed to Tx from this int. If int is trunk, this cmd allows the use of the [vlan] parameter.

(config-if)# switchport port-security mac-address [sticky] [mac] [vlan {vlan|voice}]                ! Define what mac address(es) are allowed on the port.

(config-if)# switchport port-security violation {shutdown | restrict | protect}

(config-if)# switchport port-security limit rate invalid-source-mac [100]                        ! Sets the limit for bad packets. In this example 100 units is used.

(config)# errdisable detect cause [all | causeName]

(config)# errdisable recovery cause [causeName | all]        ! e.g. psecure-violation

(config)# errdisable recovery interval seconds                                                ! defaults to 300 seconds.

# show int status err-disabled                                                                        ! brief list of err-disabled ints and reason.

# show port-security [int int]                                                                        ! Both with and without the parameter are very helpful. With int parameter, lists a ton of port-security info for an int.

# clear port-security {all|configured|dynamic|sticky} [address mac | int int]        ! clears specific entries from the L2 MAC address CAM table. Typically to then allow a known legit MAC on.

# show errdisable recovery

Storm-Control

(config-if)# storm-control [Broadcast|Multicast|Unicast] level {Rising%|Bps risingBps|Pps risingPps} [falling%|Bps fallingBps|Pps fallingPps]                ! Set thresholds for 1 type of traffic.

(config-if)# storm-control [Broadcast|Multicast|Unicast] level {Rising%|Bps risingBps|Pps risingPps} [falling%|Bps fallingBps|Pps fallingPps]                ! Set thresholds for another type of traffic.

(config-if)# storm-control action {shutdown | trap}        ! Set additional actions to take when any of the int’s rising thresholds are exceeded.

# show storm-control [Broadcast|Multicast|Unicast]        ! if no additional parameters are used, only returns for broadcast stuff. filter state={blocking||forwarding}.


SDN: Software Defined Networking

Criteria

OPEN SDN

ACI

APIC Enterprise

Changes dev control plane

Yes

Yes

No

Centralized point for automation / control

Yes

Yes

Yes

Degree to which control plane is centralized

Mostly

Partially

Not at all

SBIs used

OpenFlow

OpFlex

SSH + SNMP

Controller mentioned

OpenDaylight, Cisco OSC

APIC

APIC-EM

Main Organization behind it

ONF

Cisco

Cisco


Cloud Computing


IOS Upgrade

tftp-router(config)# ip tftp source-interface Loopback0                        ! Required on some devs like 4331s.

tftp-router(config)# tftp-server FS:file-name [alias shorterName]                ! Makes dev a tftp server, serving file-name, but it will also accept requests for shorterName as an alias for file-name.

R# show version                ! Record what OS this device is currently running.

! Verify enough flash for new OS during runtime via line “#K bytes of processor board System flash (Read ONLY)”.

! Verify enough RAM/DRAM for new OS during runtime via line “... with #K/#K bytes of memory.”. If 2 numbers like this, it is DRAM, combine the two for total DRAM.

R# show file systems                ! use this to verify you have drive space to hold the new OS or ideally both the current and the new OS. Verify if flash: or bootflash: or other location.

R# dir

! check what the first file is. When dev boots, it will attempt to load all OS’s listed in boot marker list(in nvram:/startup-config), and if none or unsuccessful, will attempt to boot to the first file in the default dir location (usually this is flash:).

R# copy tftp: FS:                ! here we copy from a tftp server to flash:, it will prompt then for the tftp server ip, the name (or alias) of the tftp server’s file to copy, and then the name to write it as.

! each “!” will represent 10 successful packets transmitted, while “O” mean something else ??? this will take a while (an hour or two maybe). The transfer continues even if the session times-out.

R# verify [/md5] FS:fileName expectedHash        ! verifies if what the dev has is the same as what it should. calculates the hash of the file and compares to expectedHash.

R(config)# no boot system                                ! removes all previously stated OS’s to boot to (not the files just the listing that says to boot to it)

R(config)# boot system FS:/fileName                ! make an entry (sequentially) telling dev to attempt to boot to this device in the order of the “boot system flash” cmds.

R(config)# boot system FS:/fileName                ! Tries this entry next if ^ fails. etc etc.

R# show run | b boot-start-marker                        ! find in running-config which os’s to attempt to load.

R# copy flash:/running-config nvram:/startup-config

R# reload [in 5] reason IOS-UPGRADE                    ! reload in a certain amount of time.

For Install mode see: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3850/software/release/16-3/release_notes/ol-16-3-3850.html#72234


Wireshark

Wireshark filters:

tcp.connection.syn

    #right click, follow tcp stream

ip.addr==192.168.1.10

    #only packets to/from that address

 


                TO BE ORGANIZED

NM = Cisco Network Module

write erase= erases nvram (non volatile memory) this will erase any configuration

clear start (startup config)= ^

show startup-config= show backup of current config

    if responds "startup-config is not present" means it has been erased or has never been made

reload = restart

__________________________

vty=virtual terminal  

 

netstat -an

 

 

TCP states:

ESTABLISHED    - SYN, SYN-ACK, ACK. / 3way handshake completed

LISTENING    - waiting for SYN

TIME_WAIT    - waiting for FIN-ACK ACK FIN-ACK ACK. Just going to sit here, eventually will time-out

 

UDP has no states

 

netstat -an | find "ESTABLISHED"

_________________________________

 

end

    #sends you back to non-enabled mode

 


Cable: uses the coaxial cable from TV lines (cable modem) shared BW

DSL: uses the copper PSTN lines (always on) dedicated

Dial-up: uses copper PSTN lines, but consumes line (can't use while on call

 

UDP header = Source+Des port, length, checksum

 

Serial DTE or DCE? "show controller serial0/0/0"

 

Suspend terminal session? "Ctrl+Shift+6 +X"

    Resume? "where"

                    "resume [connection]"

                    "resume" will resume the last connection

                    "2" will resume connection 2

                    "where" will list the connections

 

MTU: Maximum Txion Unit

normal : 1500 B

babyGiant: >= 1600 B

jumboFrame >=9216 B

system mtu BYTES                    

system mtu jumbo BYTES            (only on Gig)

 

 

 

<Multi-cast IP/MAC addresses>

0100.5E27.0C01

 

<Multi-cast IP/MAC addresses>

multicast IPs start with 224-239

First 24 bits of multicast MAC: 0100.5E

25th bit always 0/0

remaining 23 bits created from last 23 bits of the multicast IP add.

 

0000 0001 0000 0000

0101 1110 0|010 0111

0000 1100 0000 0001

 

x.39.12.1

</Multi-cast IP/MAC addresses>

 

_____________

 

 

 

 

which syslog msg type only accessible to admin on cli? debugging

# show ip cache flow

    shows which protocols (L4) use most traffic

when sending packet...

each device will replace "source MAC add" with it's own.

IP add will stay same though.

destination MAC = next hop's mac

"show protocols" =

show IP adds on each int

show layer1 & layer2 status of each each int

"show int" =

        see MACs on

--------

>restart int (that has been violated, by port security)

(config-if)# shutdown

(config-if)# no shutdown

>reset int

(config)# default int [int name]

>set L2 MAC add

(config-if)# mac-address 0200.0000.0011

# show int [int name]

# show int trunk

# show vlan [brief]

# show port-security int [int #]

# show vlan id <vlan ID>

# show run int <int>

# show port-security int [int #]

# show port-security

# show mac address-table

# show mac address-table dynamic

# show inventory

# show env fan

# show env power

# show env temperature

# show users                                                        ! show sessions

# clear line <number listed in ‘show users’>                ! this ends a session

Working on an HP (ProVision, Comware, 3Com) switch? Check out https://h17007.www1.hpe.com/docs/interoperability/Cisco/HP-Networking-and-Cisco-CLI-Reference-Guide_June_10_WW_Eng_ltr.pdf

# show tech-support

# show environment ! this includes much information including power temp and fans