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.]

Thursday, August 24, 2023

Saturday, July 15, 2023

Ubuntu customizations compendium

Do this when moving into a new Ubuntu machine on Windows Subsystem for Linux:

Brighten bash colors and brighten the bash prompt:

.bashrc

LS_COLORS='rs=0:di=1;35:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';
export LS_COLORS

PS1='\e[37;1m\u@\h \e[35m\w/ \e[0m\$ '

------------------------------------

 

Turn off the bells

.inputrc:

 set bell-style none

------------------------------------

 More bells, brighten colors in VIM, and fix double-characters in VIM

.vimrc

 set background=dark
set t_u7=
set belloff=all

------------------------------------