aadd day 9 Switch Interfaces
This commit is contained in:
@@ -17,3 +17,4 @@ tags:
|
||||
[[Ethernet LAN Switching (part 1)]]
|
||||
[[Ethernet LAN Switching (part 2)]]
|
||||
[[IPv4 Addressing (Part 1)]]
|
||||
[[IPv4 Addressing (Part 2)]]
|
||||
|
||||
118
08. IPv4 Addressing (Part 2).md
Normal file
118
08. IPv4 Addressing (Part 2).md
Normal file
@@ -0,0 +1,118 @@
|
||||
---
|
||||
id: 08. IPv4 Addressing (Part 2)
|
||||
aliases: []
|
||||
tags: []
|
||||
---
|
||||
|
||||
# IPv4 Addressing (Part 2)
|
||||
|
||||
## [[IPV4]] address classes
|
||||
|
||||
|
||||
| Class |First octet | numeric range| Prefix Length |
|
||||
| ----- | ---------- | --------------| /8 |
|
||||
| A |0xxxxxxxx | 0-127 | /16 |
|
||||
| B |10xxxxxxx | 128-191 | /24 |
|
||||
| C |110xxxxxx | 192-223 | |
|
||||
| D |1110xxxxx | 224-239 | |
|
||||
| E |1111xxxxx | 240-255 | |
|
||||
|
||||
## Maximum Hosts per Network
|
||||
|
||||
Host portion all 0s = Network address (network ID)
|
||||
Host portion all 1s = broadcast address
|
||||
|
||||
192.168.1.0/24 -> 192.168.1.255/24
|
||||
Host portion = 8 bits = 2^8 = 256
|
||||
Maximum hosts per network = 2^8-2 = 254
|
||||
|
||||
|
||||
172.16.0.0/16 -> 172.16.255.255/16
|
||||
Host portion = 16 bits = 2^16 = 65,536
|
||||
Maximum hosts per network = 2^16 -2 = 254
|
||||
|
||||
10.0.0.0/8 -> 10.255.255.255/8
|
||||
Host portion = 24 bits = 2^24 = 16,777,216
|
||||
Maximum hosts per network = 2^24 -2 = 16,777,214
|
||||
|
||||
### Formula
|
||||
|
||||
```
|
||||
maximum host per network = 2^n-2
|
||||
(n=number of hist bits)
|
||||
```
|
||||
|
||||
## First/last usable address
|
||||
|
||||
192.168.1.*0*/24 ---------> 192.168.1.*255*/24
|
||||
00000000 11111111
|
||||
00000001 11111110
|
||||
192.168.1.*1*/24 192.168.1.*254*/24
|
||||
= first usable address = last usable address
|
||||
|
||||
## Cisco router command
|
||||
|
||||
|
||||
### For all the interface info
|
||||
|
||||
```Cisco
|
||||
R1#show ip interface brief
|
||||
|
||||
Interface IP-address OK? Method Status Protocol
|
||||
GigabitEthernet0/0 Unassigned YES unset adminstratively down down
|
||||
```
|
||||
|
||||
- adminstratively down: Interface has been disabled with the shutdown command
|
||||
- This is the default Status of Cisco [[router]] interfaces.
|
||||
- Cisco switch interfaces are NOT administratively down by default
|
||||
- Status = Layer 1 status (is there a cable)
|
||||
- Protocol = Layer 2 status (is ethernet function conrectly)
|
||||
|
||||
|
||||
### enter the configuration mode for the interface
|
||||
```Cisco
|
||||
// shortcut for configuration terminal
|
||||
R1#conf t
|
||||
// for configuration of the interface
|
||||
R1#interface gigabitethernet 0/0
|
||||
//shortcut
|
||||
R1#in g0/0
|
||||
```
|
||||
|
||||
### setting the ip adress
|
||||
|
||||
```Cisco
|
||||
R1#ip address 10.255.255.254 255.0.0.0
|
||||
//enable the interface
|
||||
R1#no shutdown
|
||||
// view the change
|
||||
R1#do show ip interface brief
|
||||
// shortcut version
|
||||
R1#do sh ip int br
|
||||
```
|
||||
|
||||
### show interfaces
|
||||
|
||||
to see all the details of the interface
|
||||
|
||||
```Cisco
|
||||
R1#show interfaces g0/0
|
||||
```
|
||||
|
||||
### descriptions of an interface
|
||||
|
||||
```Cisco
|
||||
// see all the description
|
||||
R1#show interfaces description
|
||||
// for assigning a description
|
||||
// swithc to configuration interface
|
||||
R1#int g0/0
|
||||
R1# description ## to SW1 ##
|
||||
```
|
||||
|
||||
## Review
|
||||
|
||||
- IPV4 address classes (review clarification)
|
||||
- Finding the maximum number of hosts, network address, broadcast address, first usable address,
|
||||
last usable address of a particular network
|
||||
- Configuring IP addresses on Cisco device
|
||||
176
09. Switch Interfaces.md
Normal file
176
09. Switch Interfaces.md
Normal file
@@ -0,0 +1,176 @@
|
||||
---
|
||||
id: 1777334914-ICRP
|
||||
aliases:
|
||||
- Switch Interfaces
|
||||
tags: []
|
||||
---
|
||||
|
||||
# Switch Interfaces
|
||||
|
||||
## Show interface
|
||||
|
||||
To see all the [[Switch]] interfaces in the CLI use
|
||||
|
||||
```cisco
|
||||
SW1>en
|
||||
SW1#show ip interface bief
|
||||
```
|
||||
|
||||
[[Router]] interfaces have the shutdown command applied by default
|
||||
- will be in the administratively down/down state by default
|
||||
Switch interfaces do Not have the shutdown command applied by default
|
||||
- will be in the up/up stateif connected to another device
|
||||
- Or in the down/down state if not connected to another device
|
||||
|
||||
also you can use another command for switches
|
||||
|
||||
```cisco
|
||||
SW1#show interface status
|
||||
Port Name Status Vlan Duplex Speed Type
|
||||
```
|
||||
|
||||
Port
|
||||
- The physical interface on the switch
|
||||
Name
|
||||
- Optional description configured by the admin
|
||||
Status
|
||||
- connected notconnect ,disabled or err-disabled
|
||||
Vlan
|
||||
- The VLAN the port belongs to
|
||||
Duplex
|
||||
How data flows:full, half , auto (ex: a-full)
|
||||
🚀 Speed
|
||||
Port speed in Mbps or Gbps (ex: a-100)
|
||||
🧬 Type
|
||||
Physical interface type (ex: 10/100BaseTX)
|
||||
|
||||
## Configuring interface speed and duplex
|
||||
|
||||
For the speed
|
||||
|
||||
```cisco
|
||||
SW1#conf t
|
||||
SW1(config)#interface f0/1
|
||||
SW1(config)#speed ?
|
||||
SW1(config)#speed 100
|
||||
```
|
||||
|
||||
For the duplex
|
||||
|
||||
```cisco
|
||||
SW1(config)#duplex ?
|
||||
SW1(config)#duplex full
|
||||
```
|
||||
|
||||
For the description (Name)
|
||||
|
||||
```cisco
|
||||
SW1(config)#description ## to R1 ##
|
||||
```
|
||||
|
||||
## Configure a range of interface
|
||||
|
||||
You can configure a range of interface with the command
|
||||
|
||||
```cisco
|
||||
SW1(config)#interface range f0/5 - 12
|
||||
SW1(config-if-range)#description ## not in use ##
|
||||
//disable all the interface at once
|
||||
SW1(config-if-range)#shutdown
|
||||
```
|
||||
|
||||
you can do this to multiple range
|
||||
|
||||
```cisco
|
||||
SW1(config)#interface range f0/5 - 6, f0/9 - 12
|
||||
```
|
||||
|
||||
## Full / Half Duplex
|
||||
|
||||
**Half duplex** : The device cannot send and receive data at the same time.
|
||||
if it is receiving a frame, it must wait before sendig a frame.
|
||||
- Devices attached to a hub must operate in half duplex
|
||||
|
||||
**Full duplex** : The device can send and receive data at the same time
|
||||
it does not have to wait.
|
||||
- Devices attached to a switch can operate in full duplex
|
||||
|
||||
### CSMA/CD
|
||||
|
||||
Carrier Sense Multiple Access with Collision Detection
|
||||
- Before sendig frames, devices 'listen' to the collision domain until they detect that
|
||||
other devices are not sending
|
||||
- if a collision does occur, the device sends a jamming signal to inform the other
|
||||
devices that a collision happened
|
||||
- Each device will wait a random period of time before sending frames again.
|
||||
- The process repeats.
|
||||
|
||||
## Speed/Duplex Autonegotiation
|
||||
|
||||
- Interfaces that can run at different speeds (10/100 or 10/100/1000) have default settings
|
||||
of speed uto and duplex auto
|
||||
|
||||
- Interfaces 'advertise' their capabilities to the neighboring device, and they negociate
|
||||
the best spedd and duplex settings they are both capable of.
|
||||
|
||||
- What of autonegotiation is disabled on the device connected to the switch?
|
||||
- **Speed**: the switch will try to sense the speed that the other device is operating at.
|
||||
if it fails to sense the speed, it will use the slowest supported spedd
|
||||
(ie. 10 Mbps on a 10/100/1000 interface)
|
||||
- **Duplex**: if the speed is 10 or 100 Mbps, the switch will use half duplex.
|
||||
if the speed is 1000 Mbps or greater, use full duplex
|
||||
|
||||
## Interface Errors
|
||||
|
||||
you can see errors with the command
|
||||
|
||||
```cisco
|
||||
SW1#show interfaces f0/2
|
||||
```
|
||||
|
||||
### Traffic Stats
|
||||
|
||||
```cisco
|
||||
5 minute input rate 1000 bits/sec, 10 packets/sec
|
||||
5 minute output rate 2000 bits/sec, 20 packets/sec
|
||||
1000 packets input, 800000 bytes
|
||||
1200 packets output, 900000 byte
|
||||
```
|
||||
|
||||
input rate → traffic coming into the switch port
|
||||
output rate → traffic leaving the port
|
||||
packets / bytes → total traffic count
|
||||
|
||||
### The Error Counters
|
||||
```cisco
|
||||
10 input errors, 2 CRC, 3 frame, 0 overrun, 0 ignored , 0 runts, 0 giants
|
||||
5 output errors, 2 collisions, 1 late collision
|
||||
```
|
||||
|
||||
#### Input Errors (incoming traffic issues)
|
||||
- Total count of all incoming errors
|
||||
- CRC (Cyclic Redundancy Check) in the Ethernet [[FCS trailer]]
|
||||
- frame errors
|
||||
- overrun
|
||||
- Runts: Frames that are smaller than the minimum frame size (64 bytes)
|
||||
- Giants: Frames that are larger than the maxium frame size (1518 bytes)
|
||||
- ignored
|
||||
|
||||
#### Output Errors (outgoing traffic issues)
|
||||
- Total outgoing packet errors
|
||||
- collisions / Occur in half-duplex mode only
|
||||
late collisions / Collisions detected after first 64 bytes
|
||||
|
||||
If you remember only one thing for the CCNA, remember this:
|
||||
👉 **Duplex mismatch = CRC errors + late collisions**
|
||||
It’s one of the most common exam and real-world issues.
|
||||
|
||||
**The errors can be the same with a router**
|
||||
|
||||
## Review
|
||||
|
||||
- Interface speed and duplex
|
||||
- speed and duplex autonegotiation
|
||||
- Interface status
|
||||
- Interface counters & error
|
||||
|
||||
Reference in New Issue
Block a user