路由器基礎配置之路由重分布
我們將以上面的拓撲圖為例,實驗rip和靜態的路由重分布,pc0,pc1,pc2分屬不同網段,讓他們之間能夠互相通信
首先為pc機配置好IP地址和網關(前往別忘記配置網關)
接下來配置路由器ip地址
router0
enable 進入特權模式
config t 進入全局配置模式
interface s0/2/0 進入接口模式
ip address 192.168.20.2 255.255.255.0 配置ip地址
clock rate 6400 設置同步時間
no shu 激活接口
exit
interface s0/3/0
ip address 192.168.60.2 255.255.255.0
clock rate 6400
no shu
exit
interface s0/3/1
ip address 192.168.50.2 255.255.255.0
clock rate 6400
no shu
exit
router1
enable 進入特權模式
config t 進入全局配置模式
interface s0/2/0 進入接口模式
ip address 192.168.40.1 255.255.255.0 配置ip地址
clock rate 6400 設置同步時間
no shu 激活接口
exit
interface s0/3/0
ip address 192.168.10.2 255.255.255.0
clock rate 6400
no shu
exit
interface s0/3/1
ip address 192.168.60.1 255.255.255.0
clock rate 6400
no shu
exit
router2
enable 進入特權模式
config t 進入全局配置模式
interface s0/2/0 進入接口模式
ip address 192.168.40.2 255.255.255.0 配置ip地址
clock rate 6400 設置同步時間
no shu 激活接口
exit
interface s0/3/0
ip address 192.168.30.2 255.255.255.0
clock rate 6400
no shu
exit
interface s0/3/1
ip address 192.168.50.1 255.255.255.0
clock rate 6400
no shu
exit
router3
enable
config t
interface s0/3/0
ip address 192.168.20.1 255.255.255.0
no shu
exit
interface g0/0
ip address 192.168.3.254 255.255.255.0
no shu
exit
router4
enable
config t
interface s0/3/0
ip address 192.168.10.1 255.255.255.0
no shu
exit
interface g0/0
ip address 192.168.1.254 255.255.255.0
no shu
exit
router5
enable
config t
interface s0/3/0
ip address 192.168.30.1 255.255.255.0
no shu
exit
interface g0/0
ip address 192.168.2.254 255.255.255.0
no shu
exit
路由器IP地址配置完畢,開始配置路由器的rip,靜態和重分布
router0
在全局配置模式下
router rip
ver2
network 192.168.20.0
network 192.168.50.0
network 192.168.60.0
redistribute static metric 1 配置靜態路由的重分布,配置靜態路由的重分布同時可以配置一條直連路由的重分布
redistribute connected metric 1
exit
ip router 192.168.3.0 255.255.255.0 192.168.20.1 設置去往3.0網段的靜態路由
router1
在全局配置模式下
router rip
ver2
network 192.168.10.0
network 192.168.40.0
network 192.168.60.0
redistribute static metric 1 配置靜態路由的重分布,配置靜態路由的重分布同時可以配置一條直連路由的重分布
redistribute connected metric 1
exit
ip router 192.168.1.0 255.255.255.0 192.168.10.1 設置去往1.0網段的靜態路由
router2
在全局配置模式下
router rip
ver2
network 192.168.40.0
network 192.168.50.0
network 192.168.30.0
redistribute static metric 1 配置靜態路由的重分布,配置靜態路由的重分布同時可以配置一條直連路由的重分布
redistribute connected metric 1
exit
ip router 192.168.2.0 255.255.255.0 192.168.30.1 設置去往2.0網段的靜態路由
router3
在全局配置模式下
ip router 192.168.1.0 255.255.255.0 192.168.20.2 設置去往1.0網段的靜態路由
ip router 192.168.2.0 255.255.255.0 192.168.20.2 設置去往2.0網段的靜態路由
router3不是邊界路由器,無需設置重分布
router4
在全局配置模式下
ip router 192.168.3.0 255.255.255.0 192.168.10.2 設置去往3.0網段的靜態路由
ip router 192.168.2.0 255.255.255.0 192.168.10.2 設置去往2.0網段的靜態路由
router4不是邊界路由器,無需設置重分布
router5
在全局配置模式下
ip router 192.168.1.0 255.255.255.0 192.168.30.2 設置去往1.0網段的靜態路由
ip router 192.168.3.0 255.255.255.0 192.168.30.2 設置去往3.0網段的靜態路由
router5不是邊界路由器,無需設置重分布
到此路由的重分布就完成了,可以在各個路由器上在特權模式下用show ip router來查看當前的路由表
現在pc1,pc2,cp3之間是可以相互ping同的,到此,試驗成功
路由器基礎配置之路由重分布