计算机网络基础实验及子网划分方法与例题

  • 格式:docx
  • 大小:246.84 KB
  • 文档页数:10

下载文档原格式

  / 10
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

计算机网络复习资料

实验一

配置终端,熟悉交换机各种工作模式之间的切换

模式 命令

提示符

用户模式 Switch> 特权模式 Enable Switch#

全局配置模式 Config terminal Switch (config )# 端口配置模式 Interface fastethernet 端口号 Switch (config -if )#

控制设置模式 Line control 控制口 Switch (config -line )# 线路设置模式 Line vty 线路口 Switch (config -line )# VLAN 设置模式 Vlan database

Switch (vlan )#

Telnet 方式远程登陆配置

配置命令

使用配置线连接电脑与交换机的C 口后,在电脑上开启终端进行配置

第一步:配置全局、终端和 线程模式的密码 Switch>enable ---->进入特权模式 Switch# config terminal ---->进入全局配置模式

Switch(config) enable password test ---->配置进入特权模式的密码为test Switch(config) line console 0 ---->进入Consloe 口配置模式(Consloe 口即物理口) Switch(config -line) password test1 ---->配置进入Consloe 口密码为test1 Switch(config -line) login ---->启用

Switch(config -line) exit

Switch(config) line vty 0 4 ---->进入telnet 密码配置模式,0 4表示允许共5

个用户同时telnet 登入到交换机

Switch(config -line) password test2 ---->将telnet 密码设置为test2 Switch(config -line) login ---->启用需输入密码才能telnet 成功

Switch(config -line) exit

第二步:对交换机进行IP 和网关设置

Switch(config)interface vlan1

Switch(config -if)ip address 192.168.1.1 255.255.255.0 Switch(config -if)no shutdown Switch(config -if)exit

Switch(config)ip default -gateway 192.168.1.1

Switch Pc 1

192.168.1.2 Pc 2 192.168.1.3

跨交换机VLAN 的配置与实现

交换机端口属性:

Access 端口:终端主机收发端口

Trunk 端口:交换机之间的连接端口,也称为干道口,用交叉线连接 配置命令

PC1、PC2、PC3、PC4全通 交换机1:

S1> enable S1# conf t

S1(conf -if)> exit

S1(config)> interface f 0/24

S1(conf -if)> switchport mode trunk ---->设置端口24为trunk 端口 S1(config)> vlan 10 ---->添加vlan 10 S1(config)> vlan 20 ---->添加vlan 20 S1(config)> interface f 0/1

S1(conf -if)> switchport access vlan 10 ---->为端口1分配vlan 10

S1(conf -if)> exit

S1(config)> interface f 0/2

S1(conf -if)> switchport access vlan 20 ---->为端口2分配vlan 20

S1(conf -if)> exit

交换机2:配置同上

结果:

PC1、PC3互通PC2、PC4互通

其他命令

show vlan 显示交换机vlan 信息 no vlan 删除对应的vlan Reload 重启交换机

Switch1

Switch2

Pc 1 192.168.1.1 Pc 2 192.168.1.2 Pc 3 192.168.1.3 Pc 4 192.168.1.4

三层交换机静态路由配置

配置命令

未配置路由情况下,PC1不能ping 通PC2

期望在S3560上启用静态路由,PC1到192.168.1.0走10.0.0.1,到192.168.2.0走10.0.0.2可以ping 通PC2 端口IP 配置 交换机1:

Switch1(config)# interface f 0/1 Switch1(config -if)# no switchport

Switch1(config -if)# ip address 192.168.1.1 255.255.255.0 Switch1(config -if)# exit

Switch1(config)# interface f 0/24 Switch1(config -if)# no switchport

Switch1(config -if)# ip address 10.0.0.1 255.255.255.0 Switch1(config -if)# exit

交换机2:

Switch2(config)# interface f 0/1 Switch2(config -if)# no switchport

Switch2(config -if)# ip address 192.168.2.1 255.255.255.0 Switch2(config -if)# exit

Switch2(config)# interface f 0/24 Switch2(config -if)# no switchport

Switch2(config -if)# ip address 10.0.0.2 255.255.255.0 Switch2(config -if)# exit

启用三层交换机上的路由模块 交换机1:

Switch1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2

交换机2:

Switch2(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1

注:建议在以太网链路,配置静态路由的时候,配置为下一跳的ip 地址,若是在网络出口配置默认路由,切勿配置为本地出接口。

Switch1 F 0/24 10.0.0.1

Switch2 F 0/24 10.0.0.2

Pc 1 192.168.1.2 192.168.1.1

Pc 2 192.168.2.2 192.168.2.1

F 0/1 192.168.1.1 F 0/1 192.168.2.1