第18节 三层交换机网络配置——基于PacketTracer仿真实验

三层交换机网络配置——基于PacketTracer仿真实验

1实验要求

  1. 如下拓补图构建网络连接;
  2. 要求PC1能ping通全网。
    在这里插入图片描述

2实验

2.1实验思路

实验整体可以以核心交换机为界,划分为二层交换部分与三层路由部分。

  • 二层交换部分:
    • 第1步:配置trunk接口模式
    • 第2步:配置VTP域及创建VLAN类型
    • 第3步:划分接口至对应VLAN
  • 三层路由部分:
    • 第1步:核心交换机创建虚拟接口配置IP
    • 第2步:核心交换机升级接口为三级接口并配置IP
    • 第3步:路由器接口配置IP
    • 第4步:配置路由表
  • PC端配置IP。

2.2实验命令

'''二层交换部分配置'''
'''第1步:配置trunk接口模式'''
# SW1配置trunk接口模式
en
conf t
ho SW1
int f0/3
sw m t
exit
# SW2配置trunk接口模式
en
conf t
ho SW2
int f0/4
sw m t
exit
# SW配置trunk接口模式
en
conf t
ho SW
int range f0/3 - 4
sw m t
exit

'''第2步:配置VTP域及创建VLAN类型'''
# SW配置VTP域及创建VLAN类型
en
conf t
vtp domain qq
vlan 10
exit
vlan 20
exit

'''第3步:划分接口至对应VLAN'''
# 为SW1划分接口至相应VLAN
en
conf t
int f0/1
sw ac vlan 10
int f0/2
sw ac vlan 20
# 为SW2划分接口至相应VLAN
en
conf t
int f0/1
sw ac vlan 10
int f0/2
sw ac vlan 20

'''三层路由部分'''
'''第1步:核心交换机创建虚拟接口配置IP'''
en
conf t
ip routing
int vlan 10
no shut
ip add 10.1.1.254 255.255.255.0
exit
int vlan 20
no shut
ip add 20.1.1.254 255.255.255.0
exit

'''第2步:核心交换机升级接口为三级接口并配置IP'''
en
conf t
int f0/1
no switchport
no shut
ip add 30.1.1.1 255.255.255.0
exit

'''第3步:路由器接口配置IP'''
# 为R1接口配置IP
en
conf t
ho R1
int f0/0
no shut
ip add 30.1.1.2 255.255.255.0
exit
int f0/1
no shut
ip add 40.1.1.1 255.255.255.0
exit
# 为R2接口配置IP
en
conf t
ho R2
int f0/0
no shut
ip add 40.1.1.2 255.255.255.0
exit
int f0/1
no shut
ip add 50.1.1.254 255.255.255.0
exit

'''第4步:配置路由表'''
# 为SW路由表
en
conf t
ip route 0.0.0.0 0.0.0.0 30.1.1.2
# 为R1路由表
en
conf t
ip route 10.1.1.0 255.255.255.0 30.1.1.1
ip route 20.1.1.0 255.255.255.0 30.1.1.1
ip route 0.0.0.0 0.0.0.0 40.1.1.2	
# 为R2路由表
en
conf t
ip route 0.0.0.0 0.0.0.0 40.1.1.1

2.3实验结果

  1. PC1能ping通全网。
  2. PC1pingPC3时,属于同一VLAN,TTL=128.
  3. PC1pingPC2和PC4时,不属于同一VLAN,TTL=127.
  4. PC1pingPC5时,属于外网,TTL=125.

3总结

  1. 掌握配置的思路层次;
  2. 掌握配置的命令。
  • 3
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值