科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网网络频道思科2950交换机VLAN划分

思科2950交换机VLAN划分

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

思科2950交换机VLAN划分。

作者:中国IT实验室 来源:中国IT实验室 2009年5月21日

关键字: 交换机 VLAN 思科

  • 评论
  • 分享微博
  • 分享邮件
    首先配置一下交换机
SC-2950>
SC-2950>en
SC-2950#conf t
Enter configuration commands, one per line.    End with CNTL/Z.
SC-2950(config)#config-register 0x2102
SC-2950(config)#end

    添加三个VLAN
 SC-2950#vlan data
SC-2950(vlan)#vlan 10 name v1
VLAN 10 added:
        Name: v1
SC-2950(vlan)#vlan 20 name v2
VLAN 20 added:
        Name: v2
SC-2950(vlan)#vlan 30 name v3
VLAN 30 added:
        Name: v3
SC-2950(vlan)#exit
APPLY completed.
Exiting....
SC-2950#

    划分接口到各个VLAN
   
 SC-2950#conf t
Enter configuration commands, one per line.    End with CNTL/Z.
SC-2950(config)#int fa0/1             //留给管理员
SC-2950(config-if)#switchport mode access
SC-2950(config-if)#sw acc vlan 10
SC-2950(config-if)#no shutdown
SC-2950(config-if)#exit

SC-2950(config)#int range f0/2 - 15
SC-2950(config-if-range)#sw mode acc
SC-2950(config-if-range)#sw acc vlan 20
SC-2950(config-if-range)#no sh
SC-2950(config-if-range)#exit
SC-2950(config)#int range f0/16 - 24
SC-2950(config-if-range)#sw mode acc
SC-2950(config-if-range)#sw acc vlan 30
SC-2950(config-if-range)#no sh
SC-2950(config-if-range)#exit

    激活VLAN,并且给VLAN 10加个IP以便管理
 
 SC-2950(config)#int vlan 10
SC-2950(config-if)#ip add 192.168.1.1 255.255.255.0
SC-2950(config-if)#no sh
SC-2950(config-if)#exit
SC-2950(config)#int vlan 20
SC-2950(config-if)#no sh
SC-2950(config-if)#exit
SC-2950(config)#int vlan 30
SC-2950(config-if)#no sh
SC-2950(config-if)#exit

    将交换机指向网关
 SC-2950(config)#ip default-gateway 192.168.1.254
SC-2950(config)#end
SC-2950#

    检测配置
 SC-2950#sh vlan brief

VLAN Name                                                         Status        Ports
---- -------------------------------- --------- -------------------------------
1        default                                                    active
10     v1                                                             active        Fa0/1
20     v2                                                             active        Fa0/2, Fa0/3, Fa0/4,Fa0/5
                                                                                                Fa0/6, Fa0/7, Fa0/8,Fa0/9
                                                                                                Fa0/10, Fa0/11, Fa0/12,Fa0/13
                                                                                                Fa0/14, Fa0/15
30     v3                                                             active        Fa0/16, Fa0/17, Fa0/18, Fa0/19
                                                                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23
                                                                                                Fa0/24
SC-2950#sh ip int b
Interface                                    IP-Address            OK? Method Status                                Prot
ocol
FastEthernet0/23                     unassigned            YES unset    up                                        down

FastEthernet0/24                     unassigned            YES unset    up                                        down

Vlan1                                            unassigned            YES unset    up                                        down

Vlan10                                         192.168.1.1         YES manual up                                        up

Vlan20                                         unassigned            YES unset    up                                        up

Vlan30                                         unassigned            YES unset    up                                        down
SC-2950#sh run
Building configuration...

Current configuration : 1482 bytes

...

!
interface FastEthernet0/24
switchport access vlan 30
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 192.168.1.1 255.255.255.0
!
interface Vlan20
no ip address
!
interface Vlan30
no ip address
!
ip default-gateway 192.168.1.254
ip http server
!
...

    保存配置
 SC-2950#write
Building configuration...
[OK]
    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章