中小型企业局域网的设计 下载本文

图4-3园区网络设备IP分配示意图

Cisco交换机的命令行操作模式主要包括: a、用户模式 Switch> b、特权模式 Switch#

c、全局配置模式 Switch(config)# d、端口模式 Switch(config-if)#

21

图4-4Cisco各配置状态转换图

核心交换机配置 目标:

a、为两个交换机分别设置管理、配置口及TELNET密码100.1和100.2; b、为两个核心交换机分别分配IP地址,即192.168.100.1、192.168.100.2;网关192.168.100.254。

c、在两个核心交换机上部署HSRP冗余网关协议;

d、设置三层交换机VLAN 间的通信,创建VLAN2,VLAN11,VLAN12?的虚接口,并配置虚接口VLAN2,VLAN11、VLAN12?相应的IP地址。

C3750X-24S-S1配置过程:

Switch>en !进入特权模式命令 Switch#conf t !进入全局模式命令 Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#enable password 100.1 !配置特权模式密码为“100.1” Switch (config)#hostname C3750x-24s-s1 !设置主机名为“C3750x-24s-s1”

22

C3750x-24s-s1(config)#interface vlan 1 !

C3750x-24s-s1(config-if)#ip address 192.168.100.1 255.255.255.192

!设置交换机IP为192.168.100.1,用来管理交换机 C3750x-24s-s1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Vlan1, changed state to up C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config)#line console 0 C3750x-24s-s1(config-line)#pass 100.1 C3750x-24s-s1(config-line)#login

C3750x-24s-s1(config-line)#line vty 0 4 C3750x-24s-s1(config-line)#password 100.1 C3750x-24s-s1(config-line)#login C3750x-24s-s1(config-line)#vlan 2

C3750x-24s-s1(config-vlan)#name DeviceConnect !C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config-line)#vlan 2

C3750x-24s-s1(config-vlan)#name DeviceConnect C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 10

C3750x-24s-s1(config-vlan)#name Shengchan1 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 11

C3750x-24s-s1(config-vlan)#name Shengchan2 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 12

C3750x-24s-s1(config-vlan)#name Shengchan3 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 13

C3750x-24s-s1(config-vlan)#name Shengchan4 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 14

C3750x-24s-s1(config-vlan)#name Xiaosh1 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 15

C3750x-24s-s1(config-vlan)#name Xiaosh2 C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 16

C3750x-24s-s1(config-vlan)#name Zonghbgs C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 17

C3750x-24s-s1(config-vlan)#name Caiwsh C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#vlan 18

C3750x-24s-s1(config-vlan)#name Yanfb

定义设备VLAN 23

C3750x-24s-s1(config-vlan)#exit

???????? !根据VLAN划分表循环配置 C3750x-24s-s1(config)#vlan 100

C3750x-24s-s1(config-vlan)#name zhuysb !主要设备互联VLAN C3750x-24s-s1(config-vlan)#exit C3750x-24s-s1(config)#int vlan 2 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan2, changed state to up

C3750x-24s-s1(config-if)#ip address 192.168.1.254 255.255.255.0 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 10 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan10, changed state to up

C3750x-24s-s1(config-if)#ip address 192.168.10.62 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 11 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan11, changed state to up

C3750x-24s-s1(config-if)#ip address 192.168.10.126 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 12 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan12, changed state to up

C3750x-24s-s1(config-if)#ip address 192.168.10.190 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 13 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan13, changed state to up

C3750x-24s-s1(config-if)#ip address 192.168.10.254 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 14 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan14, changed state to up

C3750x-24s-s1(config-if)#ip add 192.168.11.62 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config)#int vlan 15 C3750x-24s-s1(config-if)#

%LINK-5-CHANGED: Interface Vlan15, changed state to up

24