IP header, ICMP protocol, ARP cache table, routing table, static/default routing settings

1. The IP header is encapsulated at least 50 bytes
*
Version: Version number ipv4
*
Header length:
*
Priority and service type: Confirm priority
*
Total length: 65535 bytes of the entire ip packet length
*
Identifier: Identification function
*
Mark segment offset Migration: related to IP fragmentation
*
TTL: life cycle, every time a route passes through TTL-1, the packet is lost when it is 0 (to prevent routing loops and network storms)
*
Protocol Number: What is the upper layer protocol
*
Checksum: Detection Whether the data is damaged

2. ICMP: Internet control message protocol
*
ping uses the ICMP protocol, the firewall sometimes blocks the ICMP protocol
*
ICMP is a network layer protocol (controversial)

3. ARP
*
IP→MAC address protocol, Pc1 communicates with Pc2, ARP broadcasts to get the corresponding MAC address
*
ARP cache table: IP and MAC corresponding side on the host
*
Pc1 initializes ARP request → broadcast FFFFFFFFFFFF → pc2 cache table records pc1 IP and MAC Address correspondence → pc2 reply pc1 → pc1 cache table record

Correspondence between pc2IP address and MAC address → Unicast
*
ARP attack: PC in the same broadcast domain sends a false response to the host, the host updates the ARP cache table, and then the communication fails
*
ARP spoofing: Forward the traffic, and then control and view the traffic Private information
*
defense method: manually write the target IP and MAC address into the ARP cache table

4. Principle and configuration of static routing
Insert picture description here
Insert picture description here
Insert picture description here

* 路由器功能:路径选择(最佳路径而非最短路径)
* 

There are routing entries in the routing table for path selection (the corresponding relationship between network disconnection and interface/next hop routing is recorded in the routing table)
*
Two network cards in the router are in different network segments
*
①Direct connection: only need to configure the network card information and configure the IP can use

②Indirect connection: add manually

Insert picture description here
5. Features of static routing

Insert picture description here

* 手动配置,单向
* 

Lack of flexibility
*
can avoid routing loops

6. Dynamic/default routing
* When the
router routing table cannot find a network routing entry, the router forwards the request to the default routing interface (stub network)
*
When the destination address is a huge collection of addresses, the default route can be set, and then the next one Routing processing.
*The
default route can only be set on the router connected to the PC

7. The distinction between three types of tables
*
ARP cache table IP address ⇆ MAC address terminal device
*
MAC address table MAC address ⇆ interface switch
*
routing table target network disconnect ⇆ interface / next hop router / PC

8. Static routing and default routing configuration

Insert picture description here
9. Static/default routing configuration case

Insert picture description here
R1, R3 (stub network) use the default route, R2 uses the static route to
configure static, configure the IP/gateway and MAC address of the host and routing network card before the default.

  1. R1

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#int f0/0
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#int f0/1
R1(config-if)#ip add 10.0.0.1 255.0.0.0
R1(config-if)#no sh
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.254
R1(config)#

2.R2
Router>en
Router#host R2
^
% Invalid input detected at ‘^’ marker.

Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#int f0/0
R2(config-if)#ip add 10.0.0.254 255.0.0.0
R2(config-if)#no sh
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#int f0/1
R2(config-if)#ip add 20.0.0.1 255.0.0.0
R2(config-if)#no sh
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
R2(config-if)#exit
R2(config)#ip route 192.168.10.0 255.255.255.0 10.0.0.1
R2(config)#ip route 192.168.20.0 255.255.255.0 20.0.0.254
R2(config)#

3.R3

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R3
R3(config)#int f0/0
R3(config-if)#ip add 20.0.0.254 255.0.0.0
R3(config-if)#no sh
R3(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#int f0/1
R3(config-if)#ip add 192.168.20.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R3(config-if)#ip route 0.0.0.0 0.0.0.0 20.0.0.1
R3(config)#

Guess you like

Origin blog.csdn.net/qq_39109226/article/details/109093277
Recommended