路由重发布的方法

路由重发布发生在边界路由上。当路由的两个端运行不同的路由协议时需要配置。拓扑图如下,中间路由器的两端分别使用不同的路由协议ospf、RIP,需要通过重发布配置使两端的网络连通。

二层交换机:(两端完全一样)

en                        

conf  t

vl 10

vl 20

in f 0/1                   //将交换机的端口1设置为Vlan10的Access口

sw ac v 10       

in f 0/11

sw ac v 20

in g 0/1

sw m t               //设置trunk默认允许所有的Vlan包通过

左侧路由:

en

conf t

in f 1/0

no sh

in f 1/0.1                 //子接口封装成dot1q,即Vlan10

en d 10                  //只有封装后,子接口才能配置IP地址

ip ad 192.168.10.1 255.255.255.0

in f 1/0.2                //子接口封装成dot1q,即Vlan20

en d 20

ip ad 192.168.11.1 255.255.255.0

in f 0/0

no sh

ip ad 1.1.1.1 255.255.255.252    //使用 /30的掩码

ro ospf 1              //进入OSPF协议配置模式

net 192.168.10.0  0.0.0.255  area 0    //发布192.168.10.0网段,骨干区域0

net 192.168.11.0  0.0.0.255  a  0      //0.0.0.255是通配符(主机掩码),表

//示: 192.168.10.0网段里的所有主机发的数

//据包都可以通过

net 1.1.1.0  0.0.0.3  a  0                 

右侧路由:

en

conf t

in f 1/0

no sh

in f 1/0.1

en d 10

ip ad 192.168.12.1 255.255.255.0

in f 1/0.2

en d 20

ip ad 192.168.13.1 255.255.255.0

in s2/0

no sh

ip ad 1.1.2.2 255.255.255.252

ro rip                  //进入RIP协议配置模式

ver 2                   //版本2(支持VLAM无类)

net 192.168.12.0       //发布192.168.10.0网段(凡连接的网段都要发布)

net 192.168.13.0  

net 1.1.2.0

中间路由:

en

conf t

in f 1/0                                     

no sh

ip ad 192.168.14.1 255.255.255.0

in f 0/0

no sh

ip ad 1.1.1.2 255.255.255.252

in s2/0

no sh

ip ad 1.1.2.1 255.255.255.252

ro ospf 1              //进入OSPF协议配置模式

net 192.168.14.0  0.0.0.255  area 0     //发布192.168.10.0网段,骨干区域0

net 1.1.1.0  0.0.0.3  a  0

re  rip metric 3 sub    //重发布RIP协议到OSPF区域,并支持无类路由

ro rip           //进入RIP协议配置模式

ver 2          

net 1.1.2.0          

re os 1 metric 3    //重发布OSPF协议到RIP区域

涉及的英文基本单词

distribute:分配,分发   redistribute:重分配(重发布)

enable:使能,使实现     encapsulation:封装   configure:配置

动态路由协议:

  RIP (Routing Information Protocol):路由信息协议,适用于小规模的网络环境,主要用于一个AS(自治系统)内的路由信息的传递。属于:内部网关协议(Interior Gateway Protocol,简称IGP)

OSPF(Open Shortest Path First):开放式最短路径优先协议,属于:内部网关协议

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值