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

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

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

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

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

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

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

C3750x-24s-s1(config-if)#ip add 192.168.12.62 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

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

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

C3750x-24s-s1(config-if)#ip add 192.168.100.254 255.255.255.192 C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/1 !是下连至办公楼一层接入交换的接口C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

!如果一个楼层划一个vlan,以上可以修改为: !Int g0/1

!Switchport access vlan 楼层对应VLAN号 !Exit

C3750x-24s-s1(config-if)#int g0/2 !下连至办公楼二层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/3 !下连至办公楼三层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

25

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/4 !下连至办公楼四层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/5 !下连至办公楼五层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/6 !下连至办公楼六层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/7 !下连至生活楼一层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/8 !下连至生活楼二层接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/9 !下连至生产楼接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

C3750x-24s-s1(config-if)#int g0/10 !下连至食堂接入交换的接口 C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit ???????????

C3750x-24s-s1(config-if)#int g0/24

C3750x-24s-s1(config-if)#switchport mode trunk

C3750x-24s-s1(config-if)#switchport trunk allowed vlan all C3750x-24s-s1(config-if)#no shutdown C3750x-24s-s1(config-if)#exit

26

C3750x-24s-s1(config-if)#int g1/1 !上连至路由器接口 C3750x-24s-s1(config-if)#switchport Access vlan 100 C3750x-24s-s1(config-if)#no shutdown

C3750x-24s-s1(config-if)# ip route 0.0.0.0 0.0.0.0 192.168.100.253 !到路由器出口路由

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

C3750x-24s-s1(config)#int f0/24 ! 在核心的F0/24口部署HSRP冗余网关协议 C3750x-24s-s1(config-if- FastEthernet0/24)# standby 1 ip 192.168.0.253 C3750x-24s-s1(config-if FastEthernet0/24)# standby 1 preempt C3750x-24s-s1(config-if-Ethernet0)# standby 1 priority 120

C3750x-24s-s1(config-if- FastEthernet0/24)# standby 1 authentication Router C3750x-24s-s1(config-if- FastEthernet0/24)# standby 1 timers 5 15

C3750x-24s-s1(config-if- FastEthernet0/24)# standby 1 track FastEthernet0/24 30 C3750x-24s-s1(config-if)#exit C3750x-24s-s1(config-if)#exit C3750x-24s-s1#write memory

在C3750X-24S-S2部署HSRP冗余网关协议的配置命令:

C3750x-24s-s2(config-if- FastEthernet0/24)# standby 1 ip 192.168.0.253 C3750x-24s-s2(config-if- FastEthernet0/24)# standby 1 preempt

C3750x-24s-s2(config-if- FastEthernet0/24)# standby 1 authentication Router C3750x-24s-s2(config-if- FastEthernet0/24)# standby 1 timers 5 15

48口接入交换机配置过程(办公楼一层Bg-C2960-1f-1交换机示例): 目标:

a、为交换机设置管理、配置口及TELNET密码1.1(其它从1.2递增); b、为交换机分别分配IP地址,即192.168.1.1,网关192.168.1.254; c、设置上接端口g1/1的属性,下级连口g1/2属性; d、从G0/1开始每6个口划归一个VLAN, 如g0/1,g0/2,g0/3,g0/4,g0/5,g0/6归vlan10; g0/7,g0/8,g0/9,g0/10,g0/11,g0/12归vlan11??

Switch>en Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname Bg-C2960-1f-1 Bg-C2960-1f-1(config)#int vlan 1

Bg-C2960-1f-1(config-if)#ip add 192.168.1.1 255.255.255.0 Bg-C2960-1f-1(config-if)#ip default-gateway 192.168.1.254 Bg-C2960-1f-1(config-if)#no shutdown Bg-C2960-1f-1(config-if)#exit Bg-C2960-1f-1(config)#vlan 2

27

Bg-C2960-1f-1(config-vlan)#name DeviceConnect Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 10

Bg-C2960-1f-1(config-vlan)#name Shengchan1 Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 11

Bg-C2960-1f-1(config-vlan)#name Shengchan2 Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 12

Bg-C2960-1f-1(config-vlan)#name Shengchan3 Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 13

Bg-C2960-1f-1(config-vlan)#name Shengchan4 Bg-C2960-1f-1(config-vlan)#vlan 14

Bg-C2960-1f-1(config-vlan)#name Xiaosh1 Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 15

Bg-C2960-1f-1(config-vlan)#name Xiaosh2 Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 16

Bg-C2960-1f-1(config-vlan)#name Zonghbgs Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 17

Bg-C2960-1f-1(config-vlan)#name Caiwsh Bg-C2960-1f-1(config-vlan)#exit Bg-C2960-1f-1(config)#vlan 18

Bg-C2960-1f-1(config-vlan)#name Yanfb

Bg-C2960-1f-1(config)#int g0/1 !下连至工作区子系统 Bg-C2960-1f-1(config-if)#switchport access vlan 10 Bg-C2960-1f-1(config-if)#no shutdown Bg-C2960-1f-1(config-if)#exit

Bg-C2960-1f-1(config)#interface range g0/2 - 6

Bg-C2960-1f-1(config-if-range)#switchport mode access Bg-C2960-1f-1(config-if-range)#switchport access vlan 10 Bg-C2960-1f-1(config-if-range)#exit

Bg-C2960-1f-1(config)#interface range g0/7 - 12

Bg-C2960-1f-1(config-if-range)#switchport mode access Bg-C2960-1f-1(config-if-range)#switchport access vlan 11 Bg-C2960-1f-1(config-if-range)#exit

Bg-C2960-1f-1(config)#interface range g0/13 - 18

Bg-C2960-1f-1(config-if-range)#switchport mode access Bg-C2960-1f-1(config-if-range)#switchport access vlan 12 Bg-C2960-1f-1(config-if-range)#exit

Bg-C2960-1f-1(config)#interface range g0/19 - 24

28