Video link: https://www.bilibili.com/video/BV1Lf4y1t7Mc?p=8-13
IP address details
ip address is a unique identifier, which is a network code
LAN
LAN: generally called intranet
LAN composition: switch, network cable, PC
Switch: a device used to form a local area network of an intranet
IP address
32-bit binary
Hexadecimal: x.x.x.x ------ the range of X is 0-255
Subnet mask
LAN communication rules: in the same LAN, you must be in the same network segment to communicate with each other!
Composition of IP address: network bit + host bit (IP address with the same network bit is the same network segment)
How the subnet mask determines the network bit: the number corresponding to 255 is the network bit, and the number corresponding to 0 is the host bit
IP address details
ISO defines address classification: five categories (distinguished by the first bit of IP address)
Class A: 1-126 bits default subnet mask: 255.0.0.0
Class B: 128-191 bits default subnet mask: 255.255.0.0
Class C: 192-223 bits default subnet mask: 255.255.255.0
Class D: 224-239 multicast address
Class E: 240-254 for scientific research
Note: we can use it at present A.B.C Class subnet mask can be modified 127.0.0.1 Represents the local loopback address
The addresses of each network segment are divided into three categories:
1. Name of the network segment: all host bits are 0
2. Broadcast address of the network segment: all host bits are 1
3. Available addresses: (all host bits are 0 --- all host bits are 1), open the set, excluding both ends
Example: Q: 10.1.1.1/24 Which network segment does it belong to? How many network segments are available IP Address? What is the broadcast address of this network segment? Answer: according to the question, the network bit is 24 bits, and the last 8 bits are the host bit 10.1.1.1 Belong to 10.1.1.0 Network segment 10.1.1.0 Network segment available IP The address range is: 10.1.1.1-10.1.1.254 10.1.1.0 Broadcast address of network segment: 10.1.1.255
gateway
Gateway: the exit of a network. Generally, the gateway is on the router
Router: a device that can be used to connect internal and external networks
pc Outsourcing: 1.First judge the target IP Are you in the same network segment as yourself 2.If it is in the same network segment, it will be sent directly without finding a gateway 3.If it is not in a network segment, it will be contracted to the gateway
DNS Domain Name Service
1.local DNS cache 2.local hosts file 3.look for DNS service
Binary conversion (omitted)
Network test command
First: start - run - enter cmd - enter the command line window / win+r to open the run window
How to view IP addresses
ipconfig # view basic IP address information
ipconfig /all # view IP address details
Test network connectivity
ping the target IP address # to test the network connectivity. Successful communication can be achieved if there is going and going back!
ping - tdestination IP address # has been ping
ping -n digital destination IP address # modifies the number of ping packets
Note: if ping No, maybe the other party is not online, or the other party has a firewall on!
Resolve domain name manually
nslookup www.baidu.com # manually resolve the IP address of the domain name
DOS command
Clear command window
cls #Clear screen
Commands related to directory folders
c:/d:/E: # switch drive letter
dir # browse the file contents of the current folder
dir route //Browse the contents of the file at the specified path location dir /a //Browse everything in the current location, including hidden files
cd # switch position
cd Folder name //Enter the folder tab key to complete the path function cd .. //Go back to the previous directory cd \ //Go back directly to the root directory
md # create folder
md Folder name //Create folder name md a,b,c //Create multiple folders at the same time md d\e\f //Create multi tier folders at the same time
rd # delete folder
rd Folder name //Delete empty folder rd Folder name /s //Delete the non empty folder rd Folder name /s /q //Silent deletion of non empty folders rd . /s /q //Delete all files in the current directory
File related commands
create a file
Create file method 1: echo echo character string >>[route\]file name.Extension notes:>>and>You can input the output of the command into a file. If the file does not exist, the file will be created at the same time >>For append //Add text at the end of the original document >For overlay //Empty the contents of the original file and add text to the file again. Case: modification hosts file echo 1.1.1.1 www.baidu.com >>D:\b\www222.txt Create file method 2: copy copy con file name.Extension Start writing content ctrl + z Press enter to finish writing
type browse the contents of the file
type file name.Extension //Browse the contents of a file type file name.Extension |more //Pagination display
del delete file
del file name.Extension //Delete file del *.txt //Delete all files ending in txt del *.* //Delete all files del *.* /s /q //Delete all files without prompting notes:*Is a wildcard, representing any character and any length
Move / copy / rename files
Copy file: copy [route\]Source file full name destination path[\Full name of new file] Move files: move [route\]Source file full name destination path[\Full name of new file] Rename file: ren [route\]Source file full name destination path[\Full name of new file]
Shutdown and restart
shutdown -s -t second //Timed shutdown shutdown -s -f -t second //Timed forced shutdown shutdown -r -t second //Timed restart, the same as above, plus - f, is forced restart shutdown -a //Cancel timing shutdown -l //Logoff is the same as logoff command.