Chinaunix首页 | 论坛 | 博客
  • 博客访问: 528593
  • 博文数量: 81
  • 博客积分: 8020
  • 博客等级: 中将
  • 技术积分: 1085
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-08 10:36
文章分类

全部博文(81)

文章存档

2010年(3)

2009年(25)

2008年(53)

我的朋友

分类: 系统运维

2009-06-17 17:23:08

两台3750交换机


一、实验一
一台交换机

switch>en                                           ;进入特权模式
switch#config terminal                              ;进入全局配置模式
Switch(config)#hostname switch01                      ;设置交换机的主机名
switch01(config)#no ip http server                    ;关闭非加密的HTTP访问
switch01(config)#no ip domain lookup                  ;禁用域名解析
switch01(config)#service password-encryption
switch01(config)#enable secret test
switch01(config)#line console 0
switch01(config-line)#login
switch01(config-line)#password test
switch01(config-line)#exit
switch01(config)#line vty 0 4
switch01(config-line)#login
switch01(config-line)#password test
switch01(config-line)#exec-timeout 30 0
switch01(config-line)#exit

switch01(config)#interface vlan 1
switch01(config-if)#ip address 10.129.5.1 255.255.255.0
switch01(config-line)#exit

switch01(config)#vlan 10
switch01(config-vlan)#name vlan10
switch01(config-vlan)#exit
switch01(config)#interface vlan 10
switch01(config-if)#ip address 10.129.10.1 255.255.255.0
switch01(config-if)#exit

switch01(config)#vlan 20
switch01(config-vlan)#name vlan20
switch01(config-vlan)#exit
switch01(config)#interface vlan 20
switch01(config-if)#ip address 10.129.20.1 255.255.255.0
switch01(config-if)#exit
switch01(config)#ip routing

switch01(config)#interface gigabitEthernet 1/0/1
switch01(config-if)#switchport access vlan 10
switch01(config-if)#desc vlan10_test1
switch01(config-if)#exit

switch01(config)#interface gigabitEthernet 1/0/2
switch01(config-if)#switchport access vlan 10
switch01(config-if)#desc vlan10_test2
switch01(config-if)#exit

switch01(config)#interface gigabitEthernet 1/0/11
switch01(config-if)#switchport access vlan 20
switch01(config-if)#desc vlan20_test1
switch01(config-if)#exit

switch01(config)#interface gigabitEthernet 1/0/12
switch01(config-if)#switchport access vlan 20
switch01(config-if)#desc vlan20_test2
switch01(config-if)#exit
switch01#wr


二、实验二
两台交换机一台做路由,其中两台交换机的23、24口作trunk
1、switch01的基本配置已经做过,现在做trunk

switch01的trunk配置
switch01(config)#interface Port-channel 1
switch01(config-if)#switchport trunk encapsulation dot1q
switch01(config-if)#switchport mode trunk
switch01(config-if)#exit

switch01(config)#interface GigabitEthernet1/0/23
switch01(config-if)#description to_switch02_g1/0/23
switch01(config-if)#switchport trunk encapsulation dot1q
switch01(config-if)#switchport mode trunk
switch01(config-if)#channel-group 1 mode on

switch01(config)#interface GigabitEthernet1/0/24
switch01(config-if)#description to_switch02_g1/0/24
switch01(config-if)#switchport trunk encapsulation dot1q
switch01(config-if)#switchport mode trunk
switch01(config-if)#channel-group 1 mode on



2、switch02

switch>en                                           ;进入特权模式
switch#config terminal                              ;进入全局配置模式
Switch(config)#hostname switch02                      ;设置交换机的主机名
switch02(config)#no ip http server                    ;关闭非加密的HTTP访问
switch02(config)#no ip domain lookup                  ;禁用域名解析
switch02(config)#service password-encryption
switch02(config)#enable secret test
switch02(config)#line console 0
switch02(config-line)#login
switch02(config-line)#password test
switch02(config-line)#exit
switch02(config)#line vty 0 4
switch02(config-line)#login
switch02(config-line)#password test
switch02(config-line)#exec-timeout 30 0
switch02(config-line)#exit

