Chinaunix首页 | 论坛 | 博客
  • 博客访问: 177189
  • 博文数量: 59
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2015-06-29 10:38
个人简介

我以为我们可以一起走到最后,呵呵。。。 结果才走了两步,你说你要打的

文章分类
文章存档

2015年(59)

我的朋友

分类:

2015-06-30 10:27:31

实验要求:
本拓扑按典型中小企业网分支-总部-分支结构模拟,总部核心路由为C3550,外联网通 过 OSPF 协议,内联网通过VTP 协议部署实现全网互联
1、 总部核心交换机 C3550-1 创建VLAN10/20/30/40,其中VLAN40 只做设备管理之用,不进行端口接入,VLAN 划分情况如图。
2、 C3550-1 为VTP Server,域名sovand.com,密码sovand,C2950 与C3550-2 为client,查看 VLAN 传递情况。
3、 C3550-2 建立 DHCP Server,地址池见拓扑,要求终端1/2/3 能正常获取到地址并 实现内联网互联。
4、 外联网起 OSPF 协议,实现全网互联;C2950 和C3550-2 配置管理地址,实现远程 管理。
5、 因安全需要,需要断开VLAN20 到其他交换机的通信,但不影响本地访问及其他 VLAN间的通信
6、 因业务需求,需在C2950 上创建一个新的VLAN100 作为本地通信使用,但不改变当 前的拓扑和 VTP 部署。
7、 因业务扩展,需将C3550-2 作为 VTP-Server 划入一个新的域“full”,但不中断域内 网络的情况下去实现。
实验拓扑图:

clip_image002

实验步骤:
1、 在内网上配置 VLAN 和 VTP 协议
C3550-1:
C3550-1(config)#vlan 10
C3550-1(config-vlan)#vlan 20
C3550-1(config-vlan)#vlan 30
C3550-1(config-vlan)#vlan 40
C3550-1(config-vlan)#exit
C3550-1(config)#int f0/7
C3550-1(config-if)#switchport trunk encapsulation dot1q    //在三层接口上封装 802.1Q 协议
C3550-1(config-if)#switchport mode trunk
C3550-1(config-if)#int f0/9
C3550-1(config-if)#switchport mode access
C3550-1(config-if)#switchport access vlan 10
C3550-1(config)#vtp domain sovand.com    //配置 VTP 域名为 sovand.com
C3550-1(config)#vtp password sovand        //设置 VTP 密码 C3550-1(config)#vtp mode server      //设置 VTP 服务器模式 C3550-2:
C3550-2(config)#vlan 30
C3550-2(config-vlan)#exit
C3550-2(config)#int f0/11
C3550-2(config-if)#switchport trunk encapsulation dot1q
C3550-2(config-if)#switchport mode trunk
C3550-2(config-if)#int f0/10
C3550-2(config-if)#switchport mode access
C3550-2(config-if)#switchport access vlan 30
C3550-2(config)#vtp domain sovand.com C3550-2(config)#vtp password sovand C3550-2(config)#vtp mode client
C2950:
C2950(config)#vlan 20
C2950(config-vlan)#exit
C2950(config)#int f0/1
C2950(config-if)#switchport mode trunk
C2950(config)#int f0/2
C2950(config-if)#switchport mode trunk
C2950(config-if)#int f0/3
C2950(config-if)#switchport mode access
C2950(config-if)#switchport access vlan 20
C2950(config)#vtp domain sovand.com
C2950(config)#vtp password sovand
C2950(config)#vtp mode client
查看接口 trunk:
sw-2#show int trunk

Port    Mode    Encapsulation    Status    Native vlan
Fa0/1    on    802.1q    trunking    1
Fa0/2    on    802.1q    trunking    1

Port    Vlans allowed on trunk
Fa0/1    1-19,21-4094
Fa0/2    1-19,21-4094

Port    Vlans allowed and active in management domain
Fa0/1    1,10,30,40,100
Fa0/2    1,10,30,40,100

Port    Vlans in spanning tree forwarding state and not pruned
Fa0/1    1,10,30,40,100
Fa0/2    1,10,30,40,100

SW3#show int trunk

Port
Fa0/11    Mode    Encapsulation    Status
on    802.1q    trunking    Native vlan
1

Port
Fa0/11   
Vlans allowed on trunk
1-4094   

Port
Fa0/11   
Vlans allowed and active in management domain
1,10,20,30,40   

