路由层面的配置
启用RIP
Router(config)# interface f0/2
Router(config-if)# ip address 172.16.0.1 255.255.255.0
Router(config-if)#no shutdown
Router(config)# interface f0/3
Router(config-if)# ip address 172.16.1.1 255.255.255.0
Router(config-if)#no shutdown
Router(config)#router rip
Router(config)#version 2
Router(config)#no autosummary
Router(config)#network 200.200.200.0
Router(config)#network 172.16.0.0
Router(config)#network 172.16.1.0
ds-1(config)#ip routing
ds-1(config)#interface f0/1
ds-1(config-if)# no switchport
ds-1(config-if)# ip add 172.16.0.2 255.255.255.0
ds-1(config-if)#no shutdown
ds-1(config)#router rip
ds-1(config)#version 2
ds-1 (config)#no autosummary
ds-1 (config)#network 172.16.0.0
ds-1 (config)#network 192.168.1.0
ds-1 (config)#network 192.168.2.0
ds-1 (config)#network 192.168.3.0
ds-2(config)#ip routing
ds-2(config)#interface f0/1
ds-2(config-if)# no switchport
ds-2(config-if)# ip add 172.16.1.2 255.255.255.0
ds-2(config-if)#no shutdown
ds-2(config)#router rip
ds-2(config)#version 2
ds-2 (config)#no autosummary
ds-2 (config)#network 172.16.1.0
ds-2 (config)#network 192.168.1.0
ds-2 (config)#network 192.168.2.0
ds-2 (config)#network 192.168.3.0
禁止访问C1vlan10(财务部)
Router(config)#ip access-list extended stop-to-C1vlan10
Router(config-ext-nacl)#10 deny ip any 10.10.10 .0 0.0.0.255
Router (config)#interface f0/1
Router (config-if)# ip access-group stop-to-C1vlan10 out
二、吃掉总部
交换层面的配置
交换层面的配置和上海分公司交换层面的配置操作一样,只是不同的vlan和ip而已,所以我只演示配置汇聚层的的冗余(在此我不再使用HSRP而是使用VRRP,毕竟VRRP才是行业标准,我以Multilaiyer switch 0和Multilaiyer switch 1为例配置汇聚层的VRRP)
VRRP配置如下(Multilaiyer switch 0为vlan 10的active, Multilaiyer switch 1为vlan 10的standby;Multilaiyer switch 0为vlan 20的standby,Multilaiyer switch 1为vlan 20的active)
Multilaiyer switch 0(config)# track 100 interface f0/10 line-protocol
Multilaiyer switch 0(config)# track 200 interface f0/11 line-protocol
(注:f0/10为switch0和Multilaiyer switch 0的接口,f0/11为switch0和Multilaiyer switch 1的接口,VRRP下的端口跟踪是在全局模式下配置的,这与HSRP有一点的区别)
Multilaiyer switch 0(config)# interface vlan 10
Multilaiyer switch 0(config-if)# vrrp 1 i p 10.10.10 .100(vlan 10的虚拟ip)
Multilaiyer switch 0(config-if)# vrrp 1 priority 200
Multilaiyer switch 0(config-if)# vrrp 1 preemt
Multilaiyer switch 0(config-if)# vrrp 1 track 100 decrement 50
Multilaiyer switch 0(config-if)# vrrp 1 track 200 decrement 50
Multilaiyer switch 0(config-if)# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)
Multilaiyer switch 0(config)# interface vlan 20
Multilaiyer switch 0(config-if)# vrrp 1 i p 20.20.20 .100(vlan 20的虚拟ip)
Multilaiyer switch 0(config-if)# vrrp 1 priority 170
Multilaiyer switch 0(config-if)# vrrp 1 preemt
Multilaiyer switch 0(config-if)# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)
Multilaiyer switch 1(config-if)# track 100 interface f0/10 line-protocol
Multilaiyer switch 1(config-if)# track 200 interface f0/11 line-protocol
(注:f0/10为switch1和Multilaiyer switch 0的接口,f0/11为switch1和Multilaiyer switch 1的接口,VRRP下的端口跟踪是在全局模式下配置的,这与HSRP有一点的区别)
Multilaiyer switch 1(config)# interface vlan 10
Multilaiyer switch 1(config-if)# vrrp 1 i p 10.10.10 .100(vlan 10的虚拟ip)
Multilaiyer switch 1(config-if)# vrrp 1 priority 170
Multilaiyer switch 1(config-if)# vrrp 1 preemt
Multilaiyer switch 1(config-if)# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)
Multilaiyer switch 1(config)# interface vlan 20
Multilaiyer switch 1(config-if)# vrrp 1 i p 20.20.20 .100(vlan 20的虚拟ip)
Multilaiyer switch 1(config-if)# vrrp 1 priority 200
Multilaiyer switch 1(config-if)# vrrp 1 preemt
Multilaiyer switch 1(config-if)# vrrp 1 track 100 decrement 50
Multilaiyer switch 1(config-if)# vrrp 1 track 200 decrement 50
Multilaiyer switch 1(config-if)# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)
DHCP服务器的配置(以路由器作为DHCP服务器)
Server-PT(config)# ip dhcp pool pool-vlan10
Server-PT(config)# network 10.10.10 .0 255.255.255.0
Server-PT(config)#default-gateway 10.10.10 .1
Server-PT(config)# ip dhcp pool pool-vlan20
Server-PT(config)# network 20.20.20 .0 255.255.255.0
Server-PT(config)#default-gateway 20.20.20 .1
Server-PT(config)# ip dhcp pool pool-vlan30
Server-PT(config)# network 30.30.30.0 255.255.255.0
Server-PT(config)#default-gateway 30.30.30.1
Server-PT(config)# ip dhcp pool pool-vlan40
Server-PT(config)# network 40.40.40.0 255.255.255.0
Server-PT(config)#default-gateway 40.40.40.1
路由层面的配置
使用ospf路由协议进行网络路由的学习(以Core 1和Core2为例,汇聚层的交换机ospf配置和核心层一样)
Core 1(config)#interface loopback 0 (以便核心层的设备成为DR和BDR)
Core 1(config-if)#ip add 1.1.1 .1 255.255.255.0
Core 1(config)# router ospf 200
Core 1(config-router)#network 11.11.11 .0 0.0.0.255 area 0
Core 1(config-router)#network 12.12.12 .0 0.0.0.255 area 0
Core 1(config-router)#network 13.13.13 .0 0.0.0.255 area 0
Core 1(config-router)#network 14.14.14 .0 0.0.0.255 area 0
Core 1(config-router)#network 100.100.100.0 0.0.0 .255 area 0
Core 2(config)#interface loopback 0 (以便核心层的设备成为DR和BDR)
Core 2(config-if)#ip add 2.2.2 .2 255.255.255.0
Core 2(config)# router ospf 200
Core 2(config-router)#network 11.11.11 .0 0.0.0.255 area 0
Core 2(config-router)#network 12.12.12 .0 0.0.0.255 area 0
Core 2(config-router)#network 13.13.13 .0 0.0.0.255 area 0
Core 2(config-router)#network 14.14.14 .0 0.0.0.255 area 0
Core 2(config)# router rip (一会的路由充分发会用到)
Core 2(config-router)# version 2
Core 2(config-router)# no auto-summary
Core 2(config-router)# network 200.200.200.0
默认路由的配置
通向公网我们使用默认路由
Core 1(config)#ip route 0.0.0 .0 0.0.0.0 s0/0
Core 1(config)#ip route 0.0.0 .0 0.0.0.0 s0/0 (s0/0为通往公网的接口)
路由充分发
Core 2(config)# router rip
Core 2(config-router)# version 2
Core 2(config-router)# no auto-summary
Core 2(config-router)# redistribute ospf 200 metric 10 (充分发ospf到rip)
Core 2(config)# router ospf 200
Core 2(config)# redistribute rip metric 150 subnet (充分发rip到ospf)
word文档下载http://down.51cto.com/data/136304
补充:核心层链路聚合
Core 1(config-if)#int range g0/1-g0/2
Core 1(config-if-range)#switchport
Core 1(config-if-range)#channel-protocol lacp
Core 1(config-if-range)#channel-group 1 mode active
Core2和Core1相同配置。