Sunday, April 7, 2024

Cisco 107 - Inter-VLAN Routing via SVI (Switch Virtual Interface)

Jeremy introduces the concept of an "SVI" = Switch Virtual Interface in this video.  This is useful on a Layer 3 (Multilayer) Switch -- a switch that can also do layer 3 work (incluing routing).

First Jeremy removes VLAN config from router R1:

Remove the sub-interfaces:
R1(config)#no interface g0/0.10
R1(config)#no interface g0/0.20
R1(config)#no interface g0/0.30

R1(config)#default interface g0/0
^Resets the interface to its defaults

R1(config)#do show ip interface brief
^
View the config of R1 interfaces

R1(config)#interface g0/0
R1(config-if)#ip address 192.168.1.194 255.255.255.252
^Sets an IP address on R1's g0/0 interface

---

Now Jeremy reconfigures switch 2 (SW2) as a multi-layer switch and configures it to do VLAN routing.

SW2(config)#default interface g0/1
^Reset interface g0/1 to defaults

SW2(config)#ip routing
^Enables layer 3 routing on the multilayer switch

SW2(config)#interface g0/1
SW2(config-if)#no switchport
^These two commands change int g0/1 from a layer 2 switched port to a layer 3 routed port.

SW2(config-if)#ip address 192.168.1.193 255.255.255.252
^Since the interface is now a routed port, it needs a layer 3 IP address

SW2(config-if)#exit
SW2(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.194
^
These two commands tell SW2 to use R1 as its default route.
The IP address 192.168.1.194 is SW2's "next hop" and that IP address matches the one assigned to R1's connected interface up above

SW2(config)#do show ip route
^V
iews the route config on SW2

We can also see how an interface is configured to route with the command below.  Instead of showing a VLAN ID, the VLAN column will show "routed":

SW2#show interfaces status

Now we need to configure the SVIs (switch virtual interfaces) on SW2.
Create 3 SVIs and assign an IP address to each.  These IP addresses act as the "default gateways" to the PCs in the corresponding VLANs:

SW2(config)#interface vlan10
SW2(config-if)#ip address 192.168.1.62 255.255.255.192
SW2(config-if)#no shutdown
^This creates an SVI called "vlan10"
SVIs are shut down by default, so we have to turn them on

SW2(config-if)#interface vlan20
SW2(config-if)#ip address 192.168.1.126 255.255.255.192
SW2(config-if)#no shutdown
SW2(config-if)#interface vlan30
SW2(config-if)#ip address 192.168.1.190 255.255.255.192
SW2(config-if)#no shutdown

Recall that access or trunk ports on SW2 were already assigned to VLANs 10, 20, and 30.  So the switch has already created VLANs 10, 20, and 30.

 

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]


Cisco 106 - Configure native VLAN on a router

Two methods to configure native VLAN on a router:

1)Set the VLAN ID on a sububinterface:
(config)#int g0/0.10
(config-subif)#encapsulation dot1q 10 native

2)Config the IP address for the native VLAN on the router's physical interface. The encapsulation dot1q command is not necessary with this option.
First remove the subinterface:
(config)#no interface g0/0.10
Then configure the IP address of the physical interface:
(config)#interface g0/0
(config-if)#ip address 192.168.1.62 255.255.255.192

Here is the running config of a router with the physical interface using the native VLAN and two sub-interfaces configured for other VLANs:

!
interface GigEthernet0/0
 ip address 192.168.1.62 255.255.255.192
!
interface GigEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.1.126 255.255.255.192
!
interface GigEthernet0/0.30
 encapsulation dot1Q 30
 ip address 192.168.1.190 255.255.255.192
!


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]



Friday, April 5, 2024

Cisco 105 - Initial VLAN Trunk sub-interfaces

(config)#int g0/0
(config-if)#no shutdown
(config-if)#int g0/0.10
(config-subif)#encapsulation dot1q 10
(config-subif)#ip address 192.168.1.62 255.255.255.192
^ Sets IP address of sub-interface and uses VLAN 10
Any arriving frames tagged with Vlan 10 will be treated as if they arrived on this sub-interface
Also, any frames sent via this sub-interface will be tagged with Vlan 10

; Now sub-interface g0/0.20

(config-subif)#int g0/0.20
(config-subif)#encapsulation dot1q 20
(config-subif)#ip address 192.168.1.126 255.255.255.192

; Now sub-interface g0/0.30

(config-subif)#int g0/0.30
(config-subif)#encapsulation dot1q 30
(config-subif)#ip address 192.168.1.190 255.255.255.192

#show ip int brief
^
This shows the newly defined sub-interfaces as well as their IP addresses

#show ip route
^
This shows the “directly connected” networks just like regular interfaces


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

 

Cisco 104 - Initial VLAN Trunk commands

