天猫思科交换机保存配置(思科交换机系列)

思科交换机基本配置命令

switch>enable 进入特权模式 switch#config terminal 进入全局模式 switch(config)#hostname+xxx 设置主机名 switch(config)#enable password 明文密码 switch(config)#enable secret 密文密码 switch(config)#ip default-gateway 设置网关 switch#show mac-address-table 查看MAC地址 switch(config)#logging synchronous 阻止控制台信息覆盖命令行上的输入 switch(config)#no ip domain-lookup 关闭DNS查看功能 switch(config)#exec-timeout 0 0 阻止会话退出

switch (config)#vsan database

即:copy startup-config running-config

VLAN的端口聚合叫TRUNK,用来在不同的交换机之间进行连接,以保证在跨越多个交换机上建立的同一个VLAN的成员能够相互通讯。

基本命令如下:

dallasr1>(enable) set cgmp enable

switch(enable) set spantree maxage agingtiame[vlan]

switch#show wwn switch

switch(config)#vtp domain 设置VTP域名 switch(config)#vtp password xx 设置VTP密码 switch(config)#vtp mode server/client/transparent 设置VTP服务模式 switch(config)#vtp version 设置VTP版本 switch(config)#vtp pruning 设置VTP修解

备份:

下面配置ZONE

50:06:0e:80:05:8a:ee:00

/*将端口17-24添加到VLAN 4*/

可以出来命令的使用方法)

switch(conf)#hostname aptch2950

switch>en

2ceng(config-if)#switch mode trunk //将24口设置为干线

21:00:00:24:ff:00:2e:f3

其中的fc1/5是我们的连接的设备的WWN号码也需要记录

[OK]

Ruijie(config)#vlan 100

21:00:00:24:ff:00:2e:f3

Switch#show ip dhcp conflict 显示地址冲突情况

aptech2950(conf-if)#exit

show fcdomain domain-list 查看级联信息

DHCP配置

二层交换机的配置(配置二层交换机可远程管理)

switch(config-if)#spanning-tree portfast

在基于 CLI 的交换机上设置主机名/系统名:

# fastEthernet 0/1配置access类型并划分到vlan 52中

switch#vlan database //进入VLAN设置

Ruijie(config-if-FastEthernet 0/1)#no switchport ——>将端口设置为三层口,配置IP地址之前必须要先变为三层口,否则无法配置IP地址

cisco(config)#

掌握目标

aptech2950(conf)#

enable (提示完整的命令)

switch#

(config)# vsan database 进入

是否保存(y/n) y: 保存设置信息 n:不保存设置信息

switch(enable) set password

auto Show Automation Template

Create another login account (yes/no) [n]:

R1(config)# privilege configure level 3 ping

switch#conf t ;进入全局配置模式

switch#show vtp //查看vtp配置信息

switch(enable) set port duplex module/number {full|half}

查看命令:

switch#config t

switch#show zoneset

配置命令及步骤如下:

Cisco_SW(config)#no ip domain lookup

switch#conf t

8:查看命令 show

SW-3(config)#vlan 2
SW-3(config-vlan)#
SW-3(config-vlan)#vlan 3
SW-3(config-vlan)#exit
SW-3(config)#
SW-3(config)#int range f0/1 – 2
SW-3(config-if-range)#switchport trunk encapsulation dot1q
SW-3(config-if-range)#switchport mode trun
说明:三层交换思科支持ISI与dot1q,所以这里明确指定。
这里没用DHCP功能,可以参考这里:DHCP原理及在企业中的应用

Interface IP-Address(Pri) IP-Address(Sec) Status Protocol

switch(config-line)#line vty 0 4 //设置进入虚拟终端的连接数目 0~4 5个

Switch(Config-vlan)No Shut

1. 初始化信息

Mgmt0 IPv4 address : <10.0.x.y> (where x is your pod number and y is 5 for MDS-1 and 3 for MDS-2)(客户)0.16

Mgmt0 IPv4 netmask : 255.255.255.0

IPv4 address of the default gateway : 10.0.x.254 (where x is your pod number)

2. 交换机配置

2.1. 配置交换机管理地址

switch (config)# switchname switchswitch(config)# switch(config)# interface mgmt 0switch(config-if)# ip adress 192.168.100.108 255.255.255.0switch(config-if)# no shutdown

2.2. 配置VSAN

2.3. 配置ZONESET

2.4. 配置ZONE

交换机端口都是以fc表示,fc1/1 表示第一个模块上的第一个端口。由于像cisco9506之类的交换机是模块化的,所以其每个端口就是fc模块号/端口号。像cisco9120,cisco9140,不是模块化的,但其接口默认是fc1/端口号。

2.5. TRUNKING的配置

3. 常用命令

4. 常用技巧

4.1. 修改交换机IP地址

switch(config)-if# ip address <192.168.1.1> <255.255.255.0> 输入修改后的IP 和掩码

switch(config)# ip default-gateway <192.168.1.254>

4.2. 解决网口不亮的方法

4.3. 修改用户密码

4.4. 修改交换机名字

4.5. 启动关闭服务

5. 实例交换机级联跨交换机化zone

A交换机端口1,端口2 分别连接B交换机得端口1,端口2

5.1. 首先初始化按照1初始化两台交换机

在每个交换机上创建VSAN2,把端口1-48加入到vsan2 中

5.2. 交换机开启mode E

在两个交换机上开启端口模式E,关闭TRUNK(只是级联不是跨交换机跨VSAN化zoneTRUNK可以关闭)根据可需要选择开启的端口,这里是开启fc1/1,fc1/2

5.3. 查看是否级联成功

5.4. 配置zone及zoneset并激活