读文网>电脑>网络知识>路由器>路由器设置>cisco思科

cisco vlan 设置

虚拟局域网(VLAN)是一组逻辑上的设备和用户,这些设备和用户并不受物理位置的限制,可以根据功能、部门及应用等因素将它们组织起来,相互之间的通信就好像它们在同一个网段中一样。那么在cisco中如何配置vlan呢?读文网小编整理了相关资料,供大家参考。

Cisco IOS中有两种方式创建vlan,在全局模式下使用vlan vlanid命令,如switch(config)vlan10; 在vlan database 下创建vlan ,如 switch(vlan)vlan20;

交换机配置:

复制代码

代码如下:

Switch>enable

Switcconfigureterminal

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

Switch(config)vlan10

Switch(config-vlan)nameMath

Switch(config-vlan)#exit

Switch(config)#exit

Switch#

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

Switchvlandatabase

% 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)vlan20 name Chinese

VLAN 20 added:

Name: Chinese

Switch(vlan)vlan30 name Other

VLAN 30 added:

Name: Other

Switch(vlan)#exit

APPLY completed.

Exiting....

Switcconfigureterminal

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

Switch(configinterfacefastEthernet 0/1

Switch(config-ifswitchportmode access

Switch(config-ifswitchportaccess vlan 10

Switch(config-if)#exit

Switch(configinterfacefastEthernet 0/2

Switch(config-ifswitchportmode access

Switch(config-ifswitchportaccess vlan 10

Switch(config-if)#exit

Switch(configinterfacerange fastEthernet 0/3-6

Switch(config-if-rangeswitchportmode access

Switch(config-if-rangeswitchportaccess vlan 20

Switch(config-if-range)#exit

Switch(configinterfacerange fastEthernet 0/7-9

Switch(config-if-rangeswitchportmode access

Switch(config-if-rangeswitchportaccess vlan 30

Switch(config-if-range)#exit

Switch(config)#exit

Switch#

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

Switchshowvlan

VLAN Name StatusPorts

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

1defaultactiveFa0/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 Math activeFa0/1, Fa0/2

20 ChineseactiveFa0/3, Fa0/4, Fa0/5, Fa0/6

30 OtheractiveFa0/7, Fa0/8, Fa0/9

1002 fddi-default act/unsup

1003 token-ring-default act/unsup

1004 fddinet-defaultact/unsup

1005 trnet-defaultact/unsup

VLAN TypeSAID MTU Parent RingNo BridgeNo StpBrdgMode Trans1 Trans2

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

1enet100001 1500-----00

10 enet100010 1500-----00

20 enet100020 1500-----00

30 enet100030 1500-----00

1002 fddi101002 1500-----00

1003 tr101003 1500-----00

1004 fdnet 101004 1500---ieee -00

1005 trnet 101005 1500---ibm-00

RemoteSPAN VLANs

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

Primary Secondary TypePorts

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

Switch#

//为VLAN配置ip地址(就是默认网关)

Switch(configinterfacevlan 10

Switch(config-if)#

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

Switch(config-ifipaddress 192.168.1.1 255.255.255.0

Switch(config-ifnoshutdown

Switch(config-if)#exit

Switch(configinterfacevlan 20

Switch(config-if)#

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

Switch(config-ifipaddress 192.168.2.1 255.255.255.0

Switch(config-ifnoshutdown

Switch(config-if)#exit

Switch(configinterfacevlan 30

Switch(config-if)#

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

Switch(config-ifipaddress 192.168.3.1 255.255.255.0

Switch(config-ifnoshutdown

Switch(config-if)#exit

PC设置

互ping截图:

以上就是小编为大家带来的cisco vlan 设置方法介绍,都是些简单的配置,适合新手学习,希望可以帮到大家哦!

相关热搜

相关文章

【cisco思科】热点

【cisco思科】最新