当前位置: 首页 > news >正文

计算机网络针对交换机的配置

实验

目的

交换机的基本配置,交换机VLAN配置

实验条件

Windows,Cisco packet tracer

实验

内容

交换机的基本配置,交换机VLAN配置

实验

过程

 一、交换机的基本配置

进入特权模式

Switch>enable

进入配置模式

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

返回上一级

  Switch(config)#exit

Switch#

%SYS-5-CONFIG_I: Configured from console by console

使用end

  Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#end

Switch#

%SYS-5-CONFIG_I: Configured from console by console

配置交换机的主机名字

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#hostname WJJ

WJJ(config)#

配置交换机的线路密码

WJJ(config)#line console 0

WJJ(config-line)#password 123456

WJJ(config-line)#login

验证密码:

WJJ(config-line)#end

WJJ#

%SYS-5-CONFIG_I: Configured from console by console

WJJ#

WJJ#logout

WL con0 is now available

Press RETURN to get started.

User Access Verification

Password: 123456

配置特权模式密码:

WJJ>enable

WJJ#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

WJJ(config)#enable password enpass

验证特权模式密码:

WJJ(config)#end

WJJ#

%SYS-5-CONFIG_I: Configured from console by console

WJJ#disable

WJJ>enable

Password:

WJJ#

配置交换机的IP地址

WJJ#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

WJJ(config)#interface vlan 1

WJJ(config-if)#ip address 192.168.1.1 255.255.255.0

Wjj(config-if)#no shutdown

Wjj(config-if)#

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

配置网关

Wjj(config-if)#exit

Wjj(config)#ip default-gateway 192.168.1.254

配置主机的ip地址192.168.1.2

配置子网掩码:255.255.255.0

Ping测试主机与交换机的连接

实验

过程

  • 交换机VLAN配置

拓扑结构

配置主机的IP地址

配置交换机的VLAN

Switch>en

Switch#vlan database

% Warning: It is recommended to configure VLAN from config mode,

as VLAN database mode is being deprecated. Please consult user

documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan 10

VLAN 10 added:

Name: VLAN0010

Switch(vlan)#vlan 20

VLAN 20 added:

Name: VLAN0020

Switch(vlan)#vlan 30

VLAN 30 added:

Name: VLAN0030

Switch(vlan)#vlan 40

VLAN 10 added:

Name: VLAN0040

Switch(vlan)#exit

APPLY completed.

Exiting....

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#int f0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 10

Switch(config-if)#int f0/4

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 10

Switch(config-if)#int range f0/2-3

Switch(config-if-range)#switchport mode access

Switch(config-if-range)#switchport access vlan 20

Switch(config-if-range)#exit

Switch(config)#

Switch(config)#end

Switch#

%SYS-5-CONFIG_I: Configured from console by console

Switch#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8

Fa0/9, Fa0/10, Fa0/11, Fa0/12

Fa0/13, Fa0/14, Fa0/15, Fa0/16

Fa0/17, Fa0/18, Fa0/19, Fa0/20

Fa0/21, Fa0/22, Fa0/23, Fa0/24

10 VLAN0010 active Fa0/1, Fa0/2

20 VLAN0020 active Fa0/3, Fa0/4

1002 fddi-default act/unsup

1003 token-ring-default act/unsup

1004 fddinet-default act/unsup

1005 trnet-default act/unsup

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2

---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 0 0

10 enet 100010 1500 - - - - - 0 0

20 enet 100020 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 0 0

1003 tr 101003 1500 - - - - - 0 0

--More--

Ping测试主机与交换机的连接

实验

总结

不相邻的两台主机range连接不上需要注意

http://www.lryc.cn/news/335016.html

相关文章:

  • Python爬虫之分布式爬虫
  • 服务器硬件基础知识解析
  • 【芯片设计- RTL 数字逻辑设计入门 1.1 -- Verdi 使用入门介绍 1】
  • ssm034学生请假系统+jsp
  • Leetcode 165. 比较版本号
  • LeetCode-279. 完全平方数【广度优先搜索 数学 动态规划】
  • rust项目组织结构和集成测试举例
  • 软件文档交付清单(直接套用合集)
  • ModuleNotFoundError: No module named ‘ultralytics.utils‘
  • 2024智能计算、大数据应用与信息科学国际会议(ICBDAIS2024)
  • 秋招复习笔记——八股文部分:操作系统
  • 每日一题:C语言经典例题之杨辉三角
  • 1. TypeScript: JavaScript 的超集,为大型应用而生
  • vex-table—— 获取插入或修改数据后的tableData
  • 通俗易懂地解释Go语言不同版本中垃圾回收机制的演进过程
  • shamrockcms代码审计-啥也没有
  • 【C++】排序算法 --快速排序与归并排序
  • (Python)根据经纬度从数字高程模型(DEM)文件获取高度
  • 【WPF应用41】WPF中的Expander控件详解
  • golang变量初始化顺序
  • 魔众 文库配置异步转换
  • 创建型模式--2.简单工厂模式【人造恶魔果实工厂1】
  • 一些考研经验
  • StockTrading AI小模型股票自动交易系统 转载
  • 01背包问题合集 蓝桥OJ
  • Nuxt3 实战 (三):使用 release-it 自动管理版本号和生成 CHANGELOG
  • 鸿蒙OS开发实战:【自动化测试框架】使用指南
  • 算法(二分查找)
  • 运筹学基础(六)列生成算法(Column generation)
  • [阅读笔记] 电除尘器类细分市场2023年报