1、在三层交换机上增加vlan,配置命令如下:

登录交换机设备,通过验证之后。

config t
vlan 20
name meetingromm
end

config t
interface Vlan20
description server
ip address 192.168.252.1 255.255.255.0
no shutdown
end
copy run start

2、在接入层交换机端口上添加vlan;
首先需要明确需要将交换机的哪些端口添加到那个vlan上,本示例中是将c2960-18上的21、22、23、24端口划分到vlan 20。
然后登录交换机设备(192.168.253.18),通过验证之后。
config t
interface range Fa0/21 - 24
description meetingroom-user
switchport access vlan 20
swichport mode access
no shutdown
end
copy run start

注意:将交换机单个的端口添加到vlan时,应使用如下的命令(加命令解释)。
interface Fa0/21  ----进入到接口模式中
description meetingroom-user  -----添加接口描述,此命令不是必须的
switchport access vlan 20  -----将此端口加入到 vlan 20
swichport mode access   ----将接口配置为access模式
no shutdown     -----激活端口
end   -------退回到用户模式
copy run start  ------将配置保存

 删除vlan:

 config#no vlan 100(vlan的ID号)

config#do wr

 

 

3、cisco 3560配置保存:

在特权模式下:FB-C3560-1#copy running-config tftp:
Address or name of remote host []? 192.168.100.237
Destination filename [fb-c3560-1-confg]? fb-c3560-1-config      
!!
4773 bytes copied in 1.233 secs (3871 bytes/sec)

cisco3560已经分配DHCP:

         ip dhcp pool vlan10
         network 192.168.100.0 255.255.255.0
          dns-server 202.96.134.133 202.96.128.86
          default-router 192.168.100.1  

4、 现在要将这段DHCP池的部分IP去掉,如去掉192.168.100.1至30-在全局模式下:ip dhcp excluded-address 192.168.100.1 192.168.100.30

            如果去掉某几个IP:ip dhcp excluded-address 192.168.100.72
ip dhcp excluded-address 192.168.100.172
ip dhcp excluded-address 192.168.100.34
ip dhcp excluded-address 192.168.100.157
ip dhcp excluded-address 192.168.100.226
ip dhcp excluded-address 192.168.100.142
ip dhcp excluded-address 192.168.100.201

            全局模式下保存:do wr  。或者退出到特权模式下:wr  

5、通过MAC地址查看是cisco的某个端口,并且关闭该端口:           

 #show arp
#show mac-address-table | include a00b.bab1.555f
#show cdp neighbors 查看周边CISCO设备的状态
#show mac address-table | inclu 848f.69b5.56ab

查看第二个端口的状态:
#show interfaces fastEthernet 0/2


进入2960的第14口:
FB-C2960-6(config)#interface fastEthernet0/14   #进入第14口

FB-C2960-6(config)#show interfaces fastEthernet0/14   
FB-C2960-6(config)#interface fastEthernet 0/14       #进入第14口 
FB-C2960-6(config-if)#                       
FB-C2960-6(config-if)#shutdown                     #关闭端口
FB-C2960-6(config-if)#do wr
FB-C2960-6(config-if)#no shutdown                      #激活端口
FB-C2960-6(config-if)#do wr

 5、

show ip interface brief

show interfaces trunk