实验

一:使用Wireshark抓TCP的三次握手和四次断开
163(www.163.com)ip地址为219.145.171.124
三次握手:
在这里插入图片描述

第一次:
在这里插入图片描述

第二次:
在这里插入图片描述

第三次:
在这里插入图片描述

四次断开:
在这里插入图片描述

第一次:
在这里插入图片描述

第二次:
在这里插入图片描述

第三次:
在这里插入图片描述
在这里插入图片描述

二:使用Wireshark抓DHCP四次握手
在这里插入图片描述

第一次:
在这里插入图片描述

第二次:
在这里插入图片描述

第三次:
在这里插入图片描述

第四次:
在这里插入图片描述

三:使用Wireshark抓ARP请求和响应
在这里插入图片描述

ARP请求:
在这里插入图片描述

ARP响应:
在这里插入图片描述

四:实验
在这里插入图片描述

第一步:配置路由器R1接口,DHCP信息。
Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>
Router>en
Router#
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#hostname R1
R1(config)#
R1(config)#int f0/0
R1(config-if)#
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#no shutdown

R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

R1(config-if)#
R1(config-if)#ex
R1(config)#
R1(config)#int f0/1
R1(config-if)#
R1(config-if)#ip address 172.16.1.254 255.255.255.0
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

R1(config-if)#
R1(config-if)#ex
R1(config)#
R1(config)#ip dhcp pool 172.16.1.0
R1(dhcp-config)#network 172.16.1.0 255.255.255.0
R1(dhcp-config)#def
R1(dhcp-config)#default-router 172.16.1.254
R1(dhcp-config)#dns
R1(dhcp-config)#dns-server 8.8.8.8
R1(dhcp-config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#

第二步:配置路由器R2接口,DHCP信息。
Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#int f0/0
R2(config-if)#ip address 10.1.1.2 255.255.255.0
R2(config-if)#no shutdown

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
ex
R2(config)#int f0/1
R2(config-if)#ip address 20.1.1.1 255.255.255.0
R2(config-if)#no shutdown

R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

R2(config-if)#ex
R2(config)#int f1/0
R2(config-if)#ip address 172.16.2.254 255.255.255.0
R2(config-if)#no shutdown

R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

R2(config-if)#ex
R2(config)#
R2(config)#ip dhcp pool 172.16.2.0
R2(dhcp-config)#network 172.16.2.0 255.255.255.0
R2(dhcp-config)#de
R2(dhcp-config)#default-router 172.16.2.254
R2(dhcp-config)#dns
R2(dhcp-config)#dns-server 8.8.8.8
R2(dhcp-config)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#

第三步:配置路由器R3接口,网段汇总。
Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3
R3(config)#int f0/0
R3(config-if)#ip address 20.1.1.2 255.255.255.0
R3(config-if)#no shutdown

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)#ex
R3(config)#
R3(config)#
R3(config)#int f0/1
R3(config-if)#ip address 192.168.1.254 255.255.255.0
R3(config-if)#no shutdown

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)#ex
R3(config)#
R3(config)#int f1/0
R3(config-if)#ip address 192.168.2.254 255.255.255.0
R3(config-if)#no shutdown

