Tuesday, July 15, 2014

Cisco Configuration Cheat Sheet - Part 1

I'm teaching CIS-81 Fundamentals of Networking next semester (with the great Rick Graziani). The class is taught using Cisco equipment. Until this summer I've never touched a piece of Cisco hardware in my life. What an eye opener! The CLI is very strange and primitive compared to Linux. But it's a CLI, therefor I like it.

I've been using Packet Tracer (AMAZING!) to do my labs and it's really incredibly fun. So here are the first tasks I do when setting up a network. The network is pictured on the left.

I'm going to start by configuring the router. I don't use the default configuration dialog because I want to do everything myself.

// Step 0: Basics 
> enable
# config t 
(config)# hostname ginsu
(config)# ip domain name lifealgorithmic.com // Need for SSH
(config)# banner login \
(config)# banner motd \

// Step 1: Security 
// Set the "enable" password. Never use enable password!
(config)# enable secret cisco 

// Set the password to login to the console

(config)# username cisco secret cisco 
(config)# line console 0 
(config-line)# login local
(config-line)# logging synchronous // I don't actually like this

// Make sure the login password is "encrypted"

(config)# service password-encryption

// Enable SSH (and disable evil Telnet)

(config)# crypto key generate rsa 
(config)# line vty 0 15
(config-line)# transport input ssh
(config-line)# login local

// Step 2: Interfaces (on the Router)

(config)# interface GigabitEthernet 0/1
(config-if)# ip address 10.0.0.1 255.0.0.0
(config-if)# ipv6 address 2001:db8:fade:1::1/64
(config-if)# ipv6 address fe80::1 link-local
(config-if)# description MyInterface
(config-if)# no shutdown

// Step 3: Management Interface (on the Switch)

(config)# interface Vlan 1
(config-if)# ip address 10.0.0.2 255.0.0.0
(config-if)# ipv6 address 2001:db8:fade:1::2/64
(config-if)# no shutdown

// Step 4: Configure DHCP on the router

(config)# ip dhcp excluded-address 10.0.0.1
(config)# ip dhcp excluded-address 10.0.0.2
(config)# ip dhcp pool mynet
(dhcp-config)# default-router 10.0.0.1
(dhcp-config)# dns-server 8.8.8.8
(dhcp-config)# network 10.0.0.0 255.0.0.0

// Step 5: Make it stick
# copy running-config startup-config
# reload

No comments:

Post a Comment