This is a draft cheat sheet. It is a work in progress and is not finished yet.
vtp
vtp domain <domain name>
vtp mode <server|client>
vtp password <password> |
trunk
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate |
access port
switchport access vlan <vlan no>
switchport mode access |
port-channel
int range <interface1,interface2>
channel-group <group no> mode on
port-channel load-balance <src-mac|src-dst-ip> |
RSTP
spanning-tree mode rapid-pvst
spanning-tree portfast edge default
spanning-tree portfast edge bpduguard default
spanning-tree vlan 1-4094 priority 4096 |
PPPoE
int Dialer 1
ip address negotiated
ip mtu 1492
encapsulation ppp
ppp chap hostname <username>
ppp chap password <password>
dialer pool 1
int e0/0
pppoe enable
pppoe-client dial-pool-number 1
ip route 192.0.0.0 255.0.0.0 <peer IP address> |
Multicast
ip multicast-routing
int <vlan x>, <eth y>, <tun z>, lo0
ip pim spare-mode
ip pim rp-candidate lo0
ip pim bsr-candidate lo0
int <ext y>
ip igmp join-group <multicast group> |
DMVPN - Phase 3
Hub:
int tun 0
tunnel source <eth m/n>
tunnel mode gre multipoint
ip nhrp nextwork-id <y>
ip nhrp authentication <password>
ip nhrp map multicast dynamic
ip nhrp redirect
Spoke:
int tun 0
tunnel source dialer 1
tunnel mode gre multipoint
ip nhrp nextwork-id <y>
ip nhrp authentication <password>
ip nhrp map <VPN Hub IP> <NBMA Hub IP>
ip nhrp map multicast <NBMA Hub IP>
ip nhrp nhs <VPN Hub IP>
ip nhrp shortcut
[tunnel vrf <vrf name>] |
IPSec
crypto isakmp policy <x>
encryption aes
authentication pre-share
group 2
crypto isakmp key CCIE address 0.0.0.0
crypto ipsec transform-set <phase 2 transform> esp-aes
mode transport
crypto ipsec profile <profile name>
set transform-set <phase 2 transform>
int tunnel <y>
tunnel protection ipsec profile <profile name>
---
VRF:
crypto keyring CCIE vrf <vrf name>
pre-shared-key address 0.0.0.0 0.0.0.0 key CCIE |
DHCP
ip dhcp snooping
ip dhcp snooping vlan <x>
ip dhcp snooping verify mac-address
int <uplink>
ip dhcp snooping trust
---
DHCP Relay on a different switch:
int vlan <x>
ip dhcp relay information trusted
ip helper-address <DHCP server.
---
DHCP Server:
ip dhcp excluded-address <HSRP IP>
ip dhcp excluded-address <SVI 1 gateway>
ip dhcp excluded-address <SVI 2 gateway>
ip dhcp pool vlan <x>
network <subnet> <mask>
default-router <HSRP IP> |
HSRP IPv4
int vlan <x>
standby version 2
standby <y> ip <VIP>
standby <y> timers 1 3
standby <y> priority 102
[standby <y> preempt] |
HSRP IPv6
Gateway:
int vlan <x>
standby version 2
standby <y> ipv6 fe80:<z>::1
standby <y> priority 102
standby <y> preempt
standby <y> timers 1 3
---
Client:
int <x>/<y>
ipv6 address autoconfig |
IPv6 OSPFv3
ipv6 unicast-routing
router ospfv3 <x>
router-id <lo0 IP>
int range vlan <y>, vlan <z>, lo0
ospfv3 <x> ipv6 area 0
int vlan <w>
ospfv3 <x> ipv6 area 0
ipv6 nd router-preference <high|medium>
ipv6 nd ra interval <k> |
route-map
ip prefix-list <pl-name> permit 8.8.8.8/32
!
route-map <rm-name> permit 10
match ip address prefix-list <pl-name>
set local-preference 200
route-map <rm-name> permit 20
!
route-map TE permit 10
match ip address 101
set metric 100
!
route-map TE permit 20
match ip address 102
set metric 50
!
route-map TE permit 50 |
|
|
EIGRP
route-tag notation dotted-decimal
route-map tag permit 10
set tag 172.172.172.172
int lo 52
ip address 52.52.52.52 255.255.255.255
route-map 52 permit 10
match interface lo 52
router eigrp CCIE
address-family ipv4 autonomous-system 1
distribute-list route-map tag out
redistribute connected route-map 52
exit
[network <lo ip addr> <wild card>]
[network <ip addr> <wild card>] |
OSPF regular area
router ospf 1
router-id <lo0 ip addr>
[network <ip addr> <wild card> area 0]
[passive-interface <vlan x>]
int range <eth m/n, lo0>
ip ospf 1 area 0
int range <eth m/n>
ip ospf priority 255 |
show ip ospf neigh
show ip ospf interface brief
OSPF stub area
router ospf 1
[default-information originate]
[network <ip addr> <wild card>] area <x>
area <x> stub [no-summary]
int tun <y>
ip ospf network point-to-multipoint |
DHCP snooping
ip dhcp snooping
ip dhcp snooping vlan <vlan no>
ip dhcp snooping trust
ip dhcp relay information trusted
ip helper address <dhcp server ip>
ip dhcp excluded-address
ip dhcp pool <pool name>
network <subnet> <mask> |
PPPoE
[ip vrf name]
[rd m:n]
interface dialer <x>
[ip vrf forwarding name]
ip address negotiated
ip mtu 1492
encapsulation ppp
ppp chap hostname <username>
ppp chap password <password>
dialer pool <y>
interface <eth m/n>
pppoe enable
pppoe-client dial-pool-number 1
ip route [vrf name] <destination subnet> <mask> <ppp server ip> |
show ppp all
ping [vrf name] <destination ip addr>
OSPF EIGRP Redistribution
route-tag notation dotted-decimal
route-map O_TO_E deny 10
match tag 172.172,172.172
route-map O_TO_E permit 20
set tag 10.10.10.10
route-map E_TO_O deny 10
match tag 10.10.10.10
route-map E_TO_O permit 20
set tag 172.172.172.172
route-map EXT deny 10
match tag 172.172.172.172
route-map EXT permit 20
router ospf <x>
redistribute eigrp <y> subnets route-map E_TO_O
distribute-list route-map EXT in
network <lo0> 0.0.0.0
network <inside IP> <wild card>
router eigrp <name>
address-family ipv4 autonomous-system <y>
topology base
redistribute ospf <x> metric 10000 100 255 1 1500 route-map O_TO_E
exit
network <outside IP> <wild card> |
COPP
ip access-list extended <acl-name>
deny ospf any any
deny pim any any
deny tcp any any eq bgp
deny tcp any eq bgp any
deny esp any any
deny gre any any
deny udp any eq isakmp any
deny udp any any eq isakmp
permit ip any any ttl lt 2
class-map match-all <cmap-name>
match access-group name <acl-name>
policy-map <pmap-name>
class <cmap-name>
drop
control-plan
service-policy input <pmap-name> |
PAT
access-list <acl-no> permit <subnet summary> <wild card>
ip nat inside source list <acl-no> interface <outside int> overload
int <outside int>
ip nat outside
int <inside int>
ip nat inside
int <tun>
ip nat inside |
Track
track <x> ip route 0.0.0.0 0.0.0.0 reachability
int vlan <y>
standby <z> track <x> decrement 10 |
Load balance
! R12
access-list 101 permit ip 10.2.1.0 0.0.254.255 any
access-list 102 permit ip 10.2.0.0 0.0.254.255 any
!
route-map TE permit 10
match ip address 101
set metric 100
!
route-map TE permit 20
match ip address 102
set metric 50 |
|
|
BGP - IPV4 - Service Provider
! Route Reflector
router bgp <SP ASN>
bgp router-id <lo 0 ip addr>
no bgp default ipv4-unicast
neighbor IBGP peer-group
neighbor IBGP remote-as <SP ASN>
neighbor IBGP update-source lo0
neighbor <neigh ip addr> peer-group IBGP
neighbor <neigh ip addr2> peer-group IBGP
address-family ipv4
neighbor IBGP route-reflector-client
neighbor <neigh ip addr> activate
neighbor <neigh ip addr2> activate
! Border router - RR client
router bgp <SP ASN>
bgp router-id <lo 0 ip addr>
no bgp default ipv4-unicast
neighbor <RR ip addr> remote-as <SP ASN>
neighbor <RR ip addr> update-source lo0
neighbor <Customer IP> remote-as <Customer ASN>
address-family ipv4
neighbor <RR ip addr> activate
neighbor <RR ip addr> next-hop-self
neighbor <Customer IP> activate |
BGP - IPV4 - Customer with OSPF
! advertise certain prefixes
ip prefix-list core seq 5 permit <subnet>/<mask>
ip prefix-list core seq 10 permit <subnet2>/<mask2>
router bgp <Customer ASN>
bgp router-id <lo0 ip addr>
aggregate-address <aggr subnet> <mask> summary-only
[default-information originate]
[redistribute ospf <x> [match internal external 1 external 2]]
neighbor <SP IP> remote-as <SP ASN>
neighbor <SP IP> [prefix-list core out]
neighbor <iBGP Peer IP> remote-as <Customer ASN>
neighbor <iBGP Peer IP> update-source Loopback0
neighbor <iBGP Peer IP> next-hop-self
router ospf <x>
[default-information originate]
[redistribute bgp <Customer ASN > [metric-type 1] subnets] |
BGP - IPV4 - Customer with EIGRP
router bgp <local ASN>
redistribute eigrp <x>
router eigrp <name>
address-family ipv4 autonomous-system <x>
topology base
redistribute bgp <local ASN> metric 10000 100 255 1 1500 |
OSPF - BGP - EIRGP Redistribution
Customer 1:
router ospf <x>
redistribute bgp <Customer 1 ASN> metric-type 1 subnets
network <lo0 IP>
network <Customer 1 subnet> <wild card>
ip prefix-list <name> seq 5 permit <Customer 1 summary>/<prefix-length>
ip prefix-list <name> seq 10 permit <Customer 1 subnet>/<prefix length>
router bgp <Customer 1 ASN>
bgp router-id
aggregate-address <Customer 1 summary> <mask>
network <Customer 1 subnet> <wild card>
neighbor <Customer 2> remote-as <Customer 2 ASN>
neighbor <Customer 2> prefix-list <name> out
---
Customer 2:
router eigrp <name>
address-family ipv4 unicast autonomous-system <x>
topology base
redistribute bgp <Customer 2 ASN> metric 10000 100 255 1 1500
exit
network <lo0 IP>
network <Customer 2 subnet> <wild card>
ip prefix-list <name> seq 5 permit <Customer 2 summary>/<prefix length>
ip prefix-list <name> seq 10 permit <Customer 2 subnet>/<prefix length>
router bgp <Customer 2 ASN>
bgp router-id <lo0 IP>
aggregate-address <Customer 2 summary> <mask>
network <Customer 2 subnet> mask <mask>
neighbor <Customer 2 IP> remote-as <Customer 2 ASN>
neighbor <Customer 2 IP> prefix-list <name> out |
MPLS VPNV4
mpls label protocol ldp
mpls ldp router-id lo0
! OSPF
router ospf <x>
mpls ldp autoconfig area 0
! EIGRP
int <m/n>
mpls ip
! P router - Route Reflector
router bgp <y>
neighbor <RR client> remote-as <SP ASN>
neighbor <RR client> update-source lo0
address-family vpnv4
neighbor <RR client> activate
neighbor IBGP route-reflector-client
! PE router - Route Reflector Client
ip vrf <Customer VRF>
rd <Customer ASN:site no>
route-target export site no:site no
int <edge int>
ip vrf forwarding <Customer VRF>
ip address <addr> <mask>
router bgp <y>
no bgp default ipv4-unicast
neighbor <SP IPv4> remote-as <SP ASN>
neighbor <SP IPv4> update-source lo0
!
address-family vpnv4
neighbor <RR> activate
no neighbor <CE IP>
! Customer VRF
address-family ipv4 vrf <Customer VRF>
neighbor <CE IP> remote-as <Customer ASN>
neighbor <CE IP> activate
[neighbor <CE IP> as-override]
[neighbor <CE IP> local-as <old ASN no>]
neighbor <CE IP> soo <Customer ASN:site no>
! Global VRF
address-family ipv4
neighbor <SP IPv4> activate
neighbor <SP IPv4> next-hop-self
! CE router
ip prefix-list <name> deny <subnet>/<prefix length>
ip prefix-list <name> permit 0.0.0.0/0 le 32
router bgp <Customer ASN>
neighbor <PE IP> remote-as <SP ASN>
neighbor <PE IP> prefix-list <name> out |
|