CommandReference NET126 SRWEv7
CommandReference NET126 SRWEv7
Commands
NET126
Routing and Switching Essentials
V7
17 December 2019
R1# show run | section line vty Displays the line vty section only
R1# show ip int brief | include up Displays lines that are up
R1# show ip int brief | exclude unassigned Displays only assigned interfaces
R1# show ip route | begin Gateway Displays lines starting with the Gateway line
History
R1# show history Default history buffer size is 10
R1# terminal history size 200 sets the history buffer size to 200
Verify Auto-MDIX
S1# show controllers ethernet-controllers g0/1 phy | include Auto-MDIX
Create a VLAN
S1(config)# vlan 10 VLAN created with an ID of 10
S1(config-vlan)# name Student VLAN 10 with the name of Student
Delete a VLAN
S1(config)# no vlan 10
Trunk Configuration
S1(config)# interface fa0/1
S1(config-if)# switchport mode trunk Switches the interface into trunk mode
S1(config-if)# switchport trunk native vlan 88 Places the interface into the native VLAN of 88
S1(config-if)# switchport trunk allowed valn 10,20,30 Allows on traffic for VLANS 10, 20, 30
Troubleshoot Trunks
S1# show interface trunk
S1# show interface fa0/1 trunk
S1# show interface fa0/1 switchport
Configuring PVST+ with lowest priority value possible (default is 32768 – lower the number the higher the
priority)
S1 (config)# spanning-tree vlan 10 priority 4096 *sets S1 as likely priority for
VLAN 10
S2 (config)# spanning-tree vlan 20 priority 4096 *sets S1 as likely priority for
VLAN 20
Configuring Rapid PVST+ with Designated VLAN priorities, Interface to a Link Type of Point-to-Point, and
Clear previously detected STP priorities
S1 (config)# spanning-tree mode rapid-pvst
S1 (config)# spanning-tree vlan 1 priority 24576
S1 (config)# spanning-tree vlan 10 priority 4096
S1 (config)# spanning-tree vlan 20 priority 28672
CommandReference-NET126-SRWEv7.docx 12/17/2019 Page 13 of 33
S1 (config)# interface f0/1
S1 (config-if)# spanning-tree link-type point-to-point
S1 (config)#end
S1# clear spanning-tree detected-protocols
Etherchannel Modes
S1 (config-if-range)# channel-group 1 mode desirable *enables PAgP
S1 (config-if-range)# channel-group 1 mode auto *enables PAgP if PAgP id detected
S1 (config-if-range)# channel-group 1 active *enables LACP
S1 (config-if-range)# channel-group 1 mode passive *enables LACP if LACP is detected
S1 (config-if-range)# channel-group 1 mode on *enables Etherchannel
Troubleshooting DHCP
R1# show ip dhcp conflict Verifies there aren’t any IP address conflicts
R1# show interface g0/0
R1# show running-config Verify DHCP configurations
R1# debug ip dhcp server events Reports address assignments, updates, etc..
Enables/Disables DHCP
R1# service dhcp Enables DHCP
R1# no service dhcp Disables DHCP
MISC
IPv6 all-node multicast address FF02::1
CommandReference-NET126-SRWEv7.docx 12/17/2019 Page 19 of 33
IPv6 all-router multicast address FF02::2
All relay and server multicast address FF01::1:2
S1 (config)# ip arp inspection vlan 10 VLAN 10 has ARP inspection enabled for end
devices within VLAN 10
S1 (config)# ip arp inspection validate src-mac Checks source MAC in Ethernet header against
sender MAC address in ARP body
S1 (config)# ip arp inspection validate dst-mac Checks destination MAC in Ethernet header
Against target MAC address in ARP body
S1 (config)# ip arp inspection validate ip Checks ARP body for invalid and unexpected IP
addressing to include multicast addresses
R1(config)# router rip Enables access to router config mode for RIP
R1(config-router)# version 2 Enables RIP version 2 (Classless subnetting
allowed, custom subnetting, or VLSM)
R1(config-router)# network 192.168.1.64 192.168.1.64 will now use configured
subnetmask and not switch to Class C default
mask
Show Commands
R1# show ip protocols Displays configured IPv4 routing protocols
R1# show ip protocols | section default Filters to the running version of RIP
R1# show ip route Displays the routes in the routing table
R1# show ip route | begin Gateway Displays routes in the routing table starting at
the gateway of last resorts or default route
RIPv2 Example
R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# no auto-summary
R1(config-router)# network 192.168.1.0
R1(config-router)# network 192.168.2.64
R1(config-router)# passive-interface g0/0
R1(config-router)# default-information originate
Enabling Debug
R1# debug ip rip
R1# debug ip routing
R1# no debug ip rip
R1# no debug ip routing
RIPng Example
R1(config)# ipv6 unicast-routing
R1(config)# ipv6 router rip CISCO CISCO is the RIP-AS
R1(config-router)# exit
R1(config)# interface s0/0/0
R1(config-inf)# ipv6 rip CISCO enable
R1(config-inf)# interface s0/0/1
R1(config-inf)# ipv6 rip CISCO enable
R1(config-inf)# interface g0/0
R1(config-inf)# ipv6 rip CISCO enable
R1(config)# ip route 192.168.1.0 255.255.255.0 s0/0/0 Directly connected static route (exit interface)
R1(config)# ip router 192.168.2.0 255.255.255.0 172.16.1.2 Next Hop static route (with next hop address)
R1(config)# ip route 192.168.3.0 255.255.255.0 s0/0/0 172.16.2.2 Fully Specified static route (exit interface and
next hop address)
R1(config)# ipv6 route 2001:db8:acad:1::/64 s0/0/0 Directly connected static route (exit interface)
R1(config)# ipv6 router 2001:db8:acad:2::/64 2001:db8:acad:a::1 Next Hop static route (with next hop address)
R1(config)# ipv6 route 2001:db8:acad:b::/64 s0/0/0 2001:db8:acad:a::1 Fully Specified static route (exit interface and
next hop address)
Branch (config)# ip route 209.165.200.238 255.255.255.255 198.51.100.2 ISP router external interface to server
Branch (config)# ipv6 route 2001:db8:acad:2::238/128 2001:db8:acad:1::2 ISP router external interface to server
Verifying CDP
R1# show cdp neighbors
R1# show cdp neighbors detail
R1# show cdp interface
Verifying LLDP
S1# show lldp
S1# show lldp neighbors
S1# show lldp neighbors detail
Syslog Configuration
R1(config)# logging 192.168.1.3 Sends Syslog traffic to 192.168.1.3 server
R1(config)# logging trap 4 Logs severity trap levels 4 and below
R1(config)# logging source-interface g0/0 Sets source interface
Verify Syslog
R1# show logging
R1# show logging | include changed state to up Shows logging info for interface in up status
R1# show logging | begin Jun 12 22:35 Shows logging at/after the designated time
AND
Restoring:
R1# copy tftp running-config Retrieve running-config file from TFTP
Address or name of remote host []? 192.168.10.3 TFTP server Ip address (192.168.10.3)
Destination filename [r1-config]? R1-Jan-2019 File name (R1-Jan-2019)
Write file R1-Jan-2019 to 192.168.10.3? [confirm]
Writing R1-Jan-2019!!!!!! [OK]
AND
R1# copy TFTP startup-config Retrieve startup-config file from TFTP server
Address or name of remote host []? 192.168.10.3 TFTP server Ip address (192.168.10.3
Destination filename [r1-config]? R1-Jan-2019 File name (R1-Jan-2019)
Write file R1-Jan-2019 to 192.168.10.3? [confirm]
Writing R1-Jan-2019!!!!!! [OK]
Activating the New IOS (Boot System Command) – After Copying the New IOS to Flash
R1(config)# boot system flash: //c1900-universalk9-mz.SPA.152-4.M3.bin
R1#(config)# end
R1# copy running-config startup-config
R1# reload