您的位置:首页 > 其它

VLAN基本配置

2017-06-08 19:01 453 查看

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>enable

Switch#vlan data

Switch(vlan)#vlan 14

Switch(vlan)#vlan 15

Switch(vlan)#exit


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

Switch#config t

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

Switch(config)#int f0/2

Switch(config-if)#switchport acc vlan 14

Switch(config-if)#exit

Switch(config)#int f0/3

Switch(config-if)#switchport acc vlan 15

Switch(config-if)#end

Switch#

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

Switch#


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

Switch>enable

Switch#config t

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

Switch(config)#int f0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#end

Switch#

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

Switch#


(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.0

aochengkaoR(config-if)#no sh

aochengkaoR(config-if)#exit

aochengkaoR(config)#int f0/1
aochengkaoR(config-if)#ip add 192.168.2.1 255.255.255.0

aochengkaoR(config-if)#no sh

aochengkaoR(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 t

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

aochengkaoR(config)#int f0/0.10

aochengkaoR(config-subif)#encapsulation dot1Q 14

aochengkaoR(config-subif)#ip add 192.168.1.1 255.255.255.0

aochengkaoR(config-subif)#exit

aochengkaoR(config)#int f0/0.30

aochengkaoR(config-subif)#encapsulation dot1Q 15

aochengkaoR(config-subif)#ip add 192.168.2.1 255.255.255.0

aochengkaoR(config-subif)#int f0/0

aochengkaoR(config-if)#no shut

aochengkaoR(config-if)


五、验证实验结果

1 : show ip route

aochengkaoR>enable

aochengkaoR#show ip route

Codes: 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 route

Gateway 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 auto

aochengkaoR#


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

PC0 ping aochengkaoR((172.168.1.1))



PC1pingPC0(192.168.2.2)



六:配置文件10.pkt下载

点击10.pkt

七:实验总结

通过这次实验,我巩固了前面所学的知识,在实验操作的过程中配置单臂路由,单臂路由是通过单个物理接口在网络中的多个 VLAN 之间发送流量的路由器配置,这让我对理论知识的学习很有帮助。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息