拓扑图:
配置:
第一步:划分对应部门的vlan,部署链路聚合,配置接口和HSTP
#SW1-8,SW10配置vlan
conf t
vlan 10,20,30,40,50,60,100
#SW9 配置vlan
vlan 200,201,91,92
#SW7,8 配置vlan并配置接口
vlan 77,78
vlan 87,88
#SW7,SW8互相部署链路汇聚
int ra e2/2-3
channel-protocol lacp
channel-group 1 mode active
#SW1-6,SW9,10 配置接口
例子:int e0/0
sw mo ac
sw ac vl 10(20/30/40/50/60/100)
#SW1-6配置truck接口对应的放行
例: int e0/1
sw tr en do
sw mo tr
sw tr al vl 10
#SW7,8链路交换机放行所有vlan
例:int e1/0
sw tr en do
sw mo tr
sw tr al vl 10,20,30,40,50,60,100
int port-channel 1
sw tr en do
sw mo tr
sw tr al vl 10,20,30,40,50,60,100
#SW10放行vlan 100
int e0/0
sw tr en do
sw mo tr
sw tr al vl 100
#部署mstp,统一将SW7设置为vlan 10 20 30 100的根桥,vlan 40 50 60 的备份桥跟,
统一将SW8设置为vlan 40 50 60 的根桥,vlan 40 50 6010 20 30 的备份根桥
SW1-8,10
spanning-tree mode mst //启用MSTP配置
spanning-tree mst config //进入MSTP配置模式
name aaa yuanquwang
instence 1 vlan 10,20,30,100
instence 2 vlan 40,50,60
SW7,SW8
SW7
spanning-tree mst 1 root primary
sapnning-tree mst 2 root secondary
SW8
spanning-tree mst 2 root primary
sapnning-tree mst 1 root secondary
第二步:划分对应部门所在的网段,配置静态IP
#对应的网段已经划分好了
#现在配置一下除了vlanif所在ip的静态地址
DHCP:192.168.100.1 24
AR1:e0/2 192.168.12.1 24
e0/1 192.168.13.1 24
e0/0 192.168.92.1 24
AR2: e0/2 192.168.23.2 24
e0/1 192.168.12.2 24
e0/0 192.168.91.2 24
AR3: e0/0 192.168.13.3 24
e0/1 192.168.23.3 24
e0/2 100.1.11.3 24
e0/3 100.1.33.3 24
YUNYINGAR1: e0/1 100.1.11.1 24
e0/2 100.1.33.1 24
e0/0 100.2.33.1 24
Server3 100.2.33.3 24
#配置交换机的vlanif以及连接交换机的路由的接口 IP
SW7: vlan 192.168.X.7 24
SW8: vlan 192.168.X.8 24
SW9: vlan 192.168.200.9 24
192.168.201.9 24
192.168.91.9 24
192.168.92.9 24
Server1 192.168.200.1 24
Server2 192.168.201.1 24
AR1: e0/3 192.168.77.1 24
e1/0 192.168.78.1 24
AR2: e0/3 192.168.88.2 24
e1/0 192.168.87.2 24
SW7: int vl77
ip add 192.168.77.7 24
int vl78
ip add 192.168.78.7 24
SW8: int vl87
ip add 192.168.87.8 24
int vl88
ip add 192.168.88.8 24
#在汇聚链路层部署vrrp(使vrrp组的master和根桥使同一个设备) vl 10,20,30,40,50,60,100
例: int vl 10
vrrp 10 ip 192.168.10.254
vrrp 10 priority 120
第三步:配置DHCP
#DHCP服务端配置
例: ip dhcp pool vlan10
network 192.168.10.0 /24
default-router 192.168.10.254
ip dhcp excluded-address 192.168.10.7 192.168.10.8
#客户端配置
int e0/0
ip add dhcp
#因为dhcp没有路由,所以手动配置一条
ip route 0.0.0.0 0.0.0.0 192.169.100.254
#由于dhcp服务器和终端不在同一网段,所以需要在汇聚层开启dhcp中继,dhcp开启地址绑定到接口
例: int vl10
ip helper-address 192.168.100.1
第四步:配置ospf(内网)
#area 0
AR3: e0/0 e0/1
AR1: e0/0-3,e1/0
AR2: e0/0-3,e1/0
SW9: e0/2-3
SW7,8: 宣告10,20,30,40,50,60, 77,87,88,78
#area 200
SW9: e0/0
#area 201
SW9: e0/1
第五步:完成acl配置(满足基本需求)
#出口区配置nat+acl (ospf需要引入一条默认路由,为了保证网络可靠性,部署浮动路由)标签:24,CISCO,0.0,192.168,中型企业,ip,100,局域网络,e0 From: https://blog.51cto.com/syjblog/5913325
AR3:ip route 0.0.0.0 0.0.0.0 100.1.11.1
ip route 0.0.0.0 0.0.0.0 100.1.33.1
#部署acl
access-list 100 permit 192.168.10.0 0.0.0.255
access-list 100 permit 192.168.20.0 0.0.0.255
access-list 100 permit 192.168.30.0 0.0.0.255
access-list 100 permit 192.168.40.0 0.0.0.255
access-list 100 permit 192.168.50.0 0.0.0.255
access-list 100 permit 192.168.60.0 0.0.0.255
ip nat inside source list 100 interface e0/2 overload
ip nat inside source list 100 interface e0/3 overload
int ra e0/2-3
ip nat outside
int ra e0/0-1
ip nat inside
#server1和server2和server3配置静态路由
ip route 0.0.0.0 0.0.0.0 192.168.200.9
ip route 0.0.0.0 0.0.0.0 192.168.201.9
ip route 0.0.0.0 0.0.0.0 100.2.33.1