cisco Switching-三層交換配置RIP動(dòng)態(tài)路由

?問題

在三層交換機(jī)上配置RIP路由協(xié)議联四,以三層交換機(jī)代替路由器撑教。

通過RIP實(shí)現(xiàn)路由間通信

?方案

動(dòng)態(tài)路由協(xié)議配置靈活伟姐,路由器會(huì)發(fā)送自身的路由信息給其他路由器,同時(shí)也會(huì)接收其他路由器發(fā)來的路由信息建立自己的路由表鹿霸。這樣在路由器上就不必像靜態(tài)路由那樣為每個(gè)目標(biāo)地址都配置路由秆乳,因?yàn)槁酚善骺梢酝ㄟ^協(xié)議學(xué)習(xí)這些路由。網(wǎng)絡(luò)拓?fù)涓淖兏匾保酚尚畔⒁矔?huì)自動(dòng)更新,無需管理員干預(yù)珊肃。

拓?fù)鋱D

步驟

1.按拓?fù)鋱D配置路由接口IP分別

2.在交換機(jī)上配置

Switch(config)#interface f0/6

Switch(config-if)#no switchport

Switch(config-if)#ip address 192.168.6.1 255.255.255.0

Switch(config-if)#no shutdown

3.分別在三層交換機(jī)和路由器上配置RIP路由協(xié)議

RIP路由協(xié)議在配置network時(shí)伦乔,只需要配置該路由器所直連的主類網(wǎng)絡(luò)评矩,不與該路由器直連的網(wǎng)絡(luò)不需要包含在network中阱飘。

RIP默認(rèn)工作在第一版本下,但是RIP-V1是有類路由協(xié)議蔗喂,而且通過廣播的方式進(jìn)行路由更新缰儿,無論是功能上還是效率上都有一些缺陷散址,這些缺陷RIP-V2可以彌補(bǔ)。在使用時(shí)建議采用RIP-V2而不是RIP-V1瞪浸。

tarenasw-3L(config)#router rip

tarenasw-3L(config-router)#version 2

tarenasw-3L(config-router)#no auto-summary

tarenasw-3L(config-router)#network 192.168.1.0

tarenasw-3L(config-router)#network 192.168.2.0

tarenasw-3L(config-router)#network 192.168.3.0

tarenasw-3L(config-router)#network 192.168.4.0

tarenasw-3L(config-router)#network 192.168.5.0

tarenasw-3L(config-router)#network 192.168.6.0

tarena-router(config)#router rip

tarena-router(config-router)#version 2

tarenasw-3L(config-router)#no auto-summary

tarena-router(config-router)#network 192.168.6.0

tarena-router(config-router)#network 192.168.7.0

4.分別在三層交換機(jī)和路由器上查看路由表

注意以R開頭的路由对蒲,這些路由表示通過RIP協(xié)議從其他運(yùn)行RIP的路由器學(xué)習(xí)過來的路由蹈矮。每條路由都寫明了目標(biāo)網(wǎng)絡(luò)鸣驱、下一跳IP地址以及從自己哪個(gè)端口發(fā)出去踊东。

tarenasw-3L#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

C 192.168.1.0/24 is directly connected, Vlan1

C 192.168.2.0/24 is directly connected, Vlan2

C 192.168.3.0/24 is directly connected, Vlan3

C 192.168.4.0/24 is directly connected, Vlan4

C 192.168.5.0/24 is directly connected, Vlan5

C 192.168.6.0/24 is directly connected, FastEthernet0/6

R 192.168.7.0/24 [120/1] via 192.168.6.2, 00:00:12, FastEthernet0/6 0

Router#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

R 192.168.1.0/24 [120/1] via 192.168.6.1, 00:00:25, FastEthernet0/0

R 192.168.2.0/24 [120/1] via 192.168.6.1, 00:00:25, FastEthernet0/0

R 192.168.3.0/24 [120/1] via 192.168.6.1, 00:00:25, FastEthernet0/0

R 192.168.4.0/24 [120/1] via 192.168.6.1, 00:00:25, FastEthernet0/0

R 192.168.5.0/24 [120/1] via 192.168.6.1, 00:00:25, FastEthernet0/0

C 192.168.6.0/24 is directly connected, FastEthernet0/0

C 192.168.7.0/24 is directly connected, FastEthernet0/1

5.在PC上測試到五個(gè)VLAN中主機(jī)的通信

PC>ipconfig

FastEthernet0 Connection:(default port)

Link-local IPv6 Address.........: FE80::2E0:8FFF:FE14:BB43

IP Address......................: 192.168.7.1

Subnet Mask.....................: 255.255.255.0

Default Gateway.................: 192.168.7.254

SERVER>ping 192.168.1.10

Pinging 192.168.1.10 with 32 bytes of data:

Reply from 192.168.1.1: bytes=32 time=0ms TTL=126

