switch>命令行模式;config#特权模式一、 配置交换机vlan模式;有两种方式第一种:config#vlan ID 这里的ID是需要你个人给要划分的vlan起的编号 config-if#name 名字switch#show vlan brief 查看vlan用来检验是否配置成功第二种:switch#vlan database 交换机的vlan配置状态switch(vlan)#vlan ID name名字 配置vlan并且分配相应的名字二、 3560 ±开启路由功能配置switch(config)#ip routingswitch(config)#ip route ipaddress net-hop 配置路由(静态)switch(config)#ip default-gateway ipaddress 配置网关三、 开启聚合链路配置#conftSW(config)#interface range fl/1 - 2SW(config-if)#channel-group 1 mode desirable/onSW(config-if)#swithportSW(config-if)#switchport mode trunkSW(config-if)#switchport trunk encap dotlq四、 启动telnet管理模式switch(config)#line vty 0 4switch(config-line)#password 密码switch(config-line)#login五、开启cisco H志功能 switch(config)#logging onswitch(config)#logging trap 信息switch(config)#logging host 你的 IP 地址switch(config)#logging facility 你选着的信息配置3550作为dhcp服务器六、配置cisco启动dhcp功能配置地址池switch(config)ip dhcp pool 名 字switch(config-pool)network maskswitch(config-pool)dns-serverswitch(config-pool)default-router 网关设置dhcp保留不分配的地址switch(config)ip dhcp excluded-address 地址 地址第一步;从起交换机第二步;配置1) 按下MODE键后给3560加电。
2) 在出现的菜单中选择第一项system software:flash_initload_helperbootswitch: flash_initswitch: load_helper3) 重命名 flash:config.text 文件switch: ren flash:config.text flash:config.old4) 重启交换机switch: boot5) 当出现问你是否进行配置时,选择NO (因为它找不到配置文件config.text文件了)Would you like to enter the initial configuration dialog? [yes/no]:no(用户模式)(特权模式)(全局配置模式)(接口模式)(线模式)〃切换到特权〃切换到全局配置模式〃进入接口 f0/0〃进入VLAN 1中6)从用户模式登录特权模式,无需密码Switch>enSwitch#7) 恢复刚才重命令的配置文件名.Switch#ren flash:config.old flash:config.text Destination filename [config.text]?直接回车8) 用老的配置文件替换当前的配置文件。
Switch#copy flash:config.text system:running-config Destination filename [running-config]?直接回车9) 修改使用密码Switch#conf t10) 保存密码switch(config)#enable password songswitch#wr or copy running-config starting-configOK到这里我们的密码就改好了 o一、 交换机五种模式Swith>Swith#Swith(config)#Swith(config-if)#Swith(config-line)#二、 交换机模式切换Swith>enableSwith#config tSwith(config)# interface fO/1Swith(config)# interface vlan 1Swith(config-if)#ip address 192.16&1.1 255.255.255.0 M VLAN1 设置 IP 地址和子网掩码〃激活VLAN1Swith(config-if)#no shutdown三、 设置交换机的密码1、 用户到特权的密码Swith(config)#enable password 123 (优先级低)Swith(config)#enable secret 456 (优先级高)〃如果两个都设置则456生效2、 控制台console密码设置Swith(config)# line con 0Swith(config-line)#loginSwith(config-line)#password consolel23 〃设置 console 密码为 telnet 1233、 启用telnet密码Swith(config)#line vty 0 15 〃最多有 0〜15 人可以 telnet 访问 swith,合计 16 人Swith(config-line)#loginSwith(config-line)#password telnet 123 /股置 telnet 密码为 telnet 123注:要想真正生效telnet还要设置特权密码①交换机命名hostname BENETS WO 1Swith(config)#hostname B ENETS WO 1 〃使用 hostname 命名交换机的名字四、 show命令集Swith#show version//® 示 IOS 版本信息Swith#show vlan id 10//简单的显示 VLAN10 的信息Swith#show running-config//®示正在运行的配置文件Swith#show startup-config//®示己经保存的配置文件Swith#show mac-address-table//® 示 MAC 地址表Swith#show mac-address-table//®示MAC地址表更新的间隔,默认为5分钟Swith#show neighbor detail//显示邻居详细信息Swith#show traffic//显示 CDP 流量Swith#show五、设置交换机的网关和DNS名称服务器的IP地址Swith(config)# ip default-gateway 192.168.10.8/^换机的网关设置为 192.168.10.8Swith(config)#ip domain -name server 202.106.0.20 /股置 DNS 名称服务器地址Swith(config)# no ip domain-lookup 〃交换机名称服务器的域名查询六、创建、删除、查看VLANSwitch#vlan database〃进入vlan数据库配置模式Switch(vlan)#vlan 2〃创建VLAN2命名为vlan0002,也可以使用vlan2 name salesVLAN 2 added:Name: VLAN0002Switch(vlan)#exit〃退出时应用生效Swith(vlan)#no vlan 2〃删除vlan2Switch(config)# interface f0/lSwitch(config-if)# switchport access vlan 2〃将端口加入vlan 2中Switch(config-if)# no switchport access vlan 2〃将端口从vlan2中删除Switch(config)# interface range f0/l - 10//进行F0/1到10端口范围Switch(config-if-range)# switchport access vlan 2 〃将 f0/l 到 f0/10 之间的所有端 口加入 vlan 2Switch# show vlan brief〃查看所有VLAN的摘要信息Switch# show vlan id vlan-id〃查看指定VLAN的信息七、开启并查看trunk端Swith(config)#interface fO/24Swith(config-if)#swith mode trunk /*各 fO/24 端口 设置为 trunkSwitch#show interfacefO/24 switchport 〃查看 fO/24 的接 口状态八、 从Trunk中添加、删除VlanSwitch (config-if )# switchport trunk allowed vlan remove 3 〃从 trunk 立帶 口删除 v lan3 通过Switch (config-if)# switchport trunk allowed vlan add 3 〃从 trunk 端口 添力口 vlan3 通过Switch # show interface interface-id switchport 〃检查中继端 口允许 VLAN 的列表九、 单臂路由配置Router(config)# interface f0/0.1Router(config-subif)# encapsolution dotlq 1 〃子接口封装 dotlq 针对的是 VLAN1Router(config-subif)# ip address 192.168.1.1 255.255.255.0 〃设置 VLAN 的网关地址Router(config)# interface f0/0.2Router(config-subif)# encapsolution dotlq 2〃子接口 圭寸装 dotlq 针对的是 vlan2Router(config-subif)# ip address 192.16&2.1 255.255.255.0/股置 vlan2 的网关的地址 第一章:VTP配置思路:1>设置VTP域名2>设置VTP模式3>创建VLAN4>配置其它VTP参数 vtp domian [domian name] 〃设置 vtp 域名vtp mode [serverlclientltransparent] 〃设置 vtp 模式 vtp password [passdord] 〃设置 vtp 口令vtp pruning 〃配置 vtp 修剪vt。