Basic Device Setup
On this page
Purpose
- This page holds many small configurations that don’t need their own document, but fall under the umbrella of basic device setup
- Some topics do have a separate more in-depth configuration pages, and some have in-depth theory pages as well. (linked if applicable)
- This page is a good checklist for building out initial devices configurations before adding other protocols or more in depth config of things listed here as needed. Not every topic will or should always be configured depending on context.
- Use with
Basic Device Securitypage
- Use with
Improvments
- Add VLANS and Trunking
Hostnames
Configuration
hostname {hostname}Verification
- prompt will update to hostname
- find configuration line
show run | i hostnameIP addresses
Configuration
- Physical switch ports need to be converted to routed interface first with
no switchport - Enable the port after setting IP with
no shutdown, or it will be administratively down by default. Even on converted switch ports- Loopback ports don’t need to be enabled, but they can be shutdown/disabled with
shutdown
- Loopback ports don’t need to be enabled, but they can be shutdown/disabled with
- Port on Router
interface {interface-name}
ip address {ip-address} {subnet-mask}
no shut- Port on switch
- Same, but uses
no switchportcommand
- Same, but uses
interface {interface-name}
no switchport
ip address {ip-address} {subnet-mask}
no shutVerification
- List all IP or routed ports briefly and up/down status
- Does not show subnet mask
sh ip int br- List detailed interface information including subnet mask
- Includes L1/L2 information
show int {interface-name}- List detailed interface information similar to above, but shows detailed L3 related info
show ip int {interface-name}- Look at actual configuration
- interface name needs to have correct case. i.e.
GigabitEthernet0/0 - You can leave out the interface name to see all interfaces
- interface name needs to have correct case. i.e.
sh run | sec interface {interface-name}- Look at connected and local routes related to ip address in routing table
show ip route connected- ping ip address on the other end of routed link (if configured) to verify connectivity
ping {remote-ip-address}Enable IP Routing on Switches and Switchports
IP Routing on Switches Configuration
- Most switches do not support ip routing default, so it needs to be enabled
ip routingIP Routing on Switches Verification
- Can verify by looking at routing table, it ip routing is enabled you will see normal output, you can still run command if it’s not enabled, but it will be obvious
show ip route- Does not show up with
show running-configcommand, but you can see it withallkeyword added
show running-config all | i ip routingIP routing on Switchports Configuration
interface {interface-name}
no switchport- Turn port back into swichport, but it will erase any L3 configs on the port
interface {interface-name}
switchportIP Routing on Switchports Verification
- If converted to L3 port Vlan column will show
routed, and if still switchport it will show vlan number ortrunkif set to trunk
show int status- Interface will no longer show in
show interface switchportand if it’s been converted
sh int switchport | b Name: Gi0/2- Look at running config
show run int {interface-name}Port Descriptions
Configuration
- Descriptions label interfaces so they can be easily identfied when verifying and troubleshooting
int {interface-name}
description {example-description}Verification
show int descriptionshow run interface {interface}Enabling and Disabling Ports
Configuration
- Router interfaces are disabled by default, and switch ports are enabled by default (unless they have been converted to routed/L3 ports with
no switchport) - Disable port. Will show as
administratively down
int {interface-name}
shutdown- enable port, will show as up/up or
connecteddepending on show command and assuming no other issue keeping port disabled
int {interface-name}
no shutVerification
show int statusshow ip int brshow int {interface-name}Domain Name (Turn into DNS section)
Configuration
- needed before you can configure generate crypto key for ssh
- this will be appended to domain lookups
ip domain-name {example.com}Verification
show hostssh run | i ip domain-nameDNS Server (Turn into DNS section)
- Tells router or switch the ip address of the dns server to use for dns lookups
Configuration
ip name-server {ip-of-dns-server}Verification
show hostssh run | i ip name-serverPrevent Unwanted DNS Queries (Turn into DNS section)
- If the device does not need to dns lookups, which might be common so things aren’t failing if dns is down, then preventing lookups can prevent terminal from being locked up for 10s while lookup occurs
Configuration
no ip domain-lookupVerification
- Only shows in running-config if disabled
sh run | i no ip domain-lookupPrevent Log Messages From Filling up Terminal While Typing
- When configuring a device via console syslog messages appear in the terminal and move what your typing to the end of the log message line. If a lot of log messages happen at once it can interupt typing and cause you to get lost.
logging-synchronuscommand under console line configuration will make print log messages and move you back to what your typing cleanly. You could just hit tab if not configured to get what your typing to show up under log message
Configuration
line con 0
logging synchronousVerification
sh run | s line con 0Banners
- 3 types of banners on cisco devices
- login - visible before login prompt when connecting to device via ssh
- motd and exec
- visible when first connecting to device via console or ssh before entering privileged exec mode or enable mode
- You need a start character then the same as and end character with the banner text in between
Configuration
banner exec c !!!!!!!!!EXEC BANNER!!!!!!!!!!!!!! cbanner login c !!!!!!!!!LOGIN BANNER!!!!!!!!!!!!!! cbanner motd c !!!!!!!!!MOTD BANNER!!!!!!!!!!!!!! cVerification
show banner {banner-type}show run | i bannerManagement VLAN Interface
- Creating a separate vlan interface for mgmt services allows you restrict ssh to this ip interface from allowed mgmt ip address ranges
- Create and name VLAN
- Create VLAN interface
- If L2 switch you will need to configure
ip default-gatewayso traffic can return to device your connecting from
Configuration
vlan {mgmt-vlan-number}
name {mgmt-vlan-name}
!
int vlan {mgmt-vlan-number}
ip add {ip} {subnet-mask}
no shut
exit
!
! If L2 switch
ip default-gateway {mgmt-vlan-default-gateway}Verification
- Look for mgmt vlan
show vlan brief- Look for mgmt vlan interface config
sh run | s vlan interface briefNTP Server
- It’s best practice to configure edge devices like edge router or edge firewall as NTP server for other devices in your network, and have the edge device get it’s time from an NTP server on the internet
- This prevents every network device from needing to connect to the internet for NTP
- Point device at NTP server to get it’s time from an authoritative source
Configuration
- Points network device to NTP server on your network
- Includes NTP authentication
- NTP key number and key is same as configured on edge device
ntp authentication-key {key-number} md5 {password}
ntp trusted-key {key-number}
!
ntp server {edge-device-ip} key {key-number}Verification
- Various commands will relatively little output that are pretty self explanatory
show ntp statusshow ntp associationsshow ntp configshow ntp informationshow ntp packetssh run | s ntp Clock and Timezone
Rarely will this be needed, you should be using NTP
- If you aren’t using NTP because it’s a really small network and your handing admin over to a non-technical person maybe do this
- If you are using NTP, but not a SIEM or syslog server to centralize logs that can’t convert from UTC to your timezone, then maybe configure just timezone and daylight savings
- IF YOUR USING A SIEM to send logs to, like splunk, it’s usually best practice to have devices send logs in UTC with no daylight savings config, and let the SIEM convert timestamps for you
By default, network devices use UTC
By default, the time source is the internal device clock
- known as the
hardware calander - It’s not authoritative and will drift over time
- known as the
If you are configuring clock without ntp you need to know about the 2 clocks on device (don’t do in real life only in lab if you need it and NTP doesn’t work for that use case)
- software clock
- hardware clock (calendar)
- Always sync these clocks
clock update calendarorclock read calender
Configuration
- You can manually configure time on device, but you shouldn’t do that and should use NTP, so really only for labs you might want to configure this
- Configure software clock
- enable mode not config mode
clock set {hh:mm:ss} {day or month} {month or day} {year}- Configure hardware clock
- enable mode not config mode
calendar set {hh:mm:ss} {day or month} {month or day} {year}- Configure timezone
clock timezone {name} {hours-offset} {minutes-offset}- Daylight savings
- shortened, but for start and end you need to specify week, weekday, month, and time
clock summer-time recurring {name} {start} {end} {offset}Verification
show clockshow clock detailService Timestamps
- Even when using NTP and sending logs to syslog server or SIEM it’s good idea to have device create log messages with the millaseconds and year added to the timestamps
- You should do the same for debug logs on the device
Configuration
service timestamps log datetime msec yearservice timestamps debug datetime msec yearVerification
sh run | i service timestampsCDP
- CDP is enabled by default and is a cisco proprietary protocol, so you won’t see information from non cisco devices
- Shares information about connected network devices
- Great for building out network diagrams
- v2 is enabled by default, don’t use v1
- timer is 60s
- holdtime is 180s
Configuration
- globally enable or disable cdp
cdp run- enable or disable on interfaces
cdp enable- configure timers
cdp timer {seconds}cdp holdtime {seconds}Verification
show cdpshow cdp trafficshow cdp interfaceshow cdp neighborsshow cdp neighbors detailshow cdp entry {hostname}LLDP
- LLDP is open source, so you can see information from non cisco devices
- Disabled by default on cisco
- timer is 30s
- holdtime is 120s
- Needs to be enabled globally and on each interface
Configuration
- enable globally, then on each interface
lldp run- enable transmit on interfaces, will send but discard received messages
lldp transmit- enable receive
lldp receive- lldp timer
lldp timer {seconds}- lldp holdtime
lldp holdtime {seconds}- lldp re-int timer, waits to initialize lldp for this value in situations where it’s flapping (i.e device is coming on and offline quickly)
lldp reint {seconds}Verification
show lldpshow lldp trafficshow lldp interface- Shows hold-time as static value does not count down like in cdp
show lldp neighbors- Does show hold-time countdown
show lldp neighbors detailshow lldp entry {hostname}Syslog
- You can point logs to SIEM or syslog server
- You can set a level of logs to be sent to server
- You configure a level and that level and anything more severe gets sent
- You can force logs to be sent from a specific source like MGMT interface/vlan
- 4 main log destinations
- buffered - ram on device, will be lost after reboot
- host - remote SIEM or syslog server
- console - enabled by default
- monitor - vty or ssh terminal sessions
- sent by default, but they won’t be streamed to terminal without enable command
terminal monitorwhile ssh’d into device
- sent by default, but they won’t be streamed to terminal without enable command
Configuration
- Send logs to SIEM or syslog server
logging {SIEM-or-syslog-ip}- Usually sending informational logs and everything more serious (lower numbers)
logging trap {level}- set max amount of logs to be stored on device locally
logging buffered {ram-to-be-dedicated}- Command to have logs stream to terminal when connected over vty (ssh) like default console line behavior
terminal monitorStacking Technologies (Needs work)
Stackwise
- Common in access layer switches
- Catalyst 3750, 3850, 9200, 9300
- Stack up to 8 switches
- One active device runs control plan
- One standby device for failover if active goes down
- Rest are members
- Switches need to be running the same version of IOS to stack
Stackwise Config
- Setting Active switch to always become active with highest value
switch 1 priority 15- Set Standby switch with 2nd highest value
switch 2 priority 14- Renumbering switches, must reload device to take effect
switch 3 renumber 2Stackwise Verification
- view all switches in stack , role, mac, priority, and any issues with devices joining stack
show switchshow switch detailshow switch stack-portsshow switch stack-ring speedshow redundancyStackwise Virtual
- Common in distro and core layers
- Catalyst 9400, 9500, 9600
- Switches are linked with fiber cable, so they can be much farther apart
- Dual-active detection is needed to prevent switches from both thinking they are active
Stackwise Virtual Config
Stackwise Virtual Verification
- Virtual Switching System
- Common in distro and core layers
- Catalyst 4500, 6500, 6800
- Connects 2 devices over ethernet ports
Cisco Nexus vPC
- Used with nexus devices
- Each switch has it’s own separate control plane and management IP
- Downstream devices see a single switches