多层交换综合实验(二)

 路由层面的配置

启用RIP

  Routerconfig# interface f0/2

  Router(config-if)# ip address 172.16.0.1 255.255.255.0

          Router(config-if)#no shutdown

  Routerconfig# interface f0/3

  Router(config-if)# ip address 172.16.1.1 255.255.255.0

          Router(config-if)#no shutdown

     Routerconfig#router rip

     Routerconfig#version 2

     Routerconfig#no autosummary

     Routerconfig#network 200.200.200.0

     Routerconfig#network 172.16.0.0

     Routerconfig#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-1config#router rip

     ds-1config#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-2config#router rip

     ds-2config#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(财务部)

     Routerconfig#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

二、吃掉总部

    

交换层面的配置

交换层面的配置和上海分公司交换层面的配置操作一样,只是不同的vlanip而已,所以我只演示配置汇聚层的的冗余(在此我不再使用HSRP而是使用VRRP,毕竟VRRP才是行业标准,我以Multilaiyer switch 0Multilaiyer switch 1为例配置汇聚层的VRRP

VRRP配置如下(Multilaiyer switch 0vlan 10active, Multilaiyer switch 1vlan 10standbyMultilaiyer switch 0vlan 20standbyMultilaiyer switch 1vlan 20active)

Multilaiyer switch 0config# track 100 interface f0/10 line-protocol

Multilaiyer switch 0config# track 200 interface f0/11 line-protocol

(注:f0/10switch0Multilaiyer switch 0的接口,f0/11switch0Multilaiyer switch 1的接口,VRRP下的端口跟踪是在全局模式下配置的,这与HSRP有一点的区别)

Multilaiyer switch 0config# interface vlan 10

Multilaiyer switch 0config-if# vrrp 1 i p 10.10.10 .100(vlan 10的虚拟ip)

Multilaiyer switch 0config-if# vrrp 1 priority 200

Multilaiyer switch 0config-if# vrrp 1 preemt

Multilaiyer switch 0config-if# vrrp 1 track 100 decrement 50

Multilaiyer switch 0config-if# vrrp 1 track 200 decrement 50

Multilaiyer switch 0config-if# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)

Multilaiyer switch 0config# interface vlan 20

Multilaiyer switch 0config-if# vrrp 1 i p 20.20.20 .100(vlan 20的虚拟ip)

Multilaiyer switch 0config-if# vrrp 1 priority 170

Multilaiyer switch 0config-if# vrrp 1 preemt

Multilaiyer switch 0config-if# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)

Multilaiyer switch 1config-if# track 100 interface f0/10 line-protocol

Multilaiyer switch 1config-if# track 200 interface f0/11 line-protocol

(注:f0/10switch1Multilaiyer switch 0的接口,f0/11switch1Multilaiyer switch 1的接口,VRRP下的端口跟踪是在全局模式下配置的,这与HSRP有一点的区别)

Multilaiyer switch 1config# interface vlan 10

Multilaiyer switch 1config-if# vrrp 1 i p 10.10.10 .100(vlan 10的虚拟ip)

Multilaiyer switch 1config-if# vrrp 1 priority 170

Multilaiyer switch 1config-if# vrrp 1 preemt

Multilaiyer switch 1config-if# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)

Multilaiyer switch 1config# interface vlan 20

Multilaiyer switch 1config-if# vrrp 1 i p 20.20.20 .100(vlan 20的虚拟ip)

Multilaiyer switch 1config-if# vrrp 1 priority 200

Multilaiyer switch 1config-if# vrrp 1 preemt

Multilaiyer switch 1config-if# vrrp 1 track 100 decrement 50

Multilaiyer switch 1config-if# vrrp 1 track 200 decrement 50

Multilaiyer switch 1config-if# ip help-address 100.100.100.2(配置DHCP服务器的帮助地址)

DHCP服务器的配置(以路由器作为DHCP服务器)

Server-PTconfig# ip dhcp pool pool-vlan10

Server-PTconfig# network  10.10.10 .0 255.255.255.0

Server-PTconfig#default-gateway  10.10.10 .1

Server-PTconfig# ip dhcp pool pool-vlan20

Server-PTconfig# network  20.20.20 .0 255.255.255.0

Server-PTconfig#default-gateway  20.20.20 .1

Server-PTconfig# ip dhcp pool pool-vlan30

Server-PTconfig# network 30.30.30.0 255.255.255.0

Server-PTconfig#default-gateway 30.30.30.1

Server-PTconfig# ip dhcp pool pool-vlan40

Server-PTconfig# network 40.40.40.0 255.255.255.0

Server-PTconfig#default-gateway 40.40.40.1

路由层面的配置

使用ospf路由协议进行网络路由的学习(以Core 1Core2为例,汇聚层的交换机ospf配置和核心层一样)

Core 1config#interface loopback 0  (以便核心层的设备成为DRBDR)

Core 1config-if#ip add  1.1.1 .1 255.255.255.0

Core 1config# router ospf 200

Core 1config-router#network  11.11.11 .0 0.0.0.255 area 0

Core 1config-router#network  12.12.12 .0 0.0.0.255 area 0

Core 1config-router#network  13.13.13 .0 0.0.0.255 area 0

Core 1config-router#network  14.14.14 .0 0.0.0.255 area 0

Core 1config-router#network 100.100.100.0  0.0.0 .255 area 0

Core 2config#interface loopback 0  (以便核心层的设备成为DRBDR)

Core 2config-if#ip add  2.2.2 .2 255.255.255.0

Core 2config# router ospf 200

Core 2config-router#network  11.11.11 .0 0.0.0.255 area 0

Core 2config-router#network  12.12.12 .0 0.0.0.255 area 0

Core 2config-router#network  13.13.13 .0 0.0.0.255 area 0

Core 2config-router#network  14.14.14 .0 0.0.0.255 area 0

Core 2config# router rip               (一会的路由充分发会用到)

Core 2config-router# version 2

Core 2config-router# no auto-summary

Core 2config-router# network 200.200.200.0

默认路由的配置

通向公网我们使用默认路由

Core 1config#ip route  0.0.0 .0 0.0.0.0 s0/0

Core 1config#ip route  0.0.0 .0 0.0.0.0 s0/0                                                                  (s0/0为通往公网的接口)

路由充分发

 Core 2config# router rip             

Core 2config-router# version 2

Core 2config-router# no auto-summary

Core 2config-router# redistribute ospf 200 metric 10 (充分发ospfrip

Core 2config# router ospf 200

Core 2config# redistribute rip metric 150 subnet    (充分发ripospf

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相同配置。

 

你可能感兴趣的:(职场,路由,休闲,交换)