119 lines
2.8 KiB
Markdown
119 lines
2.8 KiB
Markdown
---
|
|
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
|