(config)#interface g0/0
(config-if)#switchport mode trunk
Command rejected: An interface whose trun encapsulation is “Auto” can not be configured to “trunk” mode.
^ If the command is rejected (such as on an older switch) first configure the port to use dot1q
(config-if)#switchport trunk encapsulation dot1q
(config-if)#switchport mode trunk

#show interfaces trunk
^
Shows which ports are configured for trunking, which Vlans are allowed on the trunk, which Vlans are allowed and active

#show vlan brief
; Shows each vlan and which ports are configured to use them

#int g0/0
(config-if)#switchport trunk allowed vlan 10,30
^
Allows Vlan 10 and 30 on interface
(config-if)#switchport trunk allowed vlan add 20
^
Adds Vlan 20 to allowed list
(config-if)#switchport trunk allowed vlan remove 20
^
removes Vlan 20 from allowed list
(config-if)#switchport trunk allowed vlan all
^
Allows all Vlans on the port.  This is the default state – all Vlans are allowed on trunk by default.
(config-if)#switchport trunk allowed vlan none
^
Removes all Vlans from allowed list.
(config-if)#switchport trunk native vlan 1001
^
Sets native vlan to 1001


[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

 

Cisco 103 - Initial VLAN commands

#show vlan brief
^Shows VLANs and which ports they are configured on
 
VLAN    Name   Status   Ports
1       default active    Gi0/0, Gi0/1, Gi0/2...
 
#interface range g1/0 - 3
^ Config multiple interfaces simultaneously: g1/0, g1/1, g1/2, and g1/3
 

(config-if-range)#switchport mode access
^ Config interfaces in access mode
as opposed to trunk mode

(config-if-range)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
^ Assign interfaces to vlan 10
Notice that vlan 10 did not exist so it had to create vlan 10


(config-if-range)#interface range g2/0 - 2
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20

#Vlan 30
^
If you need to create a vlan that did not get auto-created by previous commands
 
 
 
(config)#vlan 10
(config-vlan)#name Engineering
(config-vlan)#vlan 20
(config-vlan)#name HR
^ Assign names to VLANs
If VLAN did not exist, it would first create VLAN



(config)#int range Fa3/1, Fa4/1
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 10
(config-if-range)#int range Fa5/1, Fa6/1
(config-if-range)#switchport mode access
(config-if-range)#switchport access vlan 20
(config-if-range)#exit
(config)#exit
 

SW1#show int status

Port Name  Status    Vlan    Duplex Speed Type

Gig0/1     connected 10      auto   auto  10/100BaseTX

Gig1/1     connected 20      auto   auto  10/100BaseTX

Gig2/1     connected 30      auto   auto  10/100BaseTX

Fa3/1      connected 10      auto   auto  10/100BaseTX

Fa4/1      connected 10      auto   auto  10/100BaseTX

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]


Cisco 102 - Additional Initial Commands

R1# conf t
R1(config)# int g0/0
R1(config-if)#ip addr 10.1.2.3 255.255.255.0
R1(config-if)#no shutdown

show interfaces g0/0
^Displays details about g0/0

show interfaces description

Int    Status    Protocol    Description
G0/0    up    
    up        WJ3B
G0/1    up    
    up        WJ4B
G0/2    up    
    up        WJ5C
G0/3    down    
  admin-down    WJ6B

show ip route
^View routing table
 

R1(config)#do show ip route
^From config mode

ip route dest-addr mask next-hop
ip route 192.168.4.0 255.255.255.0 192.168.13.3

ip route dest-addr mask exit-int
ip route 192.168.1.0 255.255.255.0 g0/0

ip route 0.0.0.0 0.0.0.0 203.0.113.2
^Sets default gateway to 203.0.113.2

 

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]

 

Cisco 101 - Initial commands

enable
conf t

show startup-config
show running-config

write mem
copy running-config startup-config

Dangerous:

write erase
erase startup-config
erase nvram:

enable password CCNA
^Requires password "CCNA" to go into privileged mode.
Problem: Password stored in clear text in startup-config

service password-encryption
^Type "7" encryption.
Problem: Easily crackable

enable secret Cisco
^Use this one. Type "5" encryption (MD5).
If configured, device ignores "enable password"

show mac address-table
 

clear mac address-table dynamic

show ip interface brief

Int    IP-Addr        Status    Protocol

G0/0    10.1.2.3        up         up
G0/1    unassigned    admin down    down
G0/2


Router status default = admin down

Switch status default = down (until something is plugged in)

no ip domain-lookup
^Disables IOS from resolving incorrect commands as hostname to IP lookup (takes a long time)

logging synchronous
^Sync syslog messages to prevent interrupts while I am typing

term len 0
do sh run
^Displays running config without pausing after each screenful of info

Maybe on Aruba:
screen-length disable
or
no page

[These are my notes from Jeremy's excellent CCNA course which can be viewed here.]