路由重發布發生在邊界路由上,當路由的兩個端運行不同的路由協議時需要配置,拓撲圖如下,中間路由器的兩端分別使用不同的路由協議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):開放式最短路徑優先協議,屬于:內部網關協議
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/342022.html
標籤:其他
