VLAN间通讯 、 动态路由RIP

【VLAN间通讯 、 动态路由RIP】

三层交换 = 二层交换 + 三层转发

——三层交换机VLAN互通——
(1)2层交换机配置VLAN、Trunk
Switch(config)# vlan 2
Switch(config)# vlan 3
Switch(config)# int range f 0/6-10
Switch(config-if-range)# switchport access vlan 2
Switch(config)# int range f 0/11-15
Switch(config-if-range)# switchport access vlan 3
Switch(config)# int f 0/24
Switch(config-if)# switchport mode trunk

(2)3层交换机配置
3层交换机配置VLAN、Trunk
SW-3L(config)# vlan 2
SW-3L(config)# vlan 3

开启路由功能
SW-3L(config)# ip routing
配置虚拟接口IP
SW-3L(config)# int v 1
SW-3L(config-if)# ip address 192.168.1.254 255.255.255.0
SW-3L(config-if)# no shutdown

配置路由接口
SW-3L(config-if)# no switchport
配置Trunk并指定接口封装为802.1q
SW-3L(config)# int f 0/24
SW-3L(config-if)# switchport trunk encapsulation dot1q
SW-3L(config-if)# switchport mode trunk
注:trunk不属于任何VLAN

——多交换机VLAN互通——
(1)3层交换机配置VLAN、Trunk
(2)在三层交换机配置路由
SW-3L(config)# int f 0/24
SW-3L(config-if)# no switchport
SW-3L(config-if)# ip address 192.168.4.1 255.255.255.0
SW-3L(config-if)# no shutdown
SW-3L(config)# ip route 0.0.0.0 0.0.0.0 192.168.4.2
(3)在路由器上配置接口和路由
Router(config)# int f 0/24
Router(config-if)# ip address 192.168.4.2 255.255.255.0
Router(config-if)# no shutdown
Router(config)# ip route 192.168.1.0 255.255.255.0 192.168.4.1
Router(config)# ip route 192.168.2.0 255.255.255.0 192.168.4.1
Router(config)# ip route 192.168.3.0 255.255.255.0 192.168.4.1

动态路由
方便管理,占用带宽
按应用范围分类:
内部网关协议:RIP、IGRP、EIGRP、IS-IS、OSPF
外部网关协议:EGP、BGP

按路由执行算法分类:
距离矢量路由协议:RIP、IGRP
链路状态路由协议OSPF、IS-IS

——RIP协议——

最大15跳,更新时间30s,UDP520端口
RIP配置
启动RIP进程并启用版本V2
Router(config)# router rip
Router(config-router)# version 2
关闭RIP V2路由自动汇总
Router(config-router)# no auto-summary
宣告主网络ID
Router(config-router)# network 192.168.1.0

猜你喜欢

转载自www.cnblogs.com/fuzhongfaya/p/8948158.html
今日推荐