一、PVC全互連,且支持廣播
NBMA
N—-None
B—-broadcast
MA—-Multi Access
非廣播多路訪問(wèn)(NBMA)—廣播多路訪問(wèn)(BMA)
BMA可以簡(jiǎn)單的想象成我們的以太網(wǎng),當(dāng)然,它是支持廣播的。
而NBMA則可以想象成不支持廣播的以太網(wǎng)(PVC全互連)
那么如果要讓OSPF能在NBMA網(wǎng)絡(luò)中正常運(yùn)行(正常的經(jīng)歷幾個(gè)過(guò)程,必須要有DR的產(chǎn)生),只需讓NBMA網(wǎng)絡(luò)支持廣播即可。
OSPF定義了多種網(wǎng)絡(luò)類(lèi)型,我們可以在接口上定義網(wǎng)絡(luò)類(lèi)型參數(shù)
ip ospf net broadcast
例:
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fr map ip 12.12.12.2 102 broadcast
ip ospf net broadcast
二、PVC全互連,不支持廣播
與上例相似,但是不支持廣播,那么OSPF報(bào)文無(wú)法穿過(guò)網(wǎng)絡(luò)到達(dá)目的地,所以,它們無(wú)法建立鄰居關(guān)系,更不用說(shuō)DR和BDR選舉了。此時(shí),我們只要解決了一個(gè)問(wèn)題就可以了:把組播換成單播。如何變成單播發(fā)送呢?只需指定鄰居就OK了
neighbor 12.12.12.2 priority 5
neighbor 13.13.13.3 priority 10
例:
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 123.123.123.1 255.255.255.0 a 0
net 1.1.1.1 255.255.255.0 a 0
neighbor 123.123.123.2 priority 5
neighbor 123.123.123.3 priority 10
router-id 123.123.123.1
三、PVC非全互連,支持廣播
在這種類(lèi)型的環(huán)境中,我們知道,它是支持廣播的,但是并非全互連,這里就會(huì)有一個(gè)問(wèn)題—–部分設(shè)備之間沒(méi)有PVC.這樣會(huì)導(dǎo)致一個(gè)問(wèn)題:DR的選舉混亂。X認(rèn)為Y是DR,Y認(rèn)為Z是DR…………這種網(wǎng)絡(luò),我們可以把它簡(jiǎn)單的當(dāng)成一個(gè)車(chē)轱轆:HUB and SPOKE.中心輻條式。指定HUB路由器為DR,而且讓SPOKE路由器不參加選舉。把網(wǎng)絡(luò)做成“一言堂”。(呵呵。此時(shí),HUB一人獨(dú)大,但是有個(gè)小問(wèn)題—-單點(diǎn)故障,它死了就沒(méi)人接替哦。當(dāng)然有其他辦法,這里不做討論。)
上面分析了一下思路,下面來(lái)整理一下:
我們指定R1路由器為HUB,而R2,R2為SPOKE.
R1和R2,R1和R3分別建立起鄰接,但是R2和R3因?yàn)橹虚g沒(méi)有PVC,只能依靠HUB來(lái)中轉(zhuǎn)。
我們提高后者不變R1的OSPF Priority,把R2和R3的降低或者改為0(0不參加選舉)
例:
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 123.123.123.1 255.255.255.0 a 0
net 1.1.1.1 255.255.255.0 a 0
neighbor 123.123.123.2 priority 5
neighbor 123.123.123.3 priority 10
router-id 123.123.123.1
R2
int lo 0
ip add 2.2.2.2 255.255.255.0
int s1/0
ip add 123.123.123.2 255.255.255.0
no shut
enc fr
fram map ip 123.123.123.1 201 bro
ip ospf net bro
ip ospf priority 0
router ospf 2.2.2.2
net 2.2.2.2 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
router-id 123.123.123.2
R3
int lo 0
ip add 3.3.3.3 255.255.255.0
int s1/0
ip add 123.123.123.3 255.255.255.0
no shut
enc fr
fram map ip 123.123.123.3 301bro
ip ospf net bro
ip ospf priority 0
router ospf 3.3.3.3
net 3.3.3.3 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
router-id 123.123.123.3
四、上一種情況的補(bǔ)充
PVC非全互連,支持廣播
我們前面總結(jié)的幾點(diǎn),有一個(gè)共同點(diǎn)—–我們想盡辦法讓它們可以正常選舉出DR來(lái)。這里對(duì)第三種情況補(bǔ)充一下:對(duì)于point-to-point鏈路,是不選舉DR的。我們可以通過(guò)劃分子接口來(lái)使OSPF在這種類(lèi)型的網(wǎng)絡(luò)中運(yùn)行。
依然使用上面的例子,R1的S1/0口分別連接著R2和R3,而R2和R3之間無(wú)PVC.
我們通過(guò)在R1的S1/0口上劃分兩個(gè)子接口分別對(duì)應(yīng)R2和R3,使之形成兩條point-to-point鏈路。此時(shí),R1和R2互為鄰接,R1和R3互為鄰接。
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
no shut
no ip add
en fr
int s1/0.1 point-to-point
ip add 12.12.12.1 255.255.255.0
ip ospf net point-to-point
fra interface-dlci 102
//對(duì)于點(diǎn)對(duì)點(diǎn)鏈路的子接口,在子接口上不需要做MAP映射,只定義本地DLCI即可
int s1/0.2 point-to-point
ip add 13.13.13.1 255.255.255.0
ip ospf net point-to-point
fra interface-dlci 103
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0
net 12.12.12.0 255.255.255.0 a 0
net 13.13.13.0 255.255.255.0 a 0
R2
R2其他的配置就不多贅述了,在R2和R3上基本相同,只需在接口上把OSPF網(wǎng)絡(luò)類(lèi)型改為point-to-point
ip ospf point-to-point
然后定義一個(gè)協(xié)議地址映射
fra map ip xxx.xxx.xxx.xxx dlci號(hào)
使用子接口這種辦法,有一個(gè)毛病,就是劃分子接口的時(shí)候會(huì)浪費(fèi)一個(gè)子網(wǎng)。不過(guò)好象大家都是實(shí)驗(yàn)環(huán)境。
五、繼續(xù)補(bǔ)充
PVC非全互連,支持廣播
對(duì)于前面的內(nèi)容,不多說(shuō)了,只看一下對(duì)于PVC支持廣播,且非全互連的第三種解決辦法
我們干脆把它配成非廣播類(lèi)型—–不支持廣播。但是非廣播不能選DR,那么我們手工選舉;非廣播,那鄰居關(guān)系,我們也是手工來(lái)指定。
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.1 255.255.255.0
en fr
no shut
ip ospf net non-broadcast
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0 a 0
neighbor 123.123.123.2
neighbor 123.123.123.3
R2
int lo 0
ip add 2.2.2.2 255.255.255.0
int s1/0
no shut
enc fr
ip add 123.123.123.2 255.255.255.0
fr map ip 123.123.123.1 201 bro
ip ospf net non-broadcast
ip ospf priority 0
R3
int lo 0
ip add 3.3.3.3 255.255.255.0
int s1/0
no shut
enc fr
ip ad 123.123.123.3 255.255.255.0
fr map ip 123.123.123.1 301 bro
ip ospf net non
ip ospf pri 0
六、對(duì)于PVC支持廣播且非全互連的解決途徑之四
在此條件下,將網(wǎng)絡(luò)環(huán)境整成點(diǎn)到多點(diǎn)類(lèi)型,并且指定鄰居
點(diǎn)到多點(diǎn),可以想象成多條點(diǎn)到點(diǎn)鏈路的集合
簡(jiǎn)單舉個(gè)配置例子(馬上要上班了,時(shí)間緊)
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.1 255.255.255.0
no shut
en fr
ip ospf net point-to-multi
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0 a 0
neighbor 123.123.123.2
neighbor 123.123.123.3
七、PVC不支持廣播,非全互連
不支持廣播,而且并非全互連,則必須指定鄰居。而在上面幾個(gè)例子中,只有NBMA和點(diǎn)到多點(diǎn)才指定鄰居,那么在這種環(huán)境下,我們將其按照點(diǎn)到多點(diǎn)非廣播的方式來(lái)做。
例子
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.0 255.255.255.0
en fr
no shut
fra map ip 123.123.123.2 102 (此處不接廣播參數(shù))
fra map ip 123.123.123.3 103
ip ospf net point-to-multipoint non-broadcast
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
neighbor 123.123.123.2
neighbor 123.123.123.3
在R2和R3上的接口上也使用ip ospf net point-to-mulitpoint non-broadcast來(lái)更改網(wǎng)絡(luò)類(lèi)型為點(diǎn)到多點(diǎn)非廣播。并且在路由配置模式下指定鄰居。
NBMA
N—-None
B—-broadcast
MA—-Multi Access
非廣播多路訪問(wèn)(NBMA)—廣播多路訪問(wèn)(BMA)
BMA可以簡(jiǎn)單的想象成我們的以太網(wǎng),當(dāng)然,它是支持廣播的。
而NBMA則可以想象成不支持廣播的以太網(wǎng)(PVC全互連)
那么如果要讓OSPF能在NBMA網(wǎng)絡(luò)中正常運(yùn)行(正常的經(jīng)歷幾個(gè)過(guò)程,必須要有DR的產(chǎn)生),只需讓NBMA網(wǎng)絡(luò)支持廣播即可。
OSPF定義了多種網(wǎng)絡(luò)類(lèi)型,我們可以在接口上定義網(wǎng)絡(luò)類(lèi)型參數(shù)
ip ospf net broadcast
例:
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fr map ip 12.12.12.2 102 broadcast
ip ospf net broadcast
二、PVC全互連,不支持廣播
與上例相似,但是不支持廣播,那么OSPF報(bào)文無(wú)法穿過(guò)網(wǎng)絡(luò)到達(dá)目的地,所以,它們無(wú)法建立鄰居關(guān)系,更不用說(shuō)DR和BDR選舉了。此時(shí),我們只要解決了一個(gè)問(wèn)題就可以了:把組播換成單播。如何變成單播發(fā)送呢?只需指定鄰居就OK了
neighbor 12.12.12.2 priority 5
neighbor 13.13.13.3 priority 10
例:
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 123.123.123.1 255.255.255.0 a 0
net 1.1.1.1 255.255.255.0 a 0
neighbor 123.123.123.2 priority 5
neighbor 123.123.123.3 priority 10
router-id 123.123.123.1
三、PVC非全互連,支持廣播
在這種類(lèi)型的環(huán)境中,我們知道,它是支持廣播的,但是并非全互連,這里就會(huì)有一個(gè)問(wèn)題—–部分設(shè)備之間沒(méi)有PVC.這樣會(huì)導(dǎo)致一個(gè)問(wèn)題:DR的選舉混亂。X認(rèn)為Y是DR,Y認(rèn)為Z是DR…………這種網(wǎng)絡(luò),我們可以把它簡(jiǎn)單的當(dāng)成一個(gè)車(chē)轱轆:HUB and SPOKE.中心輻條式。指定HUB路由器為DR,而且讓SPOKE路由器不參加選舉。把網(wǎng)絡(luò)做成“一言堂”。(呵呵。此時(shí),HUB一人獨(dú)大,但是有個(gè)小問(wèn)題—-單點(diǎn)故障,它死了就沒(méi)人接替哦。當(dāng)然有其他辦法,這里不做討論。)
上面分析了一下思路,下面來(lái)整理一下:
我們指定R1路由器為HUB,而R2,R2為SPOKE.
R1和R2,R1和R3分別建立起鄰接,但是R2和R3因?yàn)橹虚g沒(méi)有PVC,只能依靠HUB來(lái)中轉(zhuǎn)。
我們提高后者不變R1的OSPF Priority,把R2和R3的降低或者改為0(0不參加選舉)
例:
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 12.12.12.1 255.255.255.0
no shut
enc fr
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 123.123.123.1 255.255.255.0 a 0
net 1.1.1.1 255.255.255.0 a 0
neighbor 123.123.123.2 priority 5
neighbor 123.123.123.3 priority 10
router-id 123.123.123.1
R2
int lo 0
ip add 2.2.2.2 255.255.255.0
int s1/0
ip add 123.123.123.2 255.255.255.0
no shut
enc fr
fram map ip 123.123.123.1 201 bro
ip ospf net bro
ip ospf priority 0
router ospf 2.2.2.2
net 2.2.2.2 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
router-id 123.123.123.2
R3
int lo 0
ip add 3.3.3.3 255.255.255.0
int s1/0
ip add 123.123.123.3 255.255.255.0
no shut
enc fr
fram map ip 123.123.123.3 301bro
ip ospf net bro
ip ospf priority 0
router ospf 3.3.3.3
net 3.3.3.3 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
router-id 123.123.123.3
四、上一種情況的補(bǔ)充
PVC非全互連,支持廣播
我們前面總結(jié)的幾點(diǎn),有一個(gè)共同點(diǎn)—–我們想盡辦法讓它們可以正常選舉出DR來(lái)。這里對(duì)第三種情況補(bǔ)充一下:對(duì)于point-to-point鏈路,是不選舉DR的。我們可以通過(guò)劃分子接口來(lái)使OSPF在這種類(lèi)型的網(wǎng)絡(luò)中運(yùn)行。
依然使用上面的例子,R1的S1/0口分別連接著R2和R3,而R2和R3之間無(wú)PVC.
我們通過(guò)在R1的S1/0口上劃分兩個(gè)子接口分別對(duì)應(yīng)R2和R3,使之形成兩條point-to-point鏈路。此時(shí),R1和R2互為鄰接,R1和R3互為鄰接。
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
no shut
no ip add
en fr
int s1/0.1 point-to-point
ip add 12.12.12.1 255.255.255.0
ip ospf net point-to-point
fra interface-dlci 102
//對(duì)于點(diǎn)對(duì)點(diǎn)鏈路的子接口,在子接口上不需要做MAP映射,只定義本地DLCI即可
int s1/0.2 point-to-point
ip add 13.13.13.1 255.255.255.0
ip ospf net point-to-point
fra interface-dlci 103
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0
net 12.12.12.0 255.255.255.0 a 0
net 13.13.13.0 255.255.255.0 a 0
R2
R2其他的配置就不多贅述了,在R2和R3上基本相同,只需在接口上把OSPF網(wǎng)絡(luò)類(lèi)型改為point-to-point
ip ospf point-to-point
然后定義一個(gè)協(xié)議地址映射
fra map ip xxx.xxx.xxx.xxx dlci號(hào)
使用子接口這種辦法,有一個(gè)毛病,就是劃分子接口的時(shí)候會(huì)浪費(fèi)一個(gè)子網(wǎng)。不過(guò)好象大家都是實(shí)驗(yàn)環(huán)境。
五、繼續(xù)補(bǔ)充
PVC非全互連,支持廣播
對(duì)于前面的內(nèi)容,不多說(shuō)了,只看一下對(duì)于PVC支持廣播,且非全互連的第三種解決辦法
我們干脆把它配成非廣播類(lèi)型—–不支持廣播。但是非廣播不能選DR,那么我們手工選舉;非廣播,那鄰居關(guān)系,我們也是手工來(lái)指定。
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.1 255.255.255.0
en fr
no shut
ip ospf net non-broadcast
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0 a 0
neighbor 123.123.123.2
neighbor 123.123.123.3
R2
int lo 0
ip add 2.2.2.2 255.255.255.0
int s1/0
no shut
enc fr
ip add 123.123.123.2 255.255.255.0
fr map ip 123.123.123.1 201 bro
ip ospf net non-broadcast
ip ospf priority 0
R3
int lo 0
ip add 3.3.3.3 255.255.255.0
int s1/0
no shut
enc fr
ip ad 123.123.123.3 255.255.255.0
fr map ip 123.123.123.1 301 bro
ip ospf net non
ip ospf pri 0
六、對(duì)于PVC支持廣播且非全互連的解決途徑之四
在此條件下,將網(wǎng)絡(luò)環(huán)境整成點(diǎn)到多點(diǎn)類(lèi)型,并且指定鄰居
點(diǎn)到多點(diǎn),可以想象成多條點(diǎn)到點(diǎn)鏈路的集合
簡(jiǎn)單舉個(gè)配置例子(馬上要上班了,時(shí)間緊)
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.1 255.255.255.0
no shut
en fr
ip ospf net point-to-multi
fra map ip 123.123.123.2 102 bro
fra map ip 123.123.123.3 103 bro
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0 a 0
neighbor 123.123.123.2
neighbor 123.123.123.3
七、PVC不支持廣播,非全互連
不支持廣播,而且并非全互連,則必須指定鄰居。而在上面幾個(gè)例子中,只有NBMA和點(diǎn)到多點(diǎn)才指定鄰居,那么在這種環(huán)境下,我們將其按照點(diǎn)到多點(diǎn)非廣播的方式來(lái)做。
例子
R1
int lo 0
ip add 1.1.1.1 255.255.255.0
int s1/0
ip add 123.123.123.0 255.255.255.0
en fr
no shut
fra map ip 123.123.123.2 102 (此處不接廣播參數(shù))
fra map ip 123.123.123.3 103
ip ospf net point-to-multipoint non-broadcast
router ospf 1.1.1.1
net 1.1.1.1 255.255.255.0 a 0
net 123.123.123.0 255.255.255.0
neighbor 123.123.123.2
neighbor 123.123.123.3
在R2和R3上的接口上也使用ip ospf net point-to-mulitpoint non-broadcast來(lái)更改網(wǎng)絡(luò)類(lèi)型為點(diǎn)到多點(diǎn)非廣播。并且在路由配置模式下指定鄰居。