Port
Fa0/11   
Vlans in spanning tree forwarding state and not pruned
1
   

2、在 C3550-2 上配置 DHCP 服务器
每个 VLAN 的客户端在向 DHCP 服务器发送广播请求时,DHCP 服务器必须能够指向网关, 网关即是核心交换机中配置的相应 VLAN 地址。由于 DHCP 服务器属于 VLAN30,所以 VLAN30 的主机在发送 DHCP 广播时无需使用中转地址。而 VLAN20 和 VLAN10 发送广播时必须通过网 关配置中转地址才可到达 VLAN30 中的 DHCP 服务器。
C3550-1:
C3550-1(config)#ip routing    //开启三层交换机路由功能
C3550-1(config)#int vlan 10
C3550-1(config-if)#ip add 172.16.1.1 255.255.255.0    //配置网关 IP
C3550-1(config-if)#ip help-address 172.16.3.2    //将中转地址配置成 DHCP 服务器地址
C3550-1(config-if)#no shut
C3550-1(config)#int vlan 20
C3550-1(config-if)#ip add 172.16.2.1 255.255.255.0
C3550-1(config-if)#ip help-address 172.16.3.2
C3550-1(config-if)#no shut
C3550-1(config)#int vlan 30
C3550-1(config-if)#ip add 172.16.3.1 255.255.255.0
C3550-1(config-if)#no shut
C3550-2:
C3550-2(config)#no ip routing
C3550-2(config)#int vlan 30
C3550-2(config-if)#ip add 172.16.3.2 255.255.255.0    //配置 DHCP 服务器 IP 地址
C3550-2(config)#ip dhcp pool vlan10    //建立 DHCP 地址池
C3550-2(dhcp-config)#network 172.16.1.0 255.255.255.0    //配置地址池
C3550-2(dhcp-config)#default-router 172.16.1.1    //指向 VLAN10 的默认网关
C3550-2(config)#ip dhcp pool vlan20
C3550-2(dhcp-config)#network 172.16.2.0 255.255.255.0
C3550-2(dhcp-config)#default-router 172.16.2.1
C3550-2(config)#ip dhcp pool vlan30
C3550-2(dhcp-config)#network 172.16.3.0 255.255.255.0
C3550-2(dhcp-config)#default-router 172.16.3.1
C3550-2(config)#ip dhcp exclude-address 172.16.3.1 172.16.3.10    //添加 DHCP 排除地址
C3550-2(config)#ip dhcp exclude-address 172.16.2.1 172.16.2.10
C3550-2(config)#ip dhcp exclude-address 172.16.1.1 172.16.1.10
查看 DHCP 获取情况:
SW3#show ip dhcp bin
IP address    Client-ID/    Lease expiration    Type
Hardware address
172.16.1.12    0063.6973.636f.2d30.    Mar 02 1993 04:28 AM    Automatic
3030.352e.3332.6363.
2e31.3132.302d.4661.
302f.30
172.16.2.12    0063.6973.636f.2d30.    Mar 02 1993 04:27 AM    Automatic
3030.342e.3961.6362.
2e39.6134.302d.4661.
302f.30
172.16.3.13    0063.6973.636f.2d30.    Mar 02 1993 04:28 AM    Automatic
3030.632e.3330.6361.
2e31.3463.302d.4661.
302f.30

