实验拓扑
需求1
PC1 ping PC3 可达
配置1
R1 :
ip route 10.3.3.0 255.255.255.0 fa0/0
R2:
ip route 10.3.3.0 255.255.255.0 fa0/0
ip route 10.1.1.0 255.255.255.0 fa0/0
R3:
ip route 10.1.1.0 255.255.255.0 fa0/0
路由分析1
发包
PC1设置了网关,默认指向R1fa0/1
R1上有PC3 网段的路由
S 10.3.3.0 [1/0] via 12.12.12.2
R2上有PC3网段的路由
S 10.3.3.0 [1/0] via 23.23.23.2
R3上有PC3的直连路由:
回包C 10.3.3.0 is directly connected, FastEthernet0/1
PC3上有默认,默认指向了R3fa0/1接口
R3上有PC1网段路由
S 10.1.1.0 [1/0] via 23.23.23.1
R2上有PC1网段路由
S 10.1.1.0 [1/0] via 12.12.12.1
R1上有PC1网段路由
C 10.1.1.0 is directly connected, FastEthernet0/1
抓包分析1
路由器拿到发过来的包后,查看三层的ip信息进行转发,期间会修改二层信息
PC1-R1的抓包信息
sou mac
des mac
R1-R2抓包信息
sou mac
des mac
R2-R3抓包信息
sou mac
des mac
PC1->R3
发包
R1
S 23.23.23.0 is directly connected, FastEthernet0/0
R2
C 23.23.23.0 is directly connected, FastEthernet0/1
R3
C 23.23.23.0 is directly connected, FastEthernet0/0
回包
S 10.1.1.0 is directly connected, FastEthernet0/0
R2
S 10.1.1.0 is directly connected, FastEthernet0/0
R1
C 10.1.1.0 is directly connected, FastEthernet0/1