VLAN基本配置

来源:互联网 发布:数据库与服务器 编辑:程序博客网 时间:2024/05/20 08:22

VLAN基本配置

单臂路由实现法

一、实验目的

通过本实验,可以掌握以下技能:

VLAN间路由

二、设备需求

Cisco路由器1台, 交换机1台2台PC机,以及Console电缆及转接器

三、拓扑结构及接口IP配置

通过本实验,可以掌握以下技能:

对2950交换机进行基本的VLAN设置。Cisco Catalyst 2950系列交换机1台,型号不限。Cisco 路由器1台,型号不限。PC机2台,操作系统为Windows系列,装有超级终端程序。Console电缆一条及相关的接口转换器。

这里写图片描述

PC0:ip地址:192.168.1.2 默认网关:192.168.1.1

PC1:ip地址:192.168.2.2 默认网关:192.168.2.1

路由器:f0/0:172.168.1.1 f1/0:192.168.2.1

Vlan 14:f0/0.10
Vlan 15:f0/0.30

四、实验配置文档

### (1)PC配置

1:PC0 ip地址:192.168.1.2 默认网关:192.168.1.1
这里写图片描述

2:PC1 ip地址:192.168.2.2 默认网关:192.168.2.1
这里写图片描述

(2)交换机Switch配置:

1)Switch配置清单

Switch>enableSwitch#vlan dataSwitch(vlan)#vlan 14Switch(vlan)#vlan 15Switch(vlan)#exit

2)将端口加入到相应的VLAN

Switch#config tEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport acc vlan 14Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport acc vlan 15Switch(config-if)#endSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#

3)为Fa0/1端口配置干道

Switch>enableSwitch#config tEnter configuration commands, one per line.  End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunkSwitch(config-if)#endSwitch#%SYS-5-CONFIG_I: Configured from console by consoleSwitch#

(3)路由器配置

1)aochengkaoR基本配置

(f0/0:172.168.1.1 f0/1:192.168.2.1)

aochengkaoR>enable aochengkaoR#configure terminal Enter configuration commands, one per line.  End with CNTL/Z. aochengkaoR(config)#interface FastEthernet0/0 aochengkaoR(config-if)#ip add 172.168.1.1 255.255.255.0aochengkaoR(config-if)#no shaochengkaoR(config-if)#exitaochengkaoR(config)#int f0/1 aochengkaoR(config-if)#ip add 192.168.2.1 255.255.255.0aochengkaoR(config-if)#no shaochengkaoR(config)#exit  aochengkaoR#%SYS-5-CONFIG_I: Configured from console by console

2)启用子接口,封装VLAN

Vlan 14:f0/0.10 Vlan 15:f0/0.30

aochengkaoR>enaaochengkaoR#config tEnter configuration commands, one per line.  End with CNTL/Z.aochengkaoR(config)#int f0/0.10aochengkaoR(config-subif)#encapsulation dot1Q 14aochengkaoR(config-subif)#ip add 192.168.1.1 255.255.255.0aochengkaoR(config-subif)#exitaochengkaoR(config)#int f0/0.30aochengkaoR(config-subif)#encapsulation dot1Q 15aochengkaoR(config-subif)#ip add 192.168.2.1 255.255.255.0aochengkaoR(config-subif)#int f0/0aochengkaoR(config-if)#no shutaochengkaoR(config-if)

五、验证实验结果

1 : show ip route

aochengkaoR>enableaochengkaoR#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area       * - candidate default, U - per-user static route, o - ODR       P - periodic downloaded static routeGateway of lasesort is not set ```    C      172.168.1.0 is directly connected, FastEthernet0/0  C    192.168.1.0/24 is directly connected, FastEthernet0/0.10 C    192.168.2.0/24 is directly connected, FastEthernet0/0.30

2:show running-config

interface FastEthernet0/0 ip address 172.168.1.1 255.255.255.0 duplex half speed 100!interface FastEthernet0/0.10 encapsulation dot1Q 14 ip address 192.168.1.1 255.255.255.0!interface FastEthernet0/0.30 encapsulation dot1Q 15 ip address 192.168.2.1 255.255.255.0!interface FastEthernet0/1 no ip address duplex autoaochengkaoR#

3:PC之间以及与路由ping,看能否ping通。

PC0 ping aochengkaoR((172.168.1.1))
这里写图片描述
PC1pingPC0(192.168.2.2)
这里写图片描述

六:配置文件10.pkt下载

点击10.pkt

七:实验总结

通过这次实验,我巩固了前面所学的知识,在实验操作的过程中配置单臂路由,单臂路由是通过单个物理接口在网络中的多个 VLAN 之间发送流量的路由器配置,这让我对理论知识的学习很有帮助。

原创粉丝点击