3、外联网启用 OSPF 协议
C3550-1:
C3550-1(config)#int f0/8
C3550-1(config-if)#no switchport    //开启三层端口功能
C3550-1(config-if)#ip add 195.1.11.2 255.255.255.252
C3550-1(config-if)#no shut
C3550-1(config)#router ospf 88
C3550-1(config-router)#net 195.1.11.2 0.0.0.0 a 0
C3550-1(config-router)#net 172.16.0.0 0.0.3.255 a 0
R4:
R4(config)#router ospf 88
R4(config-router)#net 195.1.11.1 0.0.0.0 a 0
R4(config-router)#net 195.2.11.1 0.0.0.0 a 0
R5:
R5(config)#router ospf 88
R5(config-router)#net 10.1.11.1 0.0.0.0 a 1
R5(config-router)#net 195.2.11.2 0.0.0.0 a 0
4、配置远程管理 VLAN
C3550-1:
C3550-1(config)#int vlan 40
C3550-1(config-if)#ip add 172.16.4.1 255.255.255.0    //配置管理 VLAN 的网关
C3550-1(config)#line vty 0 4
C3550-1(config-line)#password cisco
C3550-1(config-line)#login
C3550-2:
C3550-2(config)#int vlan 40
C3550-2(config-if)#ip add 172.16.4.100 255.255.255.0    //管理 VLAN 的地址
C3550-2(config)#ip default-gateway 172.16.4.1    //指向核心路由器的相应网关 C3550-2(config)#line vty 0 4
C3550-2(config-line)#password cisco
C3550-2(config-line)#login
C2950:
C2950(config)#int vlan 40
C2950(config-if)#ip add 172.16.4.99 255.255.255.0
C2950(config)#ip default-gateway 172.16.4.1
C2950(config)#line vty 0 4
C2950(config-line)#password cisco
C2950(config-line)#login
5、断开 VLAN20 到其他交换机的通信
C2950(config)#int f0/3
C2950(config-if)#switchport trunk allowed vlan remove 20    //断开 VLAN20 的 trunk 链路
6、在 C2950 上新建一个 VLAN100 作为本地通信
由于C2950 处于VTP 客户端模式,不能添加或删除VLAN,所以必须改变模式才可以配 置。如果改成 server 模式的话,一旦修订号高于其他交换机,就很容易将原有的 VLAN 覆盖掉,不符合题意。所以只能配置成透明模式,可以添加删除 VLAN,但是不会进行更新。
C2950(config)#vtp mode transparent
C2950(config)#vlan 100
C2950(config-vlan)#exit
查看 VLAN 信息:
sw-2#show vlan
VLAN Name    Status    Ports
---- -------------------------------- --------- -------------------------------
1    default    active    Fa0/4, Fa0/5, Fa0/6, Fa0/7
Fa0/8, Fa0/9, Fa0/10, Fa0/11
Fa0/12, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24
10    VLAN0010    active
20    VLAN0020    active    Fa0/3
30    VLAN0030    active
40    VLAN0040    active
100    VLAN0100    active
1002 fddi-default    act/unsup
1003 trcrf-default    act/unsup
1004 fddinet-default    act/unsup
1005 trbrf-default    act/unsup
SW3#show vlan
VLAN Name    Status    Ports
---- -------------------------------- --------- -------------------------------
1    default    active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
Fa0/6, Fa0/7, Fa0/8, Fa0/9
Fa0/10, Fa0/13, Fa0/14, Fa0/15
Fa0/16, Fa0/17, Fa0/18, Fa0/19
Fa0/20, Fa0/21, Fa0/22, Fa0/23
Fa0/24, Gi0/1, Gi0/2
10    VLAN0010    active
20    VLAN0020    active
30    VLAN0030    active    Fa0/12
40    VLAN0040    active
1002 fddi-default    act/unsup
1003 trcrf-default    act/unsup
1004 fddinet-default    act/unsup
1005 trbrf-default    act/unsup
7、将 C3550-2 作为 VTP Server 划入一个新的域“full”
在端口自协商的情况下,如果两台交换机的 VTP 域名配置不同,它们之间将无法形成 trunk。想要在两台交换机上配置两个不同的域名,又要成功启用 trunk,则必须关闭端口自协商。
C3550-2(config)#int f0/11
C3550-2(config-if)#switchport nonegotiate    //关闭端口自协商
C2950(config)#int f0/2
C2950(config-if)#switchport nonegotiate
C3550-2(config)#vtp mode server
C3550-2(config)#vtp domain full
查看 VTP 状态:
SW3#show vtp st
VTP Version    : 2
Configuration Revision    : 0
Maximum VLANs supported locally : 1005
Number of existing VLANs    : 9
VTP Operating Mode    : Server VTP Domain Name        : full VTP Pruning Mode     : Enabled
VTP V2 Mode    : Enabled
VTP Traps Generation    : Disabled
MD5 digest    : 0xD3 0xCF 0x2B 0xCD 0x7A 0x73 0x6C 0x01

sw-2#show vtp st
VTP Version    : 2
Configuration Revision    : 0
Maximum VLANs supported locally : 64
Number of existing VLANs    : 10
VTP Operating Mode    : Transparent VTP Domain Name        : sovand.com VTP Pruning Mode     : Enabled
VTP V2 Mode    : Enabled
VTP Traps Generation    : Disabled
MD5 digest    : 0xBE 0x71 0x40 0x86 0xE1 0x48 0x5A 0x36
Configuration last modified by 172.16.4.99 at 3-1-93 01:19:26

阅读(1095) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~