【学习安防监控工程 电工上岗操作技术  首选--深圳博世培训学校】

博世学校
联系我们

三层交换机典型配置(CISCO 3550)

发布于:2014-02-18 17:45来源:未知 作者:szbspx点击:
一个新的3550交换机配置流程,请按以下顺序配置:
 

  
一、    VLAN划分 
以特权模式身份(即看提示符为#:这样)通过串口的终端方式连接交换机,按照下列方式操作: 
1.进入配置状态,f和t之间有一空格 
#:conf t 
2.输入:vlan database 
3.输入VLAN号码和名称,如:vlan 10 name test 
假定你打算分5个VLAN,就需要输入5次上面的语句,输完后输入apply写入。 
#:vlan 10 name test1 
#:apply 
#:vlan 20 name test2 
#:apply 
#:vlan 30 name test3 
#:apply 
#:vlan 40 name test4 
#:apply 
#:vlan 50 name test5 
#:apply 
  
附:如果想删除某个VLAN,比如删除上面的vlan50,输入no vlan 50即可 
  
4.完成VLAN输入后,输入EXIT退出配置状态,在#状态下输入wr保存 
#:wr 
现在你可以用sh vlan命令,看一下你刚划分的VLAN。 
  
至此VLAN划分完了,下一步是把交换机上的端口指定给某个VLAN。 
  
二、    VLAN端口配置 
1.同样进入配置状态,f和t之间有一空格 
#:conf t 
2.进入某端口命令 
#:interface fastethernet 0/3           (进入交换要第3个端口,可简写为:int fast 0/10) 
#:switchport access vlan 10            (将此端口分配给vlan10) 
#:no shutdown          (激活此端口,可简写为:no shut) 
#:exit         (退出conf t模式) 
#:wr           (保存上面配置) 
3.如果你想将其它端口分配给某个VLAN,重复上在步骤 
  
OK,现在继续下一步给VLAN分配一个IP地址。 
  
三、    给VLAN分配IP地址 
每个VLAN的IP地址以后就是这个VLAN网段下面机器的网关地址。 
1.还是进入配置状态,f和t之间有一空格 
#:conf t 
2.进入VLAN接口 
#:int vlan10           (进入VLAN10,int是interface简写了) 
#:ip address 192.168.0.10 255.255.255.0                (addresss可简写为add,给vlan10分配的ip和掩码) 
#:no shut      (激活) 
#:exit 
#:wr 
如果有多个VLAN,重复上面步骤 
  
四、    路由配置 
#:ip classless 
#:ip route 0.0.0.0 0.0.0.0 192.168.0.1         (上层网关地址) 
  
五、生成树拓扑 
如果3550下在还接其它交换机,需要把3550设置根交换机,以便生成树拓扑。 
生成树拓扑命令: 
1.进入配置状态,f和t之间有一空格 
#:conf t 
#:spanning-tree vlan 10 root primary 
如果有多个vlan,每个VLAN都要输入此命令,把VLAN号改一下即可。 
  
五、    如果每个VLAN相互通信,需要输入: 
1.进入配置状态,f和t之间有一空格 
#:conf t 
#:ip routing 
#:exit 
#:wr 
  
ok,至此,你已经完成3550交换机配置。 
  
------------------------------ 
附一个完整的3550交换机配置文件: 
Using 3472 out of 393216 bytes 

version 12.1 
no service pad 
service timestamps debug uptime 
service timestamps log uptime 
no service password-encryption 

hostname c3550 

enable secret 5 $1$EYhz$x48Na6Imhow07zQL0GMMc1 
enable password 123456 

ip subnet-zero 
ip routing 



spanning-tree mode pvst 
spanning-tree extend system-id 
spanning-tree vlan 10 priority 24576 
spanning-tree vlan 20 priority 24576 
spanning-tree vlan 30 priority 24576 
spanning-tree vlan 40 priority 24576 
spanning-tree vlan 50 priority 24576 
spanning-tree vlan 60 priority 24576 
spanning-tree vlan 100 priority 24576 



interface FastEthernet0/1 
  switchport access vlan 100 
  switchport mode access 
  no ip address 

interface FastEthernet0/2 
  switchport access vlan 100 
  switchport mode access 
  no ip address 

interface FastEthernet0/3 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/4 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/5 
  switchport access vlan 10 
  switchport mode access 
  no ip address 

interface FastEthernet0/6 
  switchport access vlan 10 
  switchport mode access 
  no ip address 

interface FastEthernet0/7 
  switchport access vlan 20 
  switchport mode access 
  no ip address 

interface FastEthernet0/8 
  switchport access vlan 20 
  switchport mode access 
  no ip address 

interface FastEthernet0/9 
switchport access vlan 30 
  switchport mode access 
  no ip address 

interface FastEthernet0/10 
  switchport access vlan 30 
  switchport mode access 
  no ip address 

interface FastEthernet0/11 
  switchport access vlan 40 
  switchport mode access 
  no ip address 

interface FastEthernet0/12 
  switchport access vlan 40 
  switchport mode access 
  no ip address 

interface FastEthernet0/13 
  switchport access vlan 50 
  switchport mode access 
  no ip address 

interface FastEthernet0/14 
  switchport access vlan 50 
  switchport mode access 
  no ip address 

interface FastEthernet0/15 
  switchport access vlan 60 
  switchport mode access 
  no ip address 

interface FastEthernet0/16 
  switchport access vlan 60 
  switchport mode access 
  no ip address 

interface FastEthernet0/17 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/18 
  switchport mode dynamic desirable 
  no ip address 
  no ip address 

interface FastEthernet0/19 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/20 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/21 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/22 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/23 
  switchport mode dynamic desirable 
  no ip address 

interface FastEthernet0/24 
  switchport mode dynamic desirable 
  switchport mode dynamic desirable 
  no ip address 

interface GigabitEthernet0/1 
  switchport mode dynamic desirable 
  no ip address 

interface GigabitEthernet0/2 
  switchport mode dynamic desirable 
  no ip address 

interface Vlan1 
  no ip address 
  shutdown 

interface Vlan10 
  ip address 172.22.10.1 255.255.255.0 

interface Vlan20 
  ip address 172.22.20.1 255.255.255.0 

interface Vlan30 
  ip address 172.22.30.1 255.255.255.0 


interface Vlan40 
  ip address 172.22.40.1 255.255.255.0 

interface Vlan50 
  ip address 172.22.50.1 255.255.255.0 

interface Vlan60 
  ip address 172.22.60.1 255.255.255.0 

interface Vlan100 
  ip address 172.1.1.1 255.255.0.0 

  
ip classless 
ip route 0.0.0.0 0.0.0.0 172.1.1.2 
ip http server 



line con 0 
line vty 0 4 
  password 123456 
  login 
line vty 5 15 
  password 123456 
  login 

end 
tag标签:
------分隔线----------------------------
------分隔线----------------------------
[相关文章]