Best Practices Guide
Best Practices Guide
interface g1/0/1
switchport mode access
switchport access vlan x
switchport nonegotiate
switchport port-security maximum 1
switchport port-security
switchport port-security aging time 10
spanning-tree portfast edge
spanning-tree bpdugard enable
spanning-tree guard root
storm-control broadcast level 20.00
storm-control multicast level 20
storm-control action trap
no cdp enable
interface g1/0/1
switchport mode access
switchport access vlan x
switchport nonegotiate
switchport voice vlan y
switchport port-security maximum 2
switchport port-security
switchport port-security aging time 10
spanning-tree portfast edge
spanning-tree bpdugard enable
spanning-tree guard root
storm-control broadcast level 20.00
storm-control multicast level 20
storm-control action trap
no cdp enable
interface g1/0/1
switchport mode trunk
switchport trunk allowed vlan x, y
switchport trunk native vlan z ---- (Z must be an unused VLAN)
switchport nonegotiate
storm-control broadcast level 20.00
storm-control action trap
no cdp enable
4) For trunk ports to device like Firewalls, routers, Load-balancers who don’t send BPDU.
interface g1/0/1
switchport mode trunk
switchport trunk allowed vlan x, y
switchport trunk native vlan z ---- (Z must be an unused VLAN)
switchport nonegotiate
spanning-tree portfast edge trunk
storm-control broadcast level 20.00
storm-control action trap
no cdp enable
5) STP
6) VLANs
vlan 100
name Server-VLAN
vlan 500
name Unused-VLAN
vlan 501
name Native-VLAN
7) VTP
In IOS:
vtp mode transparent
vtp ___domain abc
In NX-OS:
no feature vtp
interface g1/0/1
no ip redirects
no ip unreachables
no ip proxy-arp
no ip route-cache
no cdp enable
interface vlan 10
no ip redirects
no ip unreachables
no ip proxy-arp
no ip route-cache
no cdp enable
interface loopback10
no ip redirects
no ip unreachables
no ip proxy-arp
no ip route-cache
no cdp enable
10) HSRP
IOS:
key chain HSRP
key 1
key-string abcd@1234
interface g0/0
standby version 2
standby 5 ip 10.1.5.1
standby 5 timers 1 4
standby 5 priority 105
standby 5 preempt
standby 5 authentication md5 key-chain HSRP
interface vlan 5
standby version 2
standby 5 ip 10.1.5.1
standby 5 timers 1 4
standby 5 priority 105
standby 5 preempt
standby 5 authentication md5 key-chain HSRP
NX-OS:
key chain HSRP
key 1
key-string abcd@1234
interface g0/0
hsrp version 2
hsrp 5
ip 10.1.5.1
timers 1 4
priority 105
preempt
authentication md5 key-chain HSRP
interface vlan 5
standby version 2
standby 5 ip 10.1.5.1
standby 5 timers 1 4
standby 5 priority 105
standby 5 preempt
standby 5 authentication md5 key-chain HSRP
11) OSPF
int loopback 10
desc *** OSPF Router-ID ***
ip add a.b.c.d 255.255.255.255
router ospf 10
router-id a.b.c.d
passive-interface g0/0 – interface on which neighborship is not required.
int g0/0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 3 abcd@1234 – NX-OS
or
ip ospf message-digest-key 1 md5 abcd@1234 – IOS
12) EIGRP
int loopback 10
desc *** EIGRP Router-ID ***
ip add a.b.c.d 255.255.255.255
router eigrp 10
router-id a.b.c.d
passive-interface g0/0 – interface on which neighborship is not required.
int g0/0
ip authentication mode eigrp 10 md5
ip authentication key-chain eigrp 10 EIGRP
ip hello-interval eigrp 10 1
ip hold-time eigrp 10 3
13) BGP
int loopback 10
desc *** BGP Router-ID ***
ip add a.b.c.d 255.255.255.255
router bgp 10
router-id a.b.c.d
bgp log-neighbor-changes
neighbor a.b.c.d description *******
neighbor a.b.c.d password 7 xyz@1234
neighbor a.b.c.d timers 1 3 -- for LAN links
or
neighbor a.b.c.d timers 15 20 – for WAN links
a) Banner
banner login ^CC
*******************************************************************
*****
>>>>>>>>>>>>>>> ATTENTION <<<<<<<<<<<<<<<<
b) VTY acl
line con 0
session-timeout 5
exec-timeout 5 0
logging synchronous
line vty 0 4
session-timeout 5
access-class ssh-access in
exec-timeout 5 0
logging synchronous
transport input ssh
line aux 0
no exec
transport output none
no logging console
logging buffered informational
Logging trap debugging
logging x.x.x.x use-vrf default or management
logging source-interface mgmt0
logging timestamp milliseconds
f) Enabling SSH
ip ___domain-name abc.in
crypto key generate rsa general-keys modulus 2048
ip ssh time-out 60
ip ssh version 2
h) SNMP
Configure SNMP v3
Confiure SNMP ACL
archive
path disk0:archived-config
maximum 14
time-period 1440
write-memory
archive
log config
logging enable
logging size 200
hidekeys
notify syslog
k) AAA
line con 0
login authentication INNITI
authorization commands 0 INNITI
authorization commands 1 INNITI
authorization commands 15 INNITI
authorization exec INNITI
accounting exec INNITI
accounting commands 0 INNITI
accounting commands 1 INNITI
accounting commands 15 INNITI
line vty 0 4
login authentication INNITI
authorization commands 0 INNITI
authorization commands 1 INNITI
authorization commands 15 INNITI
authorization exec INNITI
accounting exec INNITI
accounting commands 0 INNITI
accounting commands 1 INNITI
accounting commands 15 INNITI
accounting connection INNITI
l) Disable unused services
no service pad
no service dhcp
no service tcp-small-servers
no service udp-small-servers
no service finger
no service config
no ip finger
no ip http server
no ip http secure-server
no ip bootp server
no ip source-route
no cdp run
no ip tftp source-interface
no ip ftp source-interface
no ip ftp username
no ip ftp password
no ip rcmd rsh-enable
no ip rcmd rcp-enable
no ip identd
no ip ___domain lookup
service tcp-keepalives-in
service tcp-keepalives-out
o) Password management
service password-encryption