switch02(config)#interface vlan 1
switch02(config-if)#ip address 10.129.5.2 255.255.255.0
switch02(config-if)#no shut            #要no shut,否则管理IP10.129.5.2不通
switch02(config-line)#exit
switch02(config)#ip default-gateway 10.252.5.1

switch02(config)#vlan 10
switch02(config-vlan)#name vlan10
switch02(config-vlan)#exit

switch02(config)#vlan 20
switch02(config-vlan)#name vlan20
switch02(config-vlan)#exit

switch02(config)#interface gigabitEthernet 1/0/1
switch02(config-if)#switchport access vlan 10
switch02(config-if)#desc vlan10_test1
switch02(config-if)#exit

switch02(config)#interface gigabitEthernet 1/0/2
switch02(config-if)#switchport access vlan 10
switch02(config-if)#desc vlan10_test2
switch02(config-if)#exit

switch02(config)#interface gigabitEthernet 1/0/11
switch02(config-if)#switchport access vlan 20
switch02(config-if)#desc vlan20_test1
switch02(config-if)#exit

switch02(config)#interface gigabitEthernet 1/0/12
switch02(config-if)#switchport access vlan 20
switch02(config-if)#desc vlan20_test2
switch02(config-if)#exit

switch02(config)#interface Port-channel 1
switch02(config-if)#switchport trunk encapsulation dot1q
switch02(config-if)#switchport mode trunk
switch02(config-if)#exit

switch02(config)#interface GigabitEthernet1/0/23
switch02(config-if)#description to_switch01_g1/0/23
switch02(config-if)#switchport trunk encapsulation dot1q
switch02(config-if)#switchport mode trunk
switch02(config-if)#channel-group 1 mode on

switch02(config)#interface GigabitEthernet1/0/24
switch02(config-if)#description to_switch01_g1/0/24
switch02(config-if)#switchport trunk encapsulation dot1q
switch02(config-if)#switchport mode trunk
switch02(config-if)#channel-group 1 mode on
switch02(config-if)#exit
switch02(config)#exit
switch02#wr


实验三:两台交换机做冗余路由
1、switch01

switch01>en                                          
switch01#config terminal
switch01(config)#interface Vlan1
switch01(config-if)#ip address 10.129.5.1 255.255.255.0
switch01(config-if)#standby 255 ip 10.129.5.254
switch01(config-if)#standby 255 preempt delay minimum 10
switch01(config-if)#exit

switch01(config)#interface Vlan10
switch01(config-if)#ip address 10.129.10.1 255.255.255.0
switch01(config-if)#standby 10 ip 10.129.10.254
switch01(config-if)#standby 10 preempt delay minimum 10
switch01(config-if)#exit

switch01(config)#interface Vlan20
switch01(config-if)#ip address 10.129.20.1 255.255.255.0
switch01(config-if)#standby 20 ip 10.129.20.254
switch01(config-if)#standby 20 preempt delay minimum 10
switch01(config-if)#exit
switch01(config)#
switch01#wr


2、switch02

switch02>en                                          
switch02#config terminal
switch02(config)#interface Vlan1
switch02(config-if)#ip address 10.129.5.2 255.255.255.0
switch02(config-if)#standby 255 ip 10.129.5.254
switch02(config-if)#standby 255 priority 90
switch02(config-if)#standby 255 preempt delay minimum 10
switch02(config-if)#exit

switch02(config)#interface Vlan10
switch02(config-if)#ip address 10.129.10.2 255.255.255.0
switch02(config-if)#standby 10 ip 10.129.10.254
switch02(config-if)#standby 10 priority 90
switch02(config-if)#standby 10 preempt delay minimum 10
switch02(config-if)#exit

switch02(config)#interface Vlan20
switch02(config-if)#ip address 10.129.20.2 255.255.255.0
switch02(config-if)#standby 20 ip 10.129.20.254
switch02(config-if)#standby 20 priority 90
switch02(config-if)#standby 20 preempt delay minimum 10
switch02(config-if)#exit
switch02(config)#
switch02#wr
阅读(1125) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~