Reply from 192.168.1.1: bytes=32 time=0ms TTL=126

Reply from 192.168.1.1: bytes=32 time=0ms TTL=126

Reply from 192.168.1.1: bytes=32 time=1ms TTL=126

Ping statistics for 192.168.1.1:

Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC >ping 192.168.2.1

Pinging 192.168.2.10 with 32 bytes of data:

Reply from 192.168.2.1: bytes=32 time=0ms TTL=126

Reply from 192.168.2.1: bytes=32 time=0ms TTL=126

Reply from 192.168.2.1: bytes=32 time=0ms TTL=126

Reply from 192.168.2.1: bytes=32 time=0ms TTL=126

Ping statistics for 192.168.2.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

PC >ping 192.168.3.1

Pinging 192.168.3.10 with 32 bytes of data:

Reply from 192.168.3.1: bytes=32 time=1ms TTL=126

Reply from 192.168.3.1: bytes=32 time=0ms TTL=126

Reply from 192.168.3.1: bytes=32 time=0ms TTL=126

Reply from 192.168.3.1: bytes=32 time=0ms TTL=126

Ping statistics for 192.168.3.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC >

31% /misc/nfsdir SERVER>

SERVER>ping 192.168.3.10

Pinging 192.168.3.10 with 32 bytes of data:

Reply from 192.168.4.1: bytes=32 time=1ms TTL=126

Reply from 192.168.4.1: bytes=32 time=0ms TTL=126

Reply from 192.168.4.1: bytes=32 time=0ms TTL=126

Reply from 192.168.4.1: bytes=32 time=0ms TTL=126

Ping statistics for 192.168.4.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

31% /misc/nfsdir?

SERVER>ping 192.168.5.1

Pinging 192.168.5.1 with 32 bytes of data:

Reply from 192.168.5.1: bytes=32 time=1ms TTL=126

Reply from 192.168.5.1: bytes=32 time=0ms TTL=126

Reply from 192.168.5.1: bytes=32 time=0ms TTL=126

Reply from 192.168.5.1: bytes=32 time=0ms TTL=126

Ping statistics for 192.168.5.1:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

31% /misc/nfsdir

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末祝闻,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子联喘,更是在濱河造成了極大的恐慌辙纬,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,451評(píng)論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件蓖谢,死亡現(xiàn)場離奇詭異闪幽,居然都是意外死亡盯腌,警方通過查閱死者的電腦和手機(jī)陨瘩,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,172評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門舌劳,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人客们,你說我怎么就攤上這事材诽。” “怎么了建邓?”我有些...
    開封第一講書人閱讀 164,782評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵官边,是天一觀的道長。 經(jīng)常有香客問我契吉,道長捐晶,這世上最難降的妖魔是什么妄辩? 我笑而不...
    開封第一講書人閱讀 58,709評(píng)論 1 294
  • 正文 為了忘掉前任英支,我火速辦了婚禮,結(jié)果婚禮上干花,老公的妹妹穿的比我還像新娘把敢。我一直安慰自己,他們只是感情好修赞,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,733評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著蚣录,像睡著了一般割择。 火紅的嫁衣襯著肌膚如雪荔泳。 梳的紋絲不亂的頭發(fā)上玛歌,一...
    開封第一講書人閱讀 51,578評(píng)論 1 305
  • 那天支子,我揣著相機(jī)與錄音值朋,去河邊找鬼。 笑死昨登,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的稽坤。 我是一名探鬼主播,決...
    沈念sama閱讀 40,320評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼得湘,長吁一口氣:“原來是場噩夢(mèng)啊……” “哼淘正!你這毒婦竟也來了臼闻?” 一聲冷哼從身側(cè)響起述呐,我...
    開封第一講書人閱讀 39,241評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤思犁,失蹤者是張志新(化名)和其女友劉穎激蹲,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體学辱,經(jīng)...
    沈念sama閱讀 45,686評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡策泣,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,878評(píng)論 3 336
  • 正文 我和宋清朗相戀三年着降,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片拗军。...
    茶點(diǎn)故事閱讀 39,992評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡任洞,死狀恐怖蓄喇,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情交掏,我是刑警寧澤妆偏,帶...
    沈念sama閱讀 35,715評(píng)論 5 346
  • 正文 年R本政府宣布,位于F島的核電站盅弛,受9級(jí)特大地震影響钱骂,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜挪鹏,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,336評(píng)論 3 330
  • 文/蒙蒙 一见秽、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧讨盒,春花似錦解取、人聲如沸禀苦。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,912評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至脓匿,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間毡琉,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,040評(píng)論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留泌豆,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,173評(píng)論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像蓝仲,于是被迫代替她去往敵國和親庶艾。 傳聞我的和親對(duì)象是個(gè)殘疾皇子颖榜,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,947評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容