要求:
规划四个VLAN, 分别安排行政、销售、财务部和服务器群组,然后实现四个VLAN间的通信,最后为访问互连网和远程分支机构提供路由。
配置思路:
( 一 )规划VLAN.
可以手工在S3560上划分四个VLAN,然后在S2950上划分相应的VLAN, 也可以采用VTP协议自动学习。
A.(1) 将S3550设为服务器,定义域为rich.
S3560(config)# vtp domain rich
# vtp mode server
(2) 划分4个vlan .(vlan 2,3,4,10)
S3560(config)# vlan 2
# vlan 3
# vlan 4
# vlan 10
(3) 开启主干(f0/1-3)
S3560(config)# int f0/1
# sw trunk encap dot1q
# sw mode trunk
(4)端口f0/20-22划入vlan 10
S3560(config)# int f0/20
# sw mode acc
# sw acc vlan 10
B.(1)将S2900加入域,设为客户端
S2950(vlan) # vtp domain rich
# vtp mode client
(2)开启主干f0/24
S2950(config)# int f0/24
# sw trunk encap dot1q ( 默认,不能配置 )
# sw mode trunk
(3)将端口划到vlan
S2950(config)# int f0/2
# sw mode acc
# sw acc vlan 2
S2950(config)# int f0/3
# sw mode acc
# sw acc vlan 3
调试命令:
sh vlan 查看VLAN
sh vtp status 查看VTP状态
sh int f0/1 switchport 查看端口工作模式:access / trunk
( 二 )实现VLAN间的通信。
(1)打开路由功能
S3560(config )# ip routing
(2)设置VSI接口,建立路由表
S3560(config )#int vlan 1
#ip add 172.16.1.251 255.255.255.0
#no shut
S3560(config )#int vlan 2
#ip add 172.16.2.251 255.255.255.0
#no shut
同样,分别为VLNA3,4,10设置相应的IP地址。
调试命令:
sh ip int brief
sh ip route
( 三 ) 为访问互连网和远程分支机构提供路由
1. 将接口F0/23,F0/24设为路由接口,并配置IP地址。
S3560(config )#int f0/23
#no swithcport // 设为路由接口
#ip add 172.16.11.1 255.255.255.0
#no shut
同样,f0/24的地址设为172.16.12.1 255.255.255.0
2. 为访问互连网设置默认路由
S3560(config )#ip route 0.0.0.0 0.0.0.0 172.16.11.2
3. 配置OSPF 协议
S3560(config )#router ospf 1
# router-id 35.1.1.1
#network 172.16.0.0 0.0.255.255 area 0
调试命令:
sh ip ospf neigh
sh ip route
ping