R3(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up

R3(config-if)#end
R3#
%SYS-5-CONFIG_I: Configured from console by console

R3#

第四步:配置路由器R2静态路由。
R2>
R2>en
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#
R2(config)#ip route 172.16.1.0 255.255.255.0 10.1.1.1
R2(config)#ip route 192.168.0.0 255.255.252.0 20.1.1.2 (网段汇总)
R2(config)#ex
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#

第五步:配置路由器R1静态路由。
R1>
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 172.16.2.0 255.255.255.0 10.1.1.2
R1(config)#ip route 192.168.0.0 255.255.252.0 10.1.1.2 (网段汇总)
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#

第六步:配置路由器R3静态路由。
R3>
R3>en
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#ip route 172.16.2.0 255.255.255.0 20.1.1.1
R3(config)#ip route 172.16.1.0 255.255.255.0 20.1.1.1
R3(config)#end
R3#
%SYS-5-CONFIG_I: Configured from console by console

R3#

PC5 ping PC0(172.16.1.1),通。
在这里插入图片描述

PC5 ping PC2(172.16.2.1),通。
在这里插入图片描述

第七步:配置路由器R1、R2多路径负载均衡。
在这里插入图片描述

配置R1 f1/0口ip地址:
R1>
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f1/0
R1(config-if)#ip address 30.1.1.1 255.255.255.0
R1(config-if)#no shutdown

R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up

配置R2 f1/1口ip地址:
R2>
R2>en
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int f1/1
R2(config-if)#ip address 30.1.1.2 255.255.255.0
R2(config-if)#no shutdown

R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up

配置R1 f1/0口路由表:
R1>
R1>en
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 172.16.2.0 255.255.255.0 30.1.1.2
R1(config)#ip route 192.168.0.0 255.255.252.0 30.1.1.2
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

配置R2 f1/1口路由表:
R2>
R2>en
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 172.16.1.0 255.255.255.0 30.1.1.1
R2(config)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console

路由器R1路由表:
Gateway of last resort is not set

 10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0
30.0.0.0/24 is subnetted, 1 subnets
C 30.1.1.0 is directly connected, FastEthernet1/0
172.16.0.0/24 is subnetted, 2 subnets
C 172.16.1.0 is directly connected, FastEthernet0/1
S 172.16.2.0 [1/0] via 10.1.1.2
[1/0] via 30.1.1.2
S 192.168.0.0/22 [1/0] via 10.1.1.2
[1/0] via 30.1.1.2
R1#

路由器R2路由表:
Gateway of last resort is not set

 10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0
20.0.0.0/24 is subnetted, 1 subnets
C 20.1.1.0 is directly connected, FastEthernet0/1
30.0.0.0/24 is subnetted, 1 subnets
C 30.1.1.0 is directly connected, FastEthernet1/1
172.16.0.0/24 is subnetted, 2 subnets
S 172.16.1.0 [1/0] via 10.1.1.1
[1/0] via 30.1.1.1
C 172.16.2.0 is directly connected, FastEthernet1/0
S 192.168.0.0/22 [1/0] via 20.1.1.2
R2#

路由器R3路由表:
Gateway of last resort is not set

 20.0.0.0/24 is subnetted, 1 subnets

C 20.1.1.0 is directly connected, FastEthernet0/0
172.16.0.0/24 is subnetted, 2 subnets
S 172.16.1.0 [1/0] via 20.1.1.1
S 172.16.2.0 [1/0] via 20.1.1.1
C 192.168.1.0/24 is directly connected, FastEthernet0/1
C 192.168.2.0/24 is directly connected, FastEthernet1/0
R3#

断开路由器R2 f0/0口,PC5 ping PC0,通。
在这里插入图片描述

断开路由器R2 f0/0口,PC5 ping PC2,通。
在这里插入图片描述

第八步:配置路由器R1 f1/1接口。
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int f1/1
R1(config-if)#ip address 100.1.1.1 255.255.255.0
R1(config-if)#no shutdown

R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet1/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up

R1(config-if)#

第九步:配置缺省路由。
R1:

R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 0.0.0.0 0.0.0.0 100.1.1.100
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R2:
R2>
R2>en
R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1
R2(config)#ip route 0.0.0.0 0.0.0.0 30.1.1.1
R2(config)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console

R3:
R3>
R3>en
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#ip route 0.0.0.0 0.0.0.0 20.1.1.1
R3(config)#end
R3#
%SYS-5-CONFIG_I: Configured from console by console

第10步:空接口路由
PC5 Tracert 192.168.0.1会一直转发,出现环路。
在这里插入图片描述

R3>en
R3#
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#ip route 192.168.0.0 255.255.252.0 null 0
R3(config)#end
R3#
%SYS-5-CONFIG_I: Configured from console by console

R3#

PC5 ping 192.168.0.0 不会转发给缺省路由了。
在这里插入图片描述

实验